mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-25 12:31:15 -03:00
refactor(settings): rename update_flag_strategy to version_grouping with migration
This commit is contained in:
@@ -332,7 +332,7 @@
|
|||||||
"extraFolderPaths": "Zusätzliche Ordnerpfade",
|
"extraFolderPaths": "Zusätzliche Ordnerpfade",
|
||||||
"downloadPathTemplates": "Download-Pfad-Vorlagen",
|
"downloadPathTemplates": "Download-Pfad-Vorlagen",
|
||||||
"priorityTags": "Prioritäts-Tags",
|
"priorityTags": "Prioritäts-Tags",
|
||||||
"updateFlags": "Update-Markierungen",
|
"versionScope": "Update-Markierungen",
|
||||||
"exampleImages": "Beispielbilder",
|
"exampleImages": "Beispielbilder",
|
||||||
"autoOrganize": "Auto-Organisierung",
|
"autoOrganize": "Auto-Organisierung",
|
||||||
"metadata": "Metadaten",
|
"metadata": "Metadaten",
|
||||||
@@ -595,7 +595,7 @@
|
|||||||
"download": "Herunterladen",
|
"download": "Herunterladen",
|
||||||
"restartRequired": "Neustart erforderlich"
|
"restartRequired": "Neustart erforderlich"
|
||||||
},
|
},
|
||||||
"updateFlagStrategy": {
|
"versionGrouping": {
|
||||||
"label": "Strategie für Update-Markierungen",
|
"label": "Strategie für Update-Markierungen",
|
||||||
"help": "Entscheide, ob Update-Badges nur dann erscheinen, wenn eine neue Version dasselbe Basismodell wie deine lokalen Dateien verwendet, oder sobald es irgendein neueres Release für dieses Modell gibt.",
|
"help": "Entscheide, ob Update-Badges nur dann erscheinen, wenn eine neue Version dasselbe Basismodell wie deine lokalen Dateien verwendet, oder sobald es irgendein neueres Release für dieses Modell gibt.",
|
||||||
"options": {
|
"options": {
|
||||||
|
|||||||
@@ -332,7 +332,7 @@
|
|||||||
"extraFolderPaths": "Extra Folder Paths",
|
"extraFolderPaths": "Extra Folder Paths",
|
||||||
"downloadPathTemplates": "Download Path Templates",
|
"downloadPathTemplates": "Download Path Templates",
|
||||||
"priorityTags": "Priority Tags",
|
"priorityTags": "Priority Tags",
|
||||||
"updateFlags": "Update Flags",
|
"versionScope": "Version Scope",
|
||||||
"exampleImages": "Example Images",
|
"exampleImages": "Example Images",
|
||||||
"autoOrganize": "Auto-organize",
|
"autoOrganize": "Auto-organize",
|
||||||
"metadata": "Metadata",
|
"metadata": "Metadata",
|
||||||
@@ -595,12 +595,12 @@
|
|||||||
"download": "Download",
|
"download": "Download",
|
||||||
"restartRequired": "Requires restart"
|
"restartRequired": "Requires restart"
|
||||||
},
|
},
|
||||||
"updateFlagStrategy": {
|
"versionGrouping": {
|
||||||
"label": "Update Flag Strategy",
|
"label": "Version Grouping",
|
||||||
"help": "Decide whether update badges should only appear when a new release shares the same base model as your local files or whenever any newer version exists for that model.",
|
"help": "Decide how versions are grouped for display: by base model or all together. Also controls update badge logic and the VLM version list filtering.",
|
||||||
"options": {
|
"options": {
|
||||||
"sameBase": "Match updates by base model",
|
"sameBase": "Group by base model (same_base)",
|
||||||
"any": "Flag any available update"
|
"any": "Show all versions (any)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hideEarlyAccessUpdates": {
|
"hideEarlyAccessUpdates": {
|
||||||
|
|||||||
@@ -332,7 +332,7 @@
|
|||||||
"extraFolderPaths": "Rutas de carpetas adicionales",
|
"extraFolderPaths": "Rutas de carpetas adicionales",
|
||||||
"downloadPathTemplates": "Plantillas de rutas de descarga",
|
"downloadPathTemplates": "Plantillas de rutas de descarga",
|
||||||
"priorityTags": "Etiquetas prioritarias",
|
"priorityTags": "Etiquetas prioritarias",
|
||||||
"updateFlags": "Indicadores de actualización",
|
"versionScope": "Indicadores de actualización",
|
||||||
"exampleImages": "Imágenes de ejemplo",
|
"exampleImages": "Imágenes de ejemplo",
|
||||||
"autoOrganize": "Organización automática",
|
"autoOrganize": "Organización automática",
|
||||||
"metadata": "Metadatos",
|
"metadata": "Metadatos",
|
||||||
@@ -595,7 +595,7 @@
|
|||||||
"download": "Descargar",
|
"download": "Descargar",
|
||||||
"restartRequired": "Requiere reinicio"
|
"restartRequired": "Requiere reinicio"
|
||||||
},
|
},
|
||||||
"updateFlagStrategy": {
|
"versionGrouping": {
|
||||||
"label": "Estrategia de indicadores de actualización",
|
"label": "Estrategia de indicadores de actualización",
|
||||||
"help": "Decide si las insignias de actualización deben mostrarse solo cuando una nueva versión comparte el mismo modelo base que tus archivos locales o siempre que exista cualquier versión más reciente de ese modelo.",
|
"help": "Decide si las insignias de actualización deben mostrarse solo cuando una nueva versión comparte el mismo modelo base que tus archivos locales o siempre que exista cualquier versión más reciente de ese modelo.",
|
||||||
"options": {
|
"options": {
|
||||||
|
|||||||
@@ -332,7 +332,7 @@
|
|||||||
"extraFolderPaths": "Chemins de dossiers supplémentaires",
|
"extraFolderPaths": "Chemins de dossiers supplémentaires",
|
||||||
"downloadPathTemplates": "Modèles de chemin de téléchargement",
|
"downloadPathTemplates": "Modèles de chemin de téléchargement",
|
||||||
"priorityTags": "Étiquettes prioritaires",
|
"priorityTags": "Étiquettes prioritaires",
|
||||||
"updateFlags": "Indicateurs de mise à jour",
|
"versionScope": "Indicateurs de mise à jour",
|
||||||
"exampleImages": "Images d'exemple",
|
"exampleImages": "Images d'exemple",
|
||||||
"autoOrganize": "Organisation automatique",
|
"autoOrganize": "Organisation automatique",
|
||||||
"metadata": "Métadonnées",
|
"metadata": "Métadonnées",
|
||||||
@@ -595,7 +595,7 @@
|
|||||||
"download": "Télécharger",
|
"download": "Télécharger",
|
||||||
"restartRequired": "Redémarrage requis"
|
"restartRequired": "Redémarrage requis"
|
||||||
},
|
},
|
||||||
"updateFlagStrategy": {
|
"versionGrouping": {
|
||||||
"label": "Stratégie des indicateurs de mise à jour",
|
"label": "Stratégie des indicateurs de mise à jour",
|
||||||
"help": "Choisissez si les badges de mise à jour doivent apparaître uniquement lorsqu’une nouvelle version partage le même modèle de base que vos fichiers locaux, ou dès qu’il existe une version plus récente pour ce modèle.",
|
"help": "Choisissez si les badges de mise à jour doivent apparaître uniquement lorsqu’une nouvelle version partage le même modèle de base que vos fichiers locaux, ou dès qu’il existe une version plus récente pour ce modèle.",
|
||||||
"options": {
|
"options": {
|
||||||
|
|||||||
@@ -332,7 +332,7 @@
|
|||||||
"extraFolderPaths": "נתיבי תיקיות נוספים",
|
"extraFolderPaths": "נתיבי תיקיות נוספים",
|
||||||
"downloadPathTemplates": "תבניות נתיב הורדה",
|
"downloadPathTemplates": "תבניות נתיב הורדה",
|
||||||
"priorityTags": "תגיות עדיפות",
|
"priorityTags": "תגיות עדיפות",
|
||||||
"updateFlags": "תגי עדכון",
|
"versionScope": "תגי עדכון",
|
||||||
"exampleImages": "תמונות דוגמה",
|
"exampleImages": "תמונות דוגמה",
|
||||||
"autoOrganize": "ארגון אוטומטי",
|
"autoOrganize": "ארגון אוטומטי",
|
||||||
"metadata": "מטא-נתונים",
|
"metadata": "מטא-נתונים",
|
||||||
@@ -595,7 +595,7 @@
|
|||||||
"download": "הורד",
|
"download": "הורד",
|
||||||
"restartRequired": "דורש הפעלה מחדש"
|
"restartRequired": "דורש הפעלה מחדש"
|
||||||
},
|
},
|
||||||
"updateFlagStrategy": {
|
"versionGrouping": {
|
||||||
"label": "אסטרטגיית תגי עדכון",
|
"label": "אסטרטגיית תגי עדכון",
|
||||||
"help": "בחרו אם תוויות העדכון יוצגו רק כאשר גרסה חדשה חולקת את אותו דגם בסיס כמו הקבצים המקומיים שלכם או בכל מקרה שבו קיימת גרסה חדשה עבור אותו דגם.",
|
"help": "בחרו אם תוויות העדכון יוצגו רק כאשר גרסה חדשה חולקת את אותו דגם בסיס כמו הקבצים המקומיים שלכם או בכל מקרה שבו קיימת גרסה חדשה עבור אותו דגם.",
|
||||||
"options": {
|
"options": {
|
||||||
|
|||||||
@@ -332,7 +332,7 @@
|
|||||||
"extraFolderPaths": "追加フォルダーパス",
|
"extraFolderPaths": "追加フォルダーパス",
|
||||||
"downloadPathTemplates": "ダウンロードパステンプレート",
|
"downloadPathTemplates": "ダウンロードパステンプレート",
|
||||||
"priorityTags": "優先タグ",
|
"priorityTags": "優先タグ",
|
||||||
"updateFlags": "アップデートフラグ",
|
"versionScope": "アップデートフラグ",
|
||||||
"exampleImages": "例画像",
|
"exampleImages": "例画像",
|
||||||
"autoOrganize": "自動整理",
|
"autoOrganize": "自動整理",
|
||||||
"metadata": "メタデータ",
|
"metadata": "メタデータ",
|
||||||
@@ -595,7 +595,7 @@
|
|||||||
"download": "ダウンロード",
|
"download": "ダウンロード",
|
||||||
"restartRequired": "再起動が必要"
|
"restartRequired": "再起動が必要"
|
||||||
},
|
},
|
||||||
"updateFlagStrategy": {
|
"versionGrouping": {
|
||||||
"label": "アップデートフラグの表示戦略",
|
"label": "アップデートフラグの表示戦略",
|
||||||
"help": "新リリースがローカルファイルと同じベースモデルを共有する場合にのみ更新バッジを表示するか、そのモデルに新しいバージョンがあれば常に表示するかを決めます。",
|
"help": "新リリースがローカルファイルと同じベースモデルを共有する場合にのみ更新バッジを表示するか、そのモデルに新しいバージョンがあれば常に表示するかを決めます。",
|
||||||
"options": {
|
"options": {
|
||||||
|
|||||||
@@ -332,7 +332,7 @@
|
|||||||
"extraFolderPaths": "추가 폴다 경로",
|
"extraFolderPaths": "추가 폴다 경로",
|
||||||
"downloadPathTemplates": "다운로드 경로 템플릿",
|
"downloadPathTemplates": "다운로드 경로 템플릿",
|
||||||
"priorityTags": "우선순위 태그",
|
"priorityTags": "우선순위 태그",
|
||||||
"updateFlags": "업데이트 표시",
|
"versionScope": "업데이트 표시",
|
||||||
"exampleImages": "예시 이미지",
|
"exampleImages": "예시 이미지",
|
||||||
"autoOrganize": "자동 정리",
|
"autoOrganize": "자동 정리",
|
||||||
"metadata": "메타데이터",
|
"metadata": "메타데이터",
|
||||||
@@ -595,7 +595,7 @@
|
|||||||
"download": "다운로드",
|
"download": "다운로드",
|
||||||
"restartRequired": "재시작 필요"
|
"restartRequired": "재시작 필요"
|
||||||
},
|
},
|
||||||
"updateFlagStrategy": {
|
"versionGrouping": {
|
||||||
"label": "업데이트 표시 전략",
|
"label": "업데이트 표시 전략",
|
||||||
"help": "새 릴리스가 로컬 파일과 동일한 베이스 모델을 공유할 때만 업데이트 배지를 표시할지, 또는 해당 모델에 사용 가능한 새 버전이 있으면 항상 표시할지 결정합니다.",
|
"help": "새 릴리스가 로컬 파일과 동일한 베이스 모델을 공유할 때만 업데이트 배지를 표시할지, 또는 해당 모델에 사용 가능한 새 버전이 있으면 항상 표시할지 결정합니다.",
|
||||||
"options": {
|
"options": {
|
||||||
|
|||||||
@@ -332,7 +332,7 @@
|
|||||||
"extraFolderPaths": "Дополнительные пути к папкам",
|
"extraFolderPaths": "Дополнительные пути к папкам",
|
||||||
"downloadPathTemplates": "Шаблоны путей загрузки",
|
"downloadPathTemplates": "Шаблоны путей загрузки",
|
||||||
"priorityTags": "Приоритетные теги",
|
"priorityTags": "Приоритетные теги",
|
||||||
"updateFlags": "Метки обновлений",
|
"versionScope": "Метки обновлений",
|
||||||
"exampleImages": "Примеры изображений",
|
"exampleImages": "Примеры изображений",
|
||||||
"autoOrganize": "Автоорганизация",
|
"autoOrganize": "Автоорганизация",
|
||||||
"metadata": "Метаданные",
|
"metadata": "Метаданные",
|
||||||
@@ -595,7 +595,7 @@
|
|||||||
"download": "Загрузить",
|
"download": "Загрузить",
|
||||||
"restartRequired": "Требует перезапуска"
|
"restartRequired": "Требует перезапуска"
|
||||||
},
|
},
|
||||||
"updateFlagStrategy": {
|
"versionGrouping": {
|
||||||
"label": "Стратегия меток обновлений",
|
"label": "Стратегия меток обновлений",
|
||||||
"help": "Выберите, отображать ли значки обновления только когда новая версия имеет тот же базовый модель, что и локальные файлы, или всегда при наличии любого нового релиза для этой модели.",
|
"help": "Выберите, отображать ли значки обновления только когда новая версия имеет тот же базовый модель, что и локальные файлы, или всегда при наличии любого нового релиза для этой модели.",
|
||||||
"options": {
|
"options": {
|
||||||
|
|||||||
@@ -332,7 +332,7 @@
|
|||||||
"extraFolderPaths": "额外文件夹路径",
|
"extraFolderPaths": "额外文件夹路径",
|
||||||
"downloadPathTemplates": "下载路径模板",
|
"downloadPathTemplates": "下载路径模板",
|
||||||
"priorityTags": "优先标签",
|
"priorityTags": "优先标签",
|
||||||
"updateFlags": "更新标记",
|
"versionScope": "版本范围",
|
||||||
"exampleImages": "示例图片",
|
"exampleImages": "示例图片",
|
||||||
"autoOrganize": "自动整理",
|
"autoOrganize": "自动整理",
|
||||||
"metadata": "元数据",
|
"metadata": "元数据",
|
||||||
@@ -595,12 +595,12 @@
|
|||||||
"download": "下载",
|
"download": "下载",
|
||||||
"restartRequired": "需要重启"
|
"restartRequired": "需要重启"
|
||||||
},
|
},
|
||||||
"updateFlagStrategy": {
|
"versionGrouping": {
|
||||||
"label": "更新标记策略",
|
"label": "版本分组",
|
||||||
"help": "决定更新徽章是否仅在新版本与本地文件共享相同基础模型时显示,或只要该模型有任何更新版本就显示。",
|
"help": "控制版本在 UI 中的分组方式:按基础模型分组或合并显示。同时影响更新徽章逻辑和版本列表的筛选行为。",
|
||||||
"options": {
|
"options": {
|
||||||
"sameBase": "按基础模型匹配更新",
|
"sameBase": "按基础模型分组",
|
||||||
"any": "显示任何可用更新"
|
"any": "显示所有版本"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hideEarlyAccessUpdates": {
|
"hideEarlyAccessUpdates": {
|
||||||
|
|||||||
@@ -332,7 +332,7 @@
|
|||||||
"extraFolderPaths": "額外資料夾路徑",
|
"extraFolderPaths": "額外資料夾路徑",
|
||||||
"downloadPathTemplates": "下載路徑範本",
|
"downloadPathTemplates": "下載路徑範本",
|
||||||
"priorityTags": "優先標籤",
|
"priorityTags": "優先標籤",
|
||||||
"updateFlags": "更新標記",
|
"versionScope": "版本範圍",
|
||||||
"exampleImages": "範例圖片",
|
"exampleImages": "範例圖片",
|
||||||
"autoOrganize": "自動整理",
|
"autoOrganize": "自動整理",
|
||||||
"metadata": "中繼資料",
|
"metadata": "中繼資料",
|
||||||
@@ -595,7 +595,7 @@
|
|||||||
"download": "下載",
|
"download": "下載",
|
||||||
"restartRequired": "需要重新啟動"
|
"restartRequired": "需要重新啟動"
|
||||||
},
|
},
|
||||||
"updateFlagStrategy": {
|
"versionGrouping": {
|
||||||
"label": "更新標記策略",
|
"label": "更新標記策略",
|
||||||
"help": "決定更新徽章是否僅在新版本與本地檔案共享相同基礎模型時顯示,或只要該模型有任何更新版本就顯示。",
|
"help": "決定更新徽章是否僅在新版本與本地檔案共享相同基礎模型時顯示,或只要該模型有任何更新版本就顯示。",
|
||||||
"options": {
|
"options": {
|
||||||
|
|||||||
@@ -116,11 +116,11 @@ class BaseModelService(ABC):
|
|||||||
dedup_lost = 0
|
dedup_lost = 0
|
||||||
if kwargs.get("group_by_model") and civitai_model_id is None:
|
if kwargs.get("group_by_model") and civitai_model_id is None:
|
||||||
# Determine whether to further sub-group by base model
|
# Determine whether to further sub-group by base model
|
||||||
# When update_flag_strategy is "same_base", versions with different
|
# When version_grouping is "same_base", versions with different
|
||||||
# base models are effectively different groups — the dedup key
|
# base models are effectively different groups — the dedup key
|
||||||
# needs to include base_model so the version count and VLM flow
|
# needs to include base_model so the version count and VLM flow
|
||||||
# stay consistent (card shows correct count for its base model).
|
# stay consistent (card shows correct count for its base model).
|
||||||
ufs = self.settings.get("update_flag_strategy", "same_base")
|
ufs = self.settings.get("version_grouping", "same_base")
|
||||||
group_by_base = ufs == "same_base"
|
group_by_base = ufs == "same_base"
|
||||||
|
|
||||||
dedup_map = {} # (modelId [,base_model]) -> (item, version_id)
|
dedup_map = {} # (modelId [,base_model]) -> (item, version_id)
|
||||||
@@ -551,7 +551,7 @@ class BaseModelService(ABC):
|
|||||||
if not ordered_ids:
|
if not ordered_ids:
|
||||||
return annotated
|
return annotated
|
||||||
|
|
||||||
strategy_value = self.settings.get("update_flag_strategy")
|
strategy_value = self.settings.get("version_grouping")
|
||||||
if isinstance(strategy_value, str) and strategy_value.strip():
|
if isinstance(strategy_value, str) and strategy_value.strip():
|
||||||
strategy = strategy_value.strip().lower()
|
strategy = strategy_value.strip().lower()
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ DEFAULT_SETTINGS: Dict[str, Any] = {
|
|||||||
"lora_syntax_format": "legacy",
|
"lora_syntax_format": "legacy",
|
||||||
"model_card_footer_action": "replace_preview",
|
"model_card_footer_action": "replace_preview",
|
||||||
"show_version_on_card": True,
|
"show_version_on_card": True,
|
||||||
"update_flag_strategy": "same_base",
|
"version_grouping": "same_base",
|
||||||
"auto_organize_exclusions": [],
|
"auto_organize_exclusions": [],
|
||||||
"metadata_refresh_skip_paths": [],
|
"metadata_refresh_skip_paths": [],
|
||||||
"skip_previously_downloaded_model_versions": False,
|
"skip_previously_downloaded_model_versions": False,
|
||||||
@@ -745,6 +745,7 @@ class SettingsManager:
|
|||||||
"includeTriggerWords": "include_trigger_words",
|
"includeTriggerWords": "include_trigger_words",
|
||||||
"compactMode": "compact_mode",
|
"compactMode": "compact_mode",
|
||||||
"modelCardFooterAction": "model_card_footer_action",
|
"modelCardFooterAction": "model_card_footer_action",
|
||||||
|
"update_flag_strategy": "version_grouping",
|
||||||
}
|
}
|
||||||
|
|
||||||
updated = False
|
updated = False
|
||||||
|
|||||||
@@ -275,8 +275,8 @@ function handleViewLocalVersionsFromCard(card, modelType) {
|
|||||||
const modelId = card.dataset.modelId;
|
const modelId = card.dataset.modelId;
|
||||||
const modelName = card.dataset.name;
|
const modelName = card.dataset.name;
|
||||||
if (!modelId) return;
|
if (!modelId) return;
|
||||||
// Respect update_flag_strategy: only filter by base model when the strategy says so
|
// Respect version_grouping: only filter by base model when the strategy says so
|
||||||
const strategy = state.global?.settings?.update_flag_strategy;
|
const strategy = state.global?.settings?.version_grouping;
|
||||||
const shouldFilterByBase = strategy === 'same_base';
|
const shouldFilterByBase = strategy === 'same_base';
|
||||||
const baseModel = shouldFilterByBase && card.dataset.base_model !== 'Unknown'
|
const baseModel = shouldFilterByBase && card.dataset.base_model !== 'Unknown'
|
||||||
? card.dataset.base_model
|
? card.dataset.base_model
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ function getToggleTooltipText(mode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getDefaultDisplayMode() {
|
function getDefaultDisplayMode() {
|
||||||
const strategy = state?.global?.settings?.update_flag_strategy;
|
const strategy = state?.global?.settings?.version_grouping;
|
||||||
return strategy === DISPLAY_FILTER_MODES.SAME_BASE
|
return strategy === DISPLAY_FILTER_MODES.SAME_BASE
|
||||||
? DISPLAY_FILTER_MODES.SAME_BASE
|
? DISPLAY_FILTER_MODES.SAME_BASE
|
||||||
: DISPLAY_FILTER_MODES.ANY;
|
: DISPLAY_FILTER_MODES.ANY;
|
||||||
@@ -339,7 +339,7 @@ function resolveUpdateAvailability(record, baseModel, currentVersionId) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const strategy = state?.global?.settings?.update_flag_strategy;
|
const strategy = state?.global?.settings?.version_grouping;
|
||||||
const sameBaseMode = strategy === DISPLAY_FILTER_MODES.SAME_BASE;
|
const sameBaseMode = strategy === DISPLAY_FILTER_MODES.SAME_BASE;
|
||||||
const hideEarlyAccess = state?.global?.settings?.hide_early_access_updates;
|
const hideEarlyAccess = state?.global?.settings?.hide_early_access_updates;
|
||||||
|
|
||||||
|
|||||||
@@ -917,9 +917,9 @@ export class SettingsManager {
|
|||||||
modelNameDisplaySelect.value = state.global.settings.model_name_display || 'model_name';
|
modelNameDisplaySelect.value = state.global.settings.model_name_display || 'model_name';
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateFlagStrategySelect = document.getElementById('updateFlagStrategy');
|
const versionGroupingSelect = document.getElementById('versionGrouping');
|
||||||
if (updateFlagStrategySelect) {
|
if (versionGroupingSelect) {
|
||||||
updateFlagStrategySelect.value = state.global.settings.update_flag_strategy || 'same_base';
|
versionGroupingSelect.value = state.global.settings.version_grouping || 'same_base';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set hide early access updates setting
|
// Set hide early access updates setting
|
||||||
@@ -2070,7 +2070,7 @@ export class SettingsManager {
|
|||||||
if (
|
if (
|
||||||
settingKey === 'model_name_display'
|
settingKey === 'model_name_display'
|
||||||
|| settingKey === 'model_card_footer_action'
|
|| settingKey === 'model_card_footer_action'
|
||||||
|| settingKey === 'update_flag_strategy'
|
|| settingKey === 'version_grouping'
|
||||||
|| settingKey === 'mature_blur_level'
|
|| settingKey === 'mature_blur_level'
|
||||||
) {
|
) {
|
||||||
this.reloadContent();
|
this.reloadContent();
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const DEFAULT_SETTINGS_BASE = Object.freeze({
|
|||||||
include_trigger_words: false,
|
include_trigger_words: false,
|
||||||
compact_mode: false,
|
compact_mode: false,
|
||||||
priority_tags: { ...DEFAULT_PRIORITY_TAG_CONFIG },
|
priority_tags: { ...DEFAULT_PRIORITY_TAG_CONFIG },
|
||||||
update_flag_strategy: 'same_base',
|
version_grouping: 'same_base',
|
||||||
hide_early_access_updates: false,
|
hide_early_access_updates: false,
|
||||||
auto_organize_exclusions: [],
|
auto_organize_exclusions: [],
|
||||||
metadata_refresh_skip_paths: [],
|
metadata_refresh_skip_paths: [],
|
||||||
|
|||||||
@@ -1100,23 +1100,23 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Update Flags -->
|
<!-- Version Scope -->
|
||||||
<div class="settings-subsection">
|
<div class="settings-subsection">
|
||||||
<div class="settings-subsection-header">
|
<div class="settings-subsection-header">
|
||||||
<h4>{{ t('settings.sections.updateFlags') }}</h4>
|
<h4>{{ t('settings.sections.versionScope') }}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-item">
|
<div class="setting-item">
|
||||||
<div class="setting-row">
|
<div class="setting-row">
|
||||||
<div class="setting-info">
|
<div class="setting-info">
|
||||||
<label for="updateFlagStrategy">
|
<label for="versionGrouping">
|
||||||
{{ t('settings.updateFlagStrategy.label') }}
|
{{ t('settings.versionGrouping.label') }}
|
||||||
<i class="fas fa-info-circle info-icon" data-tooltip="{{ t('settings.updateFlagStrategy.help') }}"></i>
|
<i class="fas fa-info-circle info-icon" data-tooltip="{{ t('settings.versionGrouping.help') }}"></i>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-control select-control">
|
<div class="setting-control select-control">
|
||||||
<select id="updateFlagStrategy" onchange="settingsManager.saveSelectSetting('updateFlagStrategy', 'update_flag_strategy')">
|
<select id="versionGrouping" onchange="settingsManager.saveSelectSetting('versionGrouping', 'version_grouping')">
|
||||||
<option value="same_base">{{ t('settings.updateFlagStrategy.options.sameBase') }}</option>
|
<option value="same_base">{{ t('settings.versionGrouping.options.sameBase') }}</option>
|
||||||
<option value="any">{{ t('settings.updateFlagStrategy.options.any') }}</option>
|
<option value="any">{{ t('settings.versionGrouping.options.any') }}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const stateMock = {
|
|||||||
global: {
|
global: {
|
||||||
settings: {
|
settings: {
|
||||||
autoplay_on_hover: false,
|
autoplay_on_hover: false,
|
||||||
update_flag_strategy: 'any',
|
version_grouping: 'any',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -67,7 +67,7 @@ describe('ModelVersionsTab media rendering', () => {
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
stateMock.global.settings.autoplay_on_hover = false;
|
stateMock.global.settings.autoplay_on_hover = false;
|
||||||
stateMock.global.settings.update_flag_strategy = 'any';
|
stateMock.global.settings.version_grouping = 'any';
|
||||||
({ getModelApiClient } = await import(API_FACTORY_MODULE));
|
({ getModelApiClient } = await import(API_FACTORY_MODULE));
|
||||||
fetchModelUpdateVersions = vi.fn();
|
fetchModelUpdateVersions = vi.fn();
|
||||||
getModelApiClient.mockReturnValue({
|
getModelApiClient.mockReturnValue({
|
||||||
@@ -157,7 +157,7 @@ describe('ModelVersionsTab media rendering', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('shows a stable label with a short state indicator', async () => {
|
it('shows a stable label with a short state indicator', async () => {
|
||||||
stateMock.global.settings.update_flag_strategy = 'any';
|
stateMock.global.settings.version_grouping = 'any';
|
||||||
fetchModelUpdateVersions.mockResolvedValue({
|
fetchModelUpdateVersions.mockResolvedValue({
|
||||||
success: true,
|
success: true,
|
||||||
record: {
|
record: {
|
||||||
@@ -192,7 +192,7 @@ describe('ModelVersionsTab media rendering', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('filters versions to the current base model when strategy is same_base', async () => {
|
it('filters versions to the current base model when strategy is same_base', async () => {
|
||||||
stateMock.global.settings.update_flag_strategy = 'same_base';
|
stateMock.global.settings.version_grouping = 'same_base';
|
||||||
fetchModelUpdateVersions.mockResolvedValue({
|
fetchModelUpdateVersions.mockResolvedValue({
|
||||||
success: true,
|
success: true,
|
||||||
record: {
|
record: {
|
||||||
@@ -235,7 +235,7 @@ describe('ModelVersionsTab media rendering', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('toggle button can switch to display all versions', async () => {
|
it('toggle button can switch to display all versions', async () => {
|
||||||
stateMock.global.settings.update_flag_strategy = 'same_base';
|
stateMock.global.settings.version_grouping = 'same_base';
|
||||||
fetchModelUpdateVersions.mockResolvedValue({
|
fetchModelUpdateVersions.mockResolvedValue({
|
||||||
success: true,
|
success: true,
|
||||||
record: {
|
record: {
|
||||||
@@ -286,7 +286,7 @@ describe('ModelVersionsTab media rendering', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('shows a newer version badge when viewing same-base results', async () => {
|
it('shows a newer version badge when viewing same-base results', async () => {
|
||||||
stateMock.global.settings.update_flag_strategy = 'same_base';
|
stateMock.global.settings.version_grouping = 'same_base';
|
||||||
fetchModelUpdateVersions.mockResolvedValue({
|
fetchModelUpdateVersions.mockResolvedValue({
|
||||||
success: true,
|
success: true,
|
||||||
record: {
|
record: {
|
||||||
|
|||||||
@@ -482,7 +482,7 @@ async def test_get_paginated_data_annotates_update_flags_with_bulk_dedup():
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_update_flag_strategy_same_base_prefers_matching_base():
|
async def test_version_grouping_same_base_prefers_matching_base():
|
||||||
items = [
|
items = [
|
||||||
{
|
{
|
||||||
"model_name": "Pony Version",
|
"model_name": "Pony Version",
|
||||||
@@ -551,7 +551,7 @@ async def test_update_flag_strategy_same_base_prefers_matching_base():
|
|||||||
should_ignore_model=False,
|
should_ignore_model=False,
|
||||||
)
|
)
|
||||||
update_service = StubUpdateServiceWithRecords({1: record})
|
update_service = StubUpdateServiceWithRecords({1: record})
|
||||||
settings = StubSettings({"update_flag_strategy": "same_base"})
|
settings = StubSettings({"version_grouping": "same_base"})
|
||||||
|
|
||||||
service = DummyService(
|
service = DummyService(
|
||||||
model_type="stub",
|
model_type="stub",
|
||||||
@@ -579,7 +579,7 @@ async def test_update_flag_strategy_same_base_prefers_matching_base():
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_update_flag_strategy_same_base_honors_latest_local_version():
|
async def test_version_grouping_same_base_honors_latest_local_version():
|
||||||
items = [
|
items = [
|
||||||
{
|
{
|
||||||
"model_name": "Pony v0.1",
|
"model_name": "Pony v0.1",
|
||||||
@@ -648,7 +648,7 @@ async def test_update_flag_strategy_same_base_honors_latest_local_version():
|
|||||||
should_ignore_model=False,
|
should_ignore_model=False,
|
||||||
)
|
)
|
||||||
update_service = StubUpdateServiceWithRecords({1: record})
|
update_service = StubUpdateServiceWithRecords({1: record})
|
||||||
settings = StubSettings({"update_flag_strategy": "same_base"})
|
settings = StubSettings({"version_grouping": "same_base"})
|
||||||
|
|
||||||
service = DummyService(
|
service = DummyService(
|
||||||
model_type="stub",
|
model_type="stub",
|
||||||
|
|||||||
Reference in New Issue
Block a user