feat(ui): show version count in group-by-model cards, add versions_count sort, no-reload VLM

- group_by_model dedup now counts versions per group and attaches
  version_count; respects update_flag_strategy (same_base) by
  sub-grouping on base_model
- Card footer shows clickable 'x versions' link instead of version
  name when grouped (hides HIGH/LOW badges); clicking triggers
  View Local Versions without page reload
- Added 'Local Versions' sort option (versions_count), auto-hidden
  when group_by_model is off
- Sort preference is saved/restored separately for normal and
  grouped modes
- VLM flow (triggerVlmView, clearCustomFilter) uses resetAndReload()
  via API instead of window.location.reload()
- Fixed cache mutation bug: version_count is now set on a shallow
  copy, not the cached dict, preventing stale version_count leaking
  into VLM responses
- i18n: all 9 locale files translated
This commit is contained in:
Will Miao
2026-06-22 16:02:12 +08:00
parent 2b361f4f5d
commit 94f43426d7
26 changed files with 333 additions and 24 deletions

View File

@@ -790,8 +790,14 @@ async def test_get_paginated_data_group_by_model_dedup():
for item in response["items"]:
if item.get("civitai", {}).get("modelId") == 1:
assert item["civitai"]["id"] == 200
# version_count should reflect total versions for this model
assert item.get("version_count") == 2, f"Expected version_count=2, got {item.get('version_count')}"
elif item.get("civitai", {}).get("modelId") == 2:
assert item["civitai"]["id"] == 99
assert item.get("version_count") == 2, f"Expected version_count=2, got {item.get('version_count')}"
else:
# Standalone item should NOT have version_count
assert "version_count" not in item, f"Standalone should not have version_count"
# With group_by_model=False (default) — all 5 items pass through
response_all = await service.get_paginated_data(