Skip to content

Commit 559a354

Browse files
committed
feat: polish account compose menu copy
1 parent b3753f0 commit 559a354

7 files changed

Lines changed: 21 additions & 4 deletions

File tree

frontend/src/features/accounts/components/AccountModalComponents.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,10 @@ export const CodexOAuth: Story = {
762762
render: () => <OAuthSample label="DS-OAUTH-READY" />,
763763
};
764764

765+
export const UnifiedComposePresetList: Story = {
766+
render: () => <UnifiedComposeSample label="DS-UNIFIED-PRESET-LIST" formKey="empty" />,
767+
};
768+
765769
export const UnifiedCompose: Story = {
766770
render: () => <UnifiedComposeSample label="DS-UNIFIED-FORM-STEP" formKey="deepseek" showPresets={false} selectedPresetID="deepseek" />,
767771
};

frontend/src/features/accounts/components/accountHeaderMenu.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ export const ACCOUNT_HEADER_MENU_PANEL_CLASS =
2121
'absolute right-0 top-full z-20 mt-3 w-[19rem] border-2 border-[var(--border-color)] bg-[var(--bg-main)] p-2 shadow-[8px_8px_0_var(--shadow-color)]';
2222

2323
export const ACCOUNT_HEADER_MENU_ITEM_CLASS =
24-
'flex min-h-10 w-full items-center gap-3 border-0 bg-transparent px-3 py-2 text-left text-[length:var(--font-size-ui-xs)] font-black uppercase leading-tight tracking-[0.12em] text-[var(--text-primary)] transition-[background-color,transform] hover:bg-[var(--bg-surface)] focus-visible:bg-[var(--bg-surface)] active:scale-[0.99] disabled:cursor-not-allowed disabled:opacity-45';
24+
'flex min-h-11 w-full items-center gap-3 border-0 bg-transparent px-3 py-2.5 text-left text-[length:var(--font-size-ui-md)] font-black uppercase leading-snug tracking-[0.08em] text-[var(--text-primary)] transition-[background-color,transform] hover:bg-[var(--bg-surface)] focus-visible:bg-[var(--bg-surface)] active:scale-[0.99] disabled:cursor-not-allowed disabled:opacity-45';
2525

26-
export const ACCOUNT_HEADER_MENU_ICON_CLASS = 'h-4 w-4 shrink-0 text-[var(--text-muted)]';
26+
export const ACCOUNT_HEADER_MENU_ICON_CLASS = 'h-5 w-5 shrink-0 text-[var(--text-muted)]';
2727
export const ACCOUNT_HEADER_MENU_LABEL_CLASS = 'min-w-0 flex-1 truncate';
2828
export const ACCOUNT_HEADER_MENU_SEPARATOR_CLASS = 'mx-2 my-1 h-px bg-[var(--border-color)]';
2929

