From e9c3001c2857426ba78d2e0fc0a4162b8258c444 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sat, 13 Dec 2025 01:16:51 +0800 Subject: [PATCH] add search box in tag filter page / dialog (#382) --- src/locales/de.json | 3 - src/locales/en.json | 3 - src/locales/es.json | 3 - src/locales/fr.json | 3 - src/locales/it.json | 3 - src/locales/ja.json | 3 - src/locales/kn.json | 3 - src/locales/ko.json | 3 - src/locales/nl.json | 3 - src/locales/pt_BR.json | 3 - src/locales/ru.json | 3 - src/locales/th.json | 3 - src/locales/tr.json | 3 - src/locales/uk.json | 3 - src/locales/vi.json | 3 - src/locales/zh_Hans.json | 3 - src/locales/zh_Hant.json | 3 - .../TransactionTagFilterSettingPageBase.ts | 26 +++- .../TransactionTagFilterSettingsCard.vue | 145 ++++++------------ .../TransactionTagFilterSettingsPage.vue | 42 ++--- 20 files changed, 89 insertions(+), 175 deletions(-) diff --git a/src/locales/de.json b/src/locales/de.json index df31b2bc..4422e2b1 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -1560,9 +1560,6 @@ "Set All to Included": "Set All to Included", "Set All to Default": "Set All to Default", "Set All to Excluded": "Set All to Excluded", - "Set All Visible Items to Included": "Set All Visible Items to Included", - "Set All Visible Items to Default": "Set All Visible Items to Default", - "Set All Visible Items to Excluded": "Set All Visible Items to Excluded", "Back": "Zurück", "Load More": "Mehr laden", "Export Results": "Export Results", diff --git a/src/locales/en.json b/src/locales/en.json index 4186c732..ff5cbaf7 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1560,9 +1560,6 @@ "Set All to Included": "Set All to Included", "Set All to Default": "Set All to Default", "Set All to Excluded": "Set All to Excluded", - "Set All Visible Items to Included": "Set All Visible Items to Included", - "Set All Visible Items to Default": "Set All Visible Items to Default", - "Set All Visible Items to Excluded": "Set All Visible Items to Excluded", "Back": "Back", "Load More": "Load More", "Export Results": "Export Results", diff --git a/src/locales/es.json b/src/locales/es.json index 36ec36bf..4e8e01d4 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -1560,9 +1560,6 @@ "Set All to Included": "Set All to Included", "Set All to Default": "Set All to Default", "Set All to Excluded": "Set All to Excluded", - "Set All Visible Items to Included": "Set All Visible Items to Included", - "Set All Visible Items to Default": "Set All Visible Items to Default", - "Set All Visible Items to Excluded": "Set All Visible Items to Excluded", "Back": "Atrás", "Load More": "Cargar Más", "Export Results": "Exportar Resultados", diff --git a/src/locales/fr.json b/src/locales/fr.json index cd9b1e75..d114dbf9 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -1560,9 +1560,6 @@ "Set All to Included": "Set All to Included", "Set All to Default": "Set All to Default", "Set All to Excluded": "Set All to Excluded", - "Set All Visible Items to Included": "Set All Visible Items to Included", - "Set All Visible Items to Default": "Set All Visible Items to Default", - "Set All Visible Items to Excluded": "Set All Visible Items to Excluded", "Back": "Retour", "Load More": "Charger plus", "Export Results": "Exporter les résultats", diff --git a/src/locales/it.json b/src/locales/it.json index caadd0f4..7a025033 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -1560,9 +1560,6 @@ "Set All to Included": "Set All to Included", "Set All to Default": "Set All to Default", "Set All to Excluded": "Set All to Excluded", - "Set All Visible Items to Included": "Set All Visible Items to Included", - "Set All Visible Items to Default": "Set All Visible Items to Default", - "Set All Visible Items to Excluded": "Set All Visible Items to Excluded", "Back": "Indietro", "Load More": "Carica altro", "Export Results": "Export Results", diff --git a/src/locales/ja.json b/src/locales/ja.json index ff369751..36f0799c 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -1560,9 +1560,6 @@ "Set All to Included": "Set All to Included", "Set All to Default": "Set All to Default", "Set All to Excluded": "Set All to Excluded", - "Set All Visible Items to Included": "Set All Visible Items to Included", - "Set All Visible Items to Default": "Set All Visible Items to Default", - "Set All Visible Items to Excluded": "Set All Visible Items to Excluded", "Back": "戻る", "Load More": "さらに読み込む", "Export Results": "Export Results", diff --git a/src/locales/kn.json b/src/locales/kn.json index 3581f086..0a329060 100644 --- a/src/locales/kn.json +++ b/src/locales/kn.json @@ -1560,9 +1560,6 @@ "Set All to Included": "ಎಲ್ಲವನ್ನು ಸೇರಿಸಲಾಗಿದೆ ಎನ್ನಿ", "Set All to Default": "ಎಲ್ಲವನ್ನು ಡೀಫಾಲ್ಟ್‌ಗೆ ಸೆಟ್ ಮಾಡಿ", "Set All to Excluded": "ಎಲ್ಲವನ್ನು ಹೊರತುಪಡಿಸಿ ಎನ್ನಿ", - "Set All Visible Items to Included": "ಗೋಚರಿಸುವ ಎಲ್ಲವನ್ನು ಸೇರಿಸಲಾಗಿದೆ ಎನ್ನಿ", - "Set All Visible Items to Default": "ಗೋಚರಿಸುವ ಎಲ್ಲವನ್ನು ಡೀಫಾಲ್ಟ್‌ಗೆ ಸೆಟ್ ಮಾಡಿ", - "Set All Visible Items to Excluded": "ಗೋಚರಿಸುವ ಎಲ್ಲವನ್ನು ಹೊರತುಪಡಿಸಿ", "Back": "ಹಿಂದೆ", "Load More": "ಇನ್ನಷ್ಟು ಲೋಡ್ ಮಾಡಿ", "Export Results": "ಫಲಿತಾಂಶಗಳನ್ನು ರಫ್ತುಮಾಡಿ", diff --git a/src/locales/ko.json b/src/locales/ko.json index df67ffa9..f5098ff4 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -1560,9 +1560,6 @@ "Set All to Included": "Set All to Included", "Set All to Default": "Set All to Default", "Set All to Excluded": "Set All to Excluded", - "Set All Visible Items to Included": "Set All Visible Items to Included", - "Set All Visible Items to Default": "Set All Visible Items to Default", - "Set All Visible Items to Excluded": "Set All Visible Items to Excluded", "Back": "뒤로", "Load More": "더 불러오기", "Export Results": "결과 내보내기", diff --git a/src/locales/nl.json b/src/locales/nl.json index bf9f7445..a47f4496 100644 --- a/src/locales/nl.json +++ b/src/locales/nl.json @@ -1560,9 +1560,6 @@ "Set All to Included": "Set All to Included", "Set All to Default": "Set All to Default", "Set All to Excluded": "Set All to Excluded", - "Set All Visible Items to Included": "Set All Visible Items to Included", - "Set All Visible Items to Default": "Set All Visible Items to Default", - "Set All Visible Items to Excluded": "Set All Visible Items to Excluded", "Back": "Terug", "Load More": "Meer laden", "Export Results": "Resultaten exporteren", diff --git a/src/locales/pt_BR.json b/src/locales/pt_BR.json index e510ffde..6100461f 100644 --- a/src/locales/pt_BR.json +++ b/src/locales/pt_BR.json @@ -1560,9 +1560,6 @@ "Set All to Included": "Set All to Included", "Set All to Default": "Set All to Default", "Set All to Excluded": "Set All to Excluded", - "Set All Visible Items to Included": "Set All Visible Items to Included", - "Set All Visible Items to Default": "Set All Visible Items to Default", - "Set All Visible Items to Excluded": "Set All Visible Items to Excluded", "Back": "Voltar", "Load More": "Carregar Mais", "Export Results": "Exportar Resultados", diff --git a/src/locales/ru.json b/src/locales/ru.json index 1c85ea88..2cc34b7e 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -1560,9 +1560,6 @@ "Set All to Included": "Set All to Included", "Set All to Default": "Set All to Default", "Set All to Excluded": "Set All to Excluded", - "Set All Visible Items to Included": "Set All Visible Items to Included", - "Set All Visible Items to Default": "Set All Visible Items to Default", - "Set All Visible Items to Excluded": "Set All Visible Items to Excluded", "Back": "Назад", "Load More": "Загрузить еще", "Export Results": "Export Results", diff --git a/src/locales/th.json b/src/locales/th.json index 82a8748b..14b2c2d0 100644 --- a/src/locales/th.json +++ b/src/locales/th.json @@ -1560,9 +1560,6 @@ "Set All to Included": "Set All to Included", "Set All to Default": "Set All to Default", "Set All to Excluded": "Set All to Excluded", - "Set All Visible Items to Included": "Set All Visible Items to Included", - "Set All Visible Items to Default": "Set All Visible Items to Default", - "Set All Visible Items to Excluded": "Set All Visible Items to Excluded", "Back": "กลับ", "Load More": "โหลดเพิ่มเติม", "Export Results": "ส่งออกผลลัพธ์", diff --git a/src/locales/tr.json b/src/locales/tr.json index bd89d904..67ff2365 100644 --- a/src/locales/tr.json +++ b/src/locales/tr.json @@ -1560,9 +1560,6 @@ "Set All to Included": "Tümünü Dahil Et", "Set All to Default": "Tümünü Varsayılan Yap", "Set All to Excluded": "Tümünü Hariç Tut", - "Set All Visible Items to Included": "Görünenlerin Tümünü Dahil Et", - "Set All Visible Items to Default": "Görünenlerin Tümünü Varsayılan Yap", - "Set All Visible Items to Excluded": "Görünenlerin Tümünü Hariç Tut", "Back": "Geri", "Load More": "Daha Fazla Yükle", "Export Results": "Sonuçları Dışa Aktar", diff --git a/src/locales/uk.json b/src/locales/uk.json index 42d70fc3..018d00d6 100644 --- a/src/locales/uk.json +++ b/src/locales/uk.json @@ -1560,9 +1560,6 @@ "Set All to Included": "Set All to Included", "Set All to Default": "Set All to Default", "Set All to Excluded": "Set All to Excluded", - "Set All Visible Items to Included": "Set All Visible Items to Included", - "Set All Visible Items to Default": "Set All Visible Items to Default", - "Set All Visible Items to Excluded": "Set All Visible Items to Excluded", "Back": "Назад", "Load More": "Завантажити ще", "Export Results": "Export Results", diff --git a/src/locales/vi.json b/src/locales/vi.json index ab65c11d..332cdb60 100644 --- a/src/locales/vi.json +++ b/src/locales/vi.json @@ -1560,9 +1560,6 @@ "Set All to Included": "Set All to Included", "Set All to Default": "Set All to Default", "Set All to Excluded": "Set All to Excluded", - "Set All Visible Items to Included": "Set All Visible Items to Included", - "Set All Visible Items to Default": "Set All Visible Items to Default", - "Set All Visible Items to Excluded": "Set All Visible Items to Excluded", "Back": "Quay lại", "Load More": "Tải thêm", "Export Results": "Export Results", diff --git a/src/locales/zh_Hans.json b/src/locales/zh_Hans.json index 034637c2..6b767ff0 100644 --- a/src/locales/zh_Hans.json +++ b/src/locales/zh_Hans.json @@ -1560,9 +1560,6 @@ "Set All to Included": "全部设置为包含", "Set All to Default": "全部设置为默认", "Set All to Excluded": "全部设置为排除", - "Set All Visible Items to Included": "全部可见项目设置为包含", - "Set All Visible Items to Default": "全部可见项目设置为默认", - "Set All Visible Items to Excluded": "全部可见项目设置为排除", "Back": "返回", "Load More": "加载更多", "Export Results": "导出结果", diff --git a/src/locales/zh_Hant.json b/src/locales/zh_Hant.json index f0935686..31c31c48 100644 --- a/src/locales/zh_Hant.json +++ b/src/locales/zh_Hant.json @@ -1560,9 +1560,6 @@ "Set All to Included": "全部設為包含", "Set All to Default": "全部設為預設", "Set All to Excluded": "全部設為排除", - "Set All Visible Items to Included": "全部可見項目設為包含", - "Set All Visible Items to Default": "全部可見項目設為預設", - "Set All Visible Items to Excluded": "全部可見項目設為排除", "Back": "返回", "Load More": "載入更多", "Export Results": "匯出結果", diff --git a/src/views/base/settings/TransactionTagFilterSettingPageBase.ts b/src/views/base/settings/TransactionTagFilterSettingPageBase.ts index bc1cc934..8539dfc9 100644 --- a/src/views/base/settings/TransactionTagFilterSettingPageBase.ts +++ b/src/views/base/settings/TransactionTagFilterSettingPageBase.ts @@ -24,6 +24,7 @@ export function useTransactionTagFilterSettingPageBase(type?: string) { const loading = ref(true); const showHidden = ref(false); + const filterContent = ref(''); const filterTagIds = ref>({}); const includeTagFilterType = ref(TransactionTagFilterType.HasAny.type); const excludeTagFilterType = ref(TransactionTagFilterType.NotHasAny.type); @@ -39,15 +40,23 @@ export function useTransactionTagFilterSettingPageBase(type?: string) { return 'Apply'; }); - const allTags = computed(() => transactionTagsStore.allTransactionTags); - const hasAnyAvailableTag = computed(() => transactionTagsStore.allAvailableTagsCount > 0); - const hasAnyVisibleTag = computed(() => { - if (showHidden.value) { - return transactionTagsStore.allAvailableTagsCount > 0; - } else { - return transactionTagsStore.allVisibleTagsCount > 0; + const allVisibleTags = computed(() => { + const ret: TransactionTag[] = []; + const allTags = showHidden.value ? transactionTagsStore.allTransactionTags : transactionTagsStore.allVisibleTags; + const lowercaseFilterContent = filterContent.value ? filterContent.value.toLowerCase() : ''; + + for (const tag of allTags) { + if (lowercaseFilterContent && !tag.name.toLowerCase().includes(lowercaseFilterContent)) { + continue; + } + + ret.push(tag); } + + return ret; }); + const hasAnyAvailableTag = computed(() => transactionTagsStore.allAvailableTagsCount > 0); + const hasAnyVisibleTag = computed(() => allVisibleTags.value.length > 0); function loadFilterTagIds(): boolean { let tagFilters: TransactionTagFilter[] = []; @@ -142,6 +151,7 @@ export function useTransactionTagFilterSettingPageBase(type?: string) { // states loading, showHidden, + filterContent, filterTagIds, includeTagFilterType, excludeTagFilterType, @@ -150,7 +160,7 @@ export function useTransactionTagFilterSettingPageBase(type?: string) { excludeTagsCount, title, applyText, - allTags, + allVisibleTags, hasAnyAvailableTag, hasAnyVisibleTag, // functions diff --git a/src/views/desktop/common/cards/TransactionTagFilterSettingsCard.vue b/src/views/desktop/common/cards/TransactionTagFilterSettingsCard.vue index 295cde20..bc47a037 100644 --- a/src/views/desktop/common/cards/TransactionTagFilterSettingsCard.vue +++ b/src/views/desktop/common/cards/TransactionTagFilterSettingsCard.vue @@ -1,95 +1,46 @@