From 363ca76ac18b2a58ff653e96d4bbd269ab35f889 Mon Sep 17 00:00:00 2001 From: gengruilin Date: Wed, 14 Oct 2026 17:03:32 +0800 Subject: [PATCH] feat(ui-cli-account): label the section's phase from the shared dictionary The section labels its status from the plugin's `status.*` keys unless the plugin passes a step label for an operation in progress. The notice translator no longer narrows the toast's notice type. --- packages/client/ui-cli-account/src/client/components.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/client/ui-cli-account/src/client/components.tsx b/packages/client/ui-cli-account/src/client/components.tsx index a43badf8cf..47fde41caf 100644 --- a/packages/client/ui-cli-account/src/client/components.tsx +++ b/packages/client/ui-cli-account/src/client/components.tsx @@ -13,6 +13,7 @@ export type CliAccountKey = | 'activation.title' | 'activation.body' | 'activation.later' | 'failure.details' | 'failure.exitCode' | `badge.${Exclude}` + | `status.${Exclude}` const TONE: Record = { checking: 'ongoing', connecting: 'ongoing', connected: 'done', disconnected: 'idle', unavailable: 'warning', stopped: 'warning', @@ -43,7 +44,7 @@ export interface CliAccountSectionProps { readonly t: Translate readonly packageName: string readonly phase: CliAccountPhase - readonly status: string + readonly status?: string | undefined readonly busy: boolean readonly linked: boolean readonly actions: readonly CliAccountAction[] @@ -76,7 +77,7 @@ export function CliAccountSection(props: CliAccountSectionProps): ReactNode {

{t('section.title')}

- {status} + {status ?? t(`status.${phase === 'connecting' ? 'checking' : phase}`)}
{actions.map(button)}
{detail === undefined ? null :

{detail}

} @@ -151,7 +152,7 @@ export function CliAccountConfirm({ t, open, title, body, confirm, onClose, onCo } export interface CliAccountToastProps { - readonly t: Translate<`notice.${CliAccountNotice['kind']}`> + readonly t: Translate<`notice.${NoInfer['kind']>}`> readonly notice: CliAccountNotice | undefined readonly onDone: () => void }