fix(web): 统一引导页设置入口文案并覆盖赠金行分隔线
引导页两条确认提示改为指向实际入口:Settings → Account / Settings → General, 中文同步为 设置 → 账号与余额 / 设置 → 通用设置。赠金行可见性提为 showBonusRow, 并断言隐藏赠金行时其分隔线一并移除。
This commit is contained in:
1 parent
8671d30583
commit
30a3913397
3 files changed
+10
-5
No files matched your search
@@ -93,6 +93,7 @@ export function AccountSection({ t, useAccount, useTheme, start, cancel, openPla
|
||||
const wallets = details?.balance?.status === 'ready' ? details.balance.value : undefined
|
||||
const bonusWallets = details?.balance?.status === 'ready'
|
||||
? details.balance.bonusWallets.filter(wallet => new Big(wallet.balance).gt(0)) : []
|
||||
const showBonusRow = details?.balance?.status !== 'ready' || bonusWallets.length > 0
|
||||
const attempt = state?.attempt
|
||||
const active = attempt !== null && attempt !== undefined
|
||||
&& ['initializing', 'waiting-browser', 'exchanging', 'committing'].includes(attempt.phase)
|
||||
@@ -183,7 +184,7 @@ export function AccountSection({ t, useAccount, useTheme, start, cancel, openPla
|
||||
? <span className={css.unavailable}>{t(!signedIn ? 'balanceSignedOut' : 'loading')}</span>
|
||||
: platformLink(t('balanceUnavailable'), css.unavailableLink)}
|
||||
</div>
|
||||
{signedIn && (details?.balance?.status !== 'ready' || bonusWallets.length > 0) && <>
|
||||
{signedIn && showBonusRow && <>
|
||||
<div className={css.divider} />
|
||||
<div className={css.row}>
|
||||
<span>{t('bonusBalance')}</span>
|
||||
|
||||
@@ -30,10 +30,10 @@ export const onboardingCopy = {
|
||||
onboardingBack: '上一步',
|
||||
onboardingSkip: '跳过',
|
||||
onboardingSkipTitle: '跳过设置?',
|
||||
onboardingSkipDescription: '你可以随时前往 个人中心 → 通用设置 中调整工作过程、性能与用量展示方式或开启代码工作工具。',
|
||||
onboardingSkipDescription: '你可以随时前往 设置 → 通用设置 中调整工作过程、性能与用量展示方式或开启代码工作工具。',
|
||||
onboardingKeepSetting: '继续设置',
|
||||
onboardingNoCreditTitle: '暂时跳过充值?',
|
||||
onboardingNoCreditDescription: '没有可用额度时,DeepSeek Harness 将无法开始新的任务。你可以稍后前往 个人中心 → 账号与余额 进行充值。',
|
||||
onboardingNoCreditDescription: '没有可用额度时,DeepSeek Harness 将无法开始新的任务。你可以稍后前往 设置 → 账号与余额 进行充值。',
|
||||
onboardingUnderstood: '我知道了',
|
||||
onboardingGoTopUp: '前往充值',
|
||||
onboardingSaveFailed: '未能保存设置,请重试。',
|
||||
@@ -73,10 +73,10 @@ export const onboardingEnglishCopy: Record<keyof typeof onboardingCopy, string>
|
||||
onboardingBack: 'Back',
|
||||
onboardingSkip: 'Skip',
|
||||
onboardingSkipTitle: 'Skip setup?',
|
||||
onboardingSkipDescription: 'You can change how progress, performance, and usage are displayed, or enable Coding Tools, anytime in Profile → General Settings.',
|
||||
onboardingSkipDescription: 'You can change how progress, performance, and usage are displayed, or enable Coding Tools, anytime in Settings → General.',
|
||||
onboardingKeepSetting: 'Continue setup',
|
||||
onboardingNoCreditTitle: 'Skip adding credits?',
|
||||
onboardingNoCreditDescription: 'DeepSeek Harness can’t start new tasks without credits. You can add them later in Settings → Accounts.',
|
||||
onboardingNoCreditDescription: 'DeepSeek Harness can’t start new tasks without credits. You can add them later in Settings → Account.',
|
||||
onboardingUnderstood: 'Got it',
|
||||
onboardingGoTopUp: 'Add credits',
|
||||
onboardingSaveFailed: 'Could not save settings. Try again.',
|
||||
|
||||
@@ -13,6 +13,7 @@ import type { BonusNotice } from '../src/client/bonus-notices.ts'
|
||||
import type { AccountMenuProps } from '../src/client/AccountMenu.tsx'
|
||||
import type {} from '../src/client/index.ts'
|
||||
import { en, zh, type AccountKey } from '../src/client/locales.ts'
|
||||
import css from '../src/client/AccountSection.module.css'
|
||||
|
||||
afterEach(() => { cleanup(); vi.unstubAllGlobals() })
|
||||
|
||||
@@ -441,6 +442,7 @@ it.each([en, zh])('renders positive bonus wallets separately from recharge balan
|
||||
})
|
||||
expect(screen.getByText(copy.balance).parentElement!.textContent).toBe(`${copy.balance}¥209.00$20.07`)
|
||||
expect(screen.getByText(copy.bonusBalance).parentElement!.textContent).toBe(`${copy.bonusBalance}¥5.00<$0.01`)
|
||||
expect(screen.getByRole('region').querySelectorAll(`.${css.divider}`)).toHaveLength(2)
|
||||
await expect(`${screen.getByRole('region').textContent}\n`)
|
||||
.toMatchFileSnapshot(`./expected/bonus-${copy === en ? 'en' : 'zh'}.txt`)
|
||||
})
|
||||
@@ -451,6 +453,8 @@ it.each([[], [{ currency: 'CNY' as const, balance: '0.00' }, { currency: 'USD' a
|
||||
balance: { status: 'ready', value: [{ currency: 'CNY', balance: '0' }], bonusWallets },
|
||||
})
|
||||
expect(screen.queryByText(en.bonusBalance)).toBeNull()
|
||||
// The divider above the bonus row goes with it.
|
||||
expect(screen.getByRole('region').querySelectorAll(`.${css.divider}`)).toHaveLength(1)
|
||||
expect(screen.getByText('¥0.00')).toBeTruthy()
|
||||
expect(screen.queryByText('¥-1.00')).toBeNull()
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user