frontend/src/features/accounts/model/unifiedComposeCopy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export function resolveUnifiedComposeModalCopy(t: Translator) {
5151
changeLabel: t('accounts.unified_compose_change'),
5252
customEntryLabel: t('accounts.unified_compose_custom_entry'),
5353
submitLabel: t('accounts.add_account'),
54-
advancedLabel: t('codex_features_group_advanced'),
55-
billingLabel: t('accounts.billing'),
54+
advancedLabel: t('accounts.unified_compose_advanced'),
55+
billingLabel: t('accounts.unified_compose_billing'),
5656
labelLabel: t('accounts.unified_compose_label'),
5757
labelPlaceholderDefault: t('accounts.unified_compose_label_placeholder_default'),
5858
labelPlaceholderSuffix: t('accounts.unified_compose_label_placeholder_suffix'),

frontend/src/features/accounts/tests/accountHeaderMenu.test.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import assert from 'node:assert/strict';
33
import { readFileSync } from 'node:fs';
44

55
import {
6+
ACCOUNT_HEADER_MENU_ICON_CLASS,
67
ACCOUNT_HEADER_MENU_ITEM_CLASS,
78
buildAccountsHeaderMenuItems,
89
} from '../components/accountHeaderMenu.ts';
@@ -56,8 +57,12 @@ test('AccountsHeader menu row styles stay flat instead of card-like', () => {
5657
const source = readFileSync(new URL('../components/AccountsHeader.tsx', import.meta.url), 'utf8');
5758

5859
assert.match(source, /ACCOUNT_HEADER_MENU_ITEM_CLASS/);
60+
assert.match(ACCOUNT_HEADER_MENU_ITEM_CLASS, /text-\[length:var\(--font-size-ui-md\)\]/);
61+
assert.match(ACCOUNT_HEADER_MENU_ITEM_CLASS, /min-h-11/);
62+
assert.match(ACCOUNT_HEADER_MENU_ITEM_CLASS, /leading-snug/);
5963
assert.match(ACCOUNT_HEADER_MENU_ITEM_CLASS, /hover:bg-\[var\(--bg-surface\)\]/);
6064
assert.match(ACCOUNT_HEADER_MENU_ITEM_CLASS, /active:scale-\[0\.99\]/);
65+
assert.match(ACCOUNT_HEADER_MENU_ICON_CLASS, /h-5 w-5/);
6166
assert.doesNotMatch(ACCOUNT_HEADER_MENU_ITEM_CLASS, /btn-swiss/);
6267
assert.doesNotMatch(ACCOUNT_HEADER_MENU_ITEM_CLASS, /shadow/);
6368
assert.doesNotMatch(ACCOUNT_HEADER_MENU_ITEM_CLASS, /border-2/);

frontend/src/features/accounts/tests/accountPresentation.test.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ test('unified compose copy resolves localized labels and titles', () => {
130130
assert.equal(copy.configureTitle, 't:accounts.unified_compose_title_configure');
131131
assert.equal(copy.labelLabel, 't:accounts.unified_compose_label');
132132
assert.equal(copy.baseUrlPrimaryLabel, 't:accounts.unified_compose_base_url_primary');
133+
assert.equal(copy.advancedLabel, 't:accounts.unified_compose_advanced');
134+
assert.equal(copy.billingLabel, 't:accounts.unified_compose_billing');
133135
assert.equal(copy.formatTargetLabels.openai_chat, 't:accounts.unified_compose_format_target_chat');
134136
assert.equal(resolveUnifiedComposeFormatTitle(t, 'gemini_native'), 't:accounts.unified_compose_format_title_gemini_native');
135137
assert.equal(buildUnifiedComposeProviderAriaLabel(t, 'OpenAI'), 't:accounts.unified_compose_provider_aria_prefix OpenAI');
@@ -149,6 +151,8 @@ test('unified compose locale keys exist in both zh and en', () => {
149151
'unified_compose_label_placeholder_default',
150152
'unified_compose_label_placeholder_suffix',
151153
'unified_compose_base_url_primary',
154+
'unified_compose_advanced',
155+
'unified_compose_billing',
152156
'unified_compose_quota_curl_placeholder',
153157
'unified_compose_billing_curl',
154158
'unified_compose_provider_aria_prefix',

frontend/src/locales/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,8 @@
10691069
"unified_compose_label_placeholder_default": "e.g. DeepSeek Proxy",
10701070
"unified_compose_label_placeholder_suffix": "Account",
10711071
"unified_compose_base_url_primary": "Base URL (Primary)",
1072+
"unified_compose_advanced": "Advanced",
1073+
"unified_compose_billing": "Balance",
10721074
"unified_compose_quota_curl_placeholder": "curl -sS \"https://api.example.com/usage\" -H \"Authorization: Bearer {{apiKey}}\"",
10731075
"unified_compose_billing_curl": "Balance cURL",
10741076
"unified_compose_provider_aria_prefix": "Select",

frontend/src/locales/zh.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,8 @@
10691069
"unified_compose_label_placeholder_default": "例如:DeepSeek 代理",
10701070
"unified_compose_label_placeholder_suffix": "账号",
10711071
"unified_compose_base_url_primary": "基础地址(主)",
1072+
"unified_compose_advanced": "高级",
1073+
"unified_compose_billing": "余额",
10721074
"unified_compose_quota_curl_placeholder": "curl -sS \"https://api.example.com/usage\" -H \"Authorization: Bearer {{apiKey}}\"",
10731075
"unified_compose_billing_curl": "余额 cURL",
10741076
"unified_compose_provider_aria_prefix": "选择",

0 commit comments

Comments
 (0)