From be297b90ce30d4a8fda03d00a36c937b2161980e Mon Sep 17 00:00:00 2001 From: shaw Date: Sat, 4 Jul 2026 09:49:37 +0800 Subject: [PATCH] refactor(frontend): merge Codex image bridge and tool policy into one four-state control Replace the two adjacent account-level controls (3-state injection bridge + 2-state explicit tool policy) in EditAccountModal with a single four-state selector: follow channel / force inject / no injection / block all. The four states map onto the existing extra keys (codex_image_generation_bridge, codex_image_generation_explicit_tool_policy) with no backend change; strip already disables the bridge upstream, so the effective decision space is exactly these four states. - load: strip takes precedence and reads as "block all"; legacy bridge_enabled key still recognized and cleaned up on save - save: block writes policy=strip and drops the bridge override; inherit clears both keys - semantic accent colors per state (sky/emerald/amber/rose) with dark mode support; state badge follows the same palette - replace account-scope i18n keys in zh/en (channel-scope keys untouched) - rewrite specs to cover all four states (25/25 passing) --- .../components/account/EditAccountModal.vue | 183 +++++++----------- .../__tests__/EditAccountModal.spec.ts | 35 +++- frontend/src/i18n/locales/en.ts | 34 ++-- frontend/src/i18n/locales/zh.ts | 33 ++-- 4 files changed, 126 insertions(+), 159 deletions(-) diff --git a/frontend/src/components/account/EditAccountModal.vue b/frontend/src/components/account/EditAccountModal.vue index a596183207..3670f233e3 100644 --- a/frontend/src/components/account/EditAccountModal.vue +++ b/frontend/src/components/account/EditAccountModal.vue @@ -1370,7 +1370,7 @@ - +
- + - {{ codexImageGenerationBridgeBadgeLabel }} + {{ codexImageToolBadgeLabel }}

- {{ t('admin.accounts.openai.codexImageGenerationBridgeDesc') }} + {{ t('admin.accounts.openai.codexImageToolDesc') }}

-
+
-
-
-
- - - -
-
-
-
- -
-
- -

- {{ t('admin.accounts.openai.codexImageToolPolicyDesc') }} -

-
-
-
-
-