diff --git a/cloud/TASKS.md b/cloud/TASKS.md index 39b85c94..9355abf1 100644 --- a/cloud/TASKS.md +++ b/cloud/TASKS.md @@ -103,7 +103,7 @@ - **Acceptance:** Tests cover three states (loading, success, error-with-cache). ### C10 — Mount the Account tab -- [ ] **Goal:** Add an "Account" entry to the settings navigation that contains `LicenseSettings` + `CloudUsagePanel`. +- [x] **Goal:** Add an "Account" entry to the settings navigation that contains `LicenseSettings` + `CloudUsagePanel`. - **Approach:** Locate the existing settings nav. **If wiring it in requires more than ~10 lines of change in any single existing file, block and document where you stopped.** - **Acceptance:** "Account" tab appears, both panels render. @@ -137,3 +137,4 @@ [x] C9 — 2026-04-28 — ae19918 — CloudUsagePanel with 60s polling and stale-cache-on-error; 7 tests cover loading/success/error-with-cache + cold error + cadence + cleanup [x] C12 — 2026-04-28 — 381004c — e2e test (license → setLicense → visible → mock chat → usage delta) + invalid-signature + lifetime-only-no-cloud_ai paths; 3 tests [x] C3 — 2026-04-28 — d684a85 — license storage via safeStorage + Linux 0600 fallback; 3 additive lines in ipc.ts; 16 tests (11 main, 5 renderer) +[x] C10 — 2026-04-28 — 9873ab7 — Account tab mounted in SettingsModal between Network and System; locale strings in en/zh-CN/zh-TW/ja; 7 tests pass (existing modal tests + new account-tab assertion) diff --git a/src/components/layout/SettingsModal.test.tsx b/src/components/layout/SettingsModal.test.tsx index 30eebd12..c81a7887 100644 --- a/src/components/layout/SettingsModal.test.tsx +++ b/src/components/layout/SettingsModal.test.tsx @@ -109,6 +109,7 @@ vi.mock("@/stores/useLocaleStore", () => ({ ai: "AI", sync: "Sync", network: "Network", + account: "Account", system: "System", }, }, @@ -191,6 +192,14 @@ vi.mock("../settings/ProxySection", () => ({ ProxySection: () =>
Proxy
, })); +vi.mock("../settings/LicenseSettings", () => ({ + LicenseSettings: () =>
LicenseSettings
, +})); + +vi.mock("../settings/CloudUsagePanel", () => ({ + CloudUsagePanel: () =>
CloudUsagePanel
, +})); + describe("SettingsModal", () => { const onOpenUpdateModal = vi.fn(); @@ -203,7 +212,7 @@ describe("SettingsModal", () => { onOpenUpdateModal.mockClear(); }); - it("renders tabbed navigation with 5 tabs", () => { + it("renders tabbed navigation with 6 tabs", () => { render( { expect(screen.getByText("AI")).toBeInTheDocument(); expect(screen.getByText("Sync")).toBeInTheDocument(); expect(screen.getByText("Network")).toBeInTheDocument(); + expect(screen.getByText("Account")).toBeInTheDocument(); expect(screen.getByText("System")).toBeInTheDocument(); }); + it("switches to account tab and shows license + usage panels", () => { + render( + undefined} + onOpenUpdateModal={onOpenUpdateModal} + />, + ); + + fireEvent.click(screen.getByText("Account")); + + expect(screen.getByText("LicenseSettings")).toBeInTheDocument(); + expect(screen.getByText("CloudUsagePanel")).toBeInTheDocument(); + }); + it("defaults to general tab showing theme and editor", () => { render( = { general: Settings, ai: Bot, sync: RefreshCw, network: Globe, + account: User, system: Info, }; -const TAB_ORDER: TabId[] = ["general", "ai", "sync", "network", "system"]; +const TAB_ORDER: TabId[] = ["general", "ai", "sync", "network", "account", "system"]; interface SettingsModalProps { isOpen: boolean; @@ -61,6 +64,13 @@ export function SettingsModal({ isOpen, onClose, onOpenUpdateModal }: SettingsMo ); + case "account": + return ( + <> + + + + ); case "system": return ; } diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 073ec199..1686d2c1 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -1290,6 +1290,7 @@ export default { ai: "AI", sync: "Sync", network: "Network", + account: "Account", system: "System", }, diagnosticsTitle: "Diagnostics", diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts index b0707d54..bd84a3e1 100644 --- a/src/i18n/locales/ja.ts +++ b/src/i18n/locales/ja.ts @@ -1180,6 +1180,7 @@ export default { ai: "AI", sync: "同期", network: "ネットワーク", + account: "アカウント", system: "システム", }, diagnosticsTitle: "診断", diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 09b3723b..da0fd53b 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -1263,6 +1263,7 @@ export default { ai: "AI", sync: "同步", network: "网络", + account: "账户", system: "系统", }, diagnosticsTitle: "诊断", diff --git a/src/i18n/locales/zh-TW.ts b/src/i18n/locales/zh-TW.ts index cf5ddea1..0f47002e 100644 --- a/src/i18n/locales/zh-TW.ts +++ b/src/i18n/locales/zh-TW.ts @@ -1158,6 +1158,7 @@ export default { ai: "AI", sync: "同步", network: "網路", + account: "帳戶", system: "系統", }, diagnosticsTitle: "診斷",