From 6e369f39a4fcf82dd68ae408975804fbaa977b1e Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 4 Jan 2026 14:05:52 +0800 Subject: [PATCH] support setting account categories hidden which has no accounts --- pkg/models/user_app_cloud_setting.go | 3 ++- src/core/setting.ts | 3 +++ src/locales/de.json | 1 + src/locales/en.json | 1 + src/locales/es.json | 1 + src/locales/fr.json | 1 + src/locales/it.json | 1 + src/locales/ja.json | 1 + src/locales/kn.json | 1 + src/locales/ko.json | 1 + src/locales/nl.json | 1 + src/locales/pt_BR.json | 1 + src/locales/ru.json | 1 + src/locales/sl.json | 1 + src/locales/th.json | 1 + src/locales/tr.json | 1 + src/locales/uk.json | 1 + src/locales/vi.json | 1 + src/locales/zh_Hans.json | 1 + src/locales/zh_Hant.json | 1 + src/stores/setting.ts | 7 +++++++ src/views/base/settings/AppCloudSyncPageBase.ts | 3 ++- src/views/desktop/accounts/ListPage.vue | 6 +++++- .../app/settings/tabs/AppBasicSettingTab.vue | 16 ++++++++++++++++ 24 files changed, 53 insertions(+), 3 deletions(-) diff --git a/pkg/models/user_app_cloud_setting.go b/pkg/models/user_app_cloud_setting.go index 286841bd..09548b82 100644 --- a/pkg/models/user_app_cloud_setting.go +++ b/pkg/models/user_app_cloud_setting.go @@ -33,7 +33,8 @@ var ALL_ALLOWED_CLOUD_SYNC_APP_SETTING_KEY_TYPES = map[string]UserApplicationClo "insightsExplorerDefaultDateRangeType": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER, "showTagInInsightsExplorerPage": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN, // Account List Page - "totalAmountExcludeAccountIds": USER_APPLICATION_CLOUD_SETTING_TYPE_STRING_BOOLEAN_MAP, + "totalAmountExcludeAccountIds": USER_APPLICATION_CLOUD_SETTING_TYPE_STRING_BOOLEAN_MAP, + "hideCategoriesWithoutAccounts": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN, // Exchange Rates Data Page "currencySortByInExchangeRatesPage": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER, // Statistics Settings diff --git a/src/core/setting.ts b/src/core/setting.ts index e2d6e849..776f1ccf 100644 --- a/src/core/setting.ts +++ b/src/core/setting.ts @@ -55,6 +55,7 @@ export interface ApplicationSettings extends BaseApplicationSetting { showTagInInsightsExplorerPage: boolean; // Account List Page totalAmountExcludeAccountIds: Record; + hideCategoriesWithoutAccounts: boolean; // Exchange Rates Data Page currencySortByInExchangeRatesPage: number; // Statistics Settings @@ -120,6 +121,7 @@ export const ALL_ALLOWED_CLOUD_SYNC_APP_SETTING_KEY_TYPES: Record { updateUserApplicationCloudSettingValue('totalAmountExcludeAccountIds', value); } + function setHideCategoriesWithoutAccounts(value: boolean): void { + updateApplicationSettingsValue('hideCategoriesWithoutAccounts', value); + appSettings.value.hideCategoriesWithoutAccounts = value; + updateUserApplicationCloudSettingValue('hideCategoriesWithoutAccounts', value); + } + // Exchange Rates Data Page function setCurrencySortByInExchangeRatesPage(value: number): void { updateApplicationSettingsValue('currencySortByInExchangeRatesPage', value); @@ -485,6 +491,7 @@ export const useSettingsStore = defineStore('settings', () => { setShowTagInInsightsExplorerPage, // -- Account List Page setTotalAmountExcludeAccountIds, + setHideCategoriesWithoutAccounts, // -- Exchange Rates Data Page setCurrencySortByInExchangeRatesPage, // -- Statistics Settings diff --git a/src/views/base/settings/AppCloudSyncPageBase.ts b/src/views/base/settings/AppCloudSyncPageBase.ts index 6d5062c3..5647b375 100644 --- a/src/views/base/settings/AppCloudSyncPageBase.ts +++ b/src/views/base/settings/AppCloudSyncPageBase.ts @@ -60,7 +60,8 @@ export const ALL_APPLICATION_CLOUD_SETTINGS: CategorizedApplicationCloudSettingI { categoryName: 'Account List Page', items: [ - { settingKey: 'totalAmountExcludeAccountIds', settingName: 'Accounts Included in Total', mobile: true, desktop: true } + { settingKey: 'totalAmountExcludeAccountIds', settingName: 'Accounts Included in Total', mobile: true, desktop: true }, + { settingKey: 'hideCategoriesWithoutAccounts', settingName: 'Hide Categories Without Accounts', mobile: false, desktop: true } ] }, { diff --git a/src/views/desktop/accounts/ListPage.vue b/src/views/desktop/accounts/ListPage.vue index 67b8032d..3fd12de3 100644 --- a/src/views/desktop/accounts/ListPage.vue +++ b/src/views/desktop/accounts/ListPage.vue @@ -31,7 +31,8 @@