Skip to content

The agent that grows with you

fix: give the batch clarify preview a loading cue

teknium16a07ce618d43
diff --git a/apps/desktop/src/components/assistant-ui/clarify-tool.test.tsx b/apps/desktop/src/components/assistant-ui/clarify-tool.test.tsx
index 6580a3a8a74..c2c0a9a0911 100644
--- a/apps/desktop/src/components/assistant-ui/clarify-tool.test.tsx
+++ b/apps/desktop/src/components/assistant-ui/clarify-tool.test.tsx
@@ -667,8 +667,10 @@ describe('ClarifyTool batch card', () => {
expect(screen.getByText('Color?')).toBeTruthy()
expect(screen.getByText('Name?')).toBeTruthy()
+ // The spinner card is gone; the preview keeps only a screen-reader loading cue.
expect(screen.queryByRole('status', { name: /loading question/i })).toBeNull()
- expect(document.querySelector('[data-clarify-batch-preview]')).toBeTruthy()
+ expect(screen.getByRole('status').textContent).toMatch(/loading question/i)
+ expect(document.querySelector('[data-clarify-batch-preview]')?.getAttribute('aria-busy')).toBe('true')
// Nothing is answerable yet: no qids to respond with.
expect((screen.getByRole('button', { name: /red/ }) as HTMLButtonElement).disabled).toBe(true)
expect((screen.getByRole('button', { name: /Skip/ }) as HTMLButtonElement).disabled).toBe(true)
diff --git a/apps/desktop/src/components/assistant-ui/clarify-tool.tsx b/apps/desktop/src/components/assistant-ui/clarify-tool.tsx
index 59d631eff88..9857f0c4696 100644
--- a/apps/desktop/src/components/assistant-ui/clarify-tool.tsx
+++ b/apps/desktop/src/components/assistant-ui/clarify-tool.tsx
@@ -1140,13 +1140,18 @@ function ClarifyToolBatchPending({
return (
<form
- aria-disabled={ready ? undefined : 'true'}
+ aria-busy={ready ? undefined : 'true'}
className="my-1.5 grid gap-4"
data-clarify-batch={questions.length}
data-clarify-batch-preview={ready ? undefined : ''}
onKeyDownCapture={handleClarifySubmitShortcut}
onSubmit={handleSubmit}
>
+ {ready ? null : (
+ <span className="sr-only" role="status">
+ {copy.loadingQuestion}
+ </span>
+ )}
<ClarifyShell className="grid gap-3">
<div className="flex items-start gap-2">
<span className="flex-1 text-[0.6875rem] leading-4 text-(--ui-text-tertiary)">