The catalog action (diagnostics, relative times, loading/error/retry,
mode and activity labels, branch toggles, descendant counts, tree aria)
and the read-only composer were hardcoded to Simplified Chinese, so an
English-locale session rendered mixed-language UI. Register a `subagent`
locale namespace (zh source of truth + en dictionary), declare it on both
slot registrations, thread the locale `t` seat through the components, and
mount the locale service in the plugin specs.
The UI spec's zh assertions now run against the real dictionary through a
`t` stub that interpolates `{name}` params exactly like the locale
service.
32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
TypeScript
import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
|
|
import { NS } from './locales.ts'
|
|
import css from './SubagentReadOnlyComposer.module.css'
|
|
|
|
/** Why a catalog-addressed conversation cannot accept human input. */
|
|
export interface SubagentReadOnlyMatch {
|
|
reason: 'one-shot' | 'parent-unavailable'
|
|
}
|
|
|
|
/** Full chain props after the read-only subagent selector accepts the owner currency. */
|
|
export type SubagentReadOnlyComposerProps =
|
|
PropsRuntime<'conversation.composer'> & { matched: SubagentReadOnlyMatch } & PropsLocale<typeof NS>
|
|
|
|
/**
|
|
* Explain why the normal composer is unavailable for an addressed child.
|
|
* @param props - selector-owned read-only reason plus standard slot props.
|
|
* @returns A read-only composer replacement.
|
|
*/
|
|
export function SubagentReadOnlyComposer({
|
|
matched, t,
|
|
}: Pick<SubagentReadOnlyComposerProps, 'matched' | 't'>) {
|
|
const oneShot = matched.reason === 'one-shot'
|
|
return (
|
|
<div className={css.frame} role="status">
|
|
<strong>{t(oneShot ? 'readonly.oneShot.title' : 'readonly.title')}</strong>
|
|
<span>
|
|
{t(oneShot ? 'readonly.oneShot.body' : 'readonly.body')}
|
|
</span>
|
|
</div>
|
|
)
|
|
}
|