From dc1d12649a90af88b8cd7da1c6d71aff6f6b84bf Mon Sep 17 00:00:00 2001 From: Ainaemaet Date: Thu, 26 Feb 2026 00:09:26 -0700 Subject: [PATCH] feat(ui): add hidden-files toggle and i18n updates (#214) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(search): add multi-token regex and wildcard support * feat(ui): add layout toggle button in Model Manager header * feat(ui): add hidden-files toggle and i18n updates - Added a new header button in the Model Manager to toggle display of hidden files/folders (dot-prefixed). This updates the existing `ModelManager.Scan.IncludeHiddenFiles` setting, persists it, and refreshes the dialog so changes apply immediately. - Button shows dynamic icon + tooltip: - 👁 "Show hidden files" - 👁‍🗨 "Hide hidden files" - Updated i18n locale files: - en.json: added strings for both the layout toggle and hidden-files toggle - zh.json: added translations for the same strings Note: normally these i18n keys would have been split between the layout commit and this one, but they are grouped here for simplicity so all UI strings for the new header buttons are introduced together. --------- Co-authored-by: Hayden <48267247+hayden-fr@users.noreply.github.com> --- src/App.vue | 10 ++++++++++ src/components/DialogManager.vue | 1 + src/locales/en.json | 6 +++++- src/locales/zh.json | 6 +++++- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 0f69319..2e37513 100644 --- a/src/App.vue +++ b/src/App.vue @@ -92,6 +92,16 @@ onMounted(() => { const openManagerDialog = () => { const { cardWidth, gutter, aspect, flat } = config + // choose icon depending on current layout + const layoutIcon = flat.value ? 'pi pi-folder-open' : 'pi pi-th-large' + // determine hidden files setting + const includeHidden = + app.ui?.settings.getSettingValue('ModelManager.Scan.IncludeHiddenFiles') ?? + false + const hiddenIcon = includeHidden ? 'pi pi-eye' : 'pi pi-eye-slash' + const hiddenTooltip = includeHidden + ? t('hideHiddenFiles') + : t('showHiddenFiles') const layoutIcon = flat.value ? 'pi pi-th-large' : 'pi pi-folder-open' diff --git a/src/components/DialogManager.vue b/src/components/DialogManager.vue index ef0ebeb..d23b532 100644 --- a/src/components/DialogManager.vue +++ b/src/components/DialogManager.vue @@ -278,6 +278,7 @@ const list = computed(() => { }) }) + const contentStyle = computed(() => ({ gridTemplateColumns: `repeat(auto-fit, ${cardSize.value.width}px)`, gap: `${gutter}px`, diff --git a/src/locales/en.json b/src/locales/en.json index 841b3b0..808bb04 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -74,5 +74,9 @@ "ui": "UI", "cardSize": "Card Size", "useFlatUI": "Flat Layout" - } + }, + "switchToFolderView": "Switch to Folder View", + "switchToFlatView": "Switch to Flat View", + "hideHiddenFiles": "Hide hidden files", + "showHiddenFiles": "Show hidden files" } diff --git a/src/locales/zh.json b/src/locales/zh.json index 962aab4..cffb216 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -74,5 +74,9 @@ "ui": "外观", "cardSize": "卡片尺寸", "useFlatUI": "展平布局" - } + }, + "switchToFolderView": "切换到文件夹视图", + "switchToFlatView": "切换到平铺视图", + "hideHiddenFiles": "隐藏隐藏文件", + "showHiddenFiles": "显示隐藏文件" }