Skip to content

The agent that grows with you

fix(desktop): label single- vs multi-select clarify cards

686f6c61348cf3336086
diff --git a/apps/desktop/src/components/assistant-ui/clarify/clarify-tool.test.tsx b/apps/desktop/src/components/assistant-ui/clarify/clarify-tool.test.tsx
index 55283042c28..f8495ef2506 100644
--- a/apps/desktop/src/components/assistant-ui/clarify/clarify-tool.test.tsx
+++ b/apps/desktop/src/components/assistant-ui/clarify/clarify-tool.test.tsx
@@ -195,6 +195,28 @@ describe('ClarifyTool live card stays mounted across settle', () => {
})
describe('ClarifyTool choice selection', () => {
+ it('labels single-select vs multi-select before the user clicks', () => {
+ const { rerender } = renderLiveClarify()
+
+ expect(document.querySelector('[data-clarify-select-mode="single"]')?.textContent).toMatch(/pick one/i)
+ expect(document.querySelector('[data-clarify-select-mode="multi"]')).toBeNull()
+
+ $activeSessionId.set('session-1')
+ $gateway.set({ request: vi.fn() } as never)
+ act(() => {
+ setClarifyRequest({
+ questions: [
+ { choices: ['staging', 'production'], multiSelect: true, qid: 'q0', question: 'Which deployment target?' }
+ ],
+ requestId: 'request-1',
+ sessionId: 'session-1'
+ })
+ })
+ rerender(clarifyTree(<ClarifyTool {...liveClarifyProps()} />))
+
+ expect(document.querySelector('[data-clarify-select-mode="multi"]')?.textContent).toMatch(/select all that apply/i)
+ })
+
it('selects independently, deselects and submits multi-select choices as a JSON array', async () => {
const { request } = renderLiveClarify({ multiSelect: true })
const staging = screen.getByRole('button', { name: /staging/ })
diff --git a/apps/desktop/src/components/assistant-ui/clarify/core/question-block.tsx b/apps/desktop/src/components/assistant-ui/clarify/core/question-block.tsx
index 27b9bbc05b1..e9192e22eee 100644
--- a/apps/desktop/src/components/assistant-ui/clarify/core/question-block.tsx
+++ b/apps/desktop/src/components/assistant-ui/clarify/core/question-block.tsx
@@ -46,6 +46,14 @@ export function QuestionBlock({
<span className="flex-1 whitespace-pre-wrap font-medium leading-(--conversation-line-height)">
{question.question}
</span>
+ {choices.length > 0 ? (
+ <span
+ className="mt-px shrink-0 rounded-sm bg-(--chrome-action-hover) px-1 py-px text-[0.625rem] text-(--ui-text-tertiary)"
+ data-clarify-select-mode={question.multiSelect ? 'multi' : 'single'}
+ >
+ {question.multiSelect ? copy.multiSelectHint : copy.singleSelectHint}
+ </span>
+ ) : null}
</div>
{choices.length > 0 ? (
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index acb1788e27e..b2b2061fda4 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -5336,6 +5336,8 @@ export const en: Translations = {
skipped: 'Skipped',
noAnswer: 'No answer',
confirmAndContinueLabel: 'Confirm and continue',
+ singleSelectHint: 'Pick one',
+ multiSelectHint: 'Select all that apply',
questionProgress: (answered, total) => `${answered} of ${total} answered`,
notDelivered:
"This question didn't reach the app, so it can't be answered here. Press Stop to end the turn, then reply in chat."
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 43e8300ed52..3eddccd189d 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -4439,6 +4439,8 @@ export interface Translations {
skipped: string
noAnswer: string
confirmAndContinueLabel: string
+ singleSelectHint: string
+ multiSelectHint: string
questionProgress: (answered: number, total: number) => string
notDelivered: string
}