From 468c64a078472b7758962f0f38d428b4ae763f39 Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Sat, 25 Jul 2026 16:19:36 +0800 Subject: [PATCH] fix(web): keep composer add action attachment-only --- .../client/ui-conversation/src/client/skeleton/EmptyHero.tsx | 4 ---- .../client/ui-conversation/src/client/skeleton/EmptyState.tsx | 1 - packages/client/ui-conversation/tests/skeleton.spec.tsx | 2 ++ 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/client/ui-conversation/src/client/skeleton/EmptyHero.tsx b/packages/client/ui-conversation/src/client/skeleton/EmptyHero.tsx index b8badba406..941729f9a0 100644 --- a/packages/client/ui-conversation/src/client/skeleton/EmptyHero.tsx +++ b/packages/client/ui-conversation/src/client/skeleton/EmptyHero.tsx @@ -73,7 +73,6 @@ export interface EmptyHeroProps { status?: string onDraftChange: (text: string) => void onSend: (mode: 'queue' | 'steer') => void - onAdd?: () => void /** Overlay content after the stack (EmptyState's modals). */ children?: ReactNode } @@ -92,7 +91,6 @@ export function EmptyHero({ status, onDraftChange, onSend, - onAdd, children, }: EmptyHeroProps) { // Stable filter id so multiple hero mounts do not collide in the DOM. @@ -140,8 +138,6 @@ export function EmptyHero({ placeholder={placeholder ?? 'Describe what you want to build'} onDraftChange={onDraftChange} onSend={onSend} - {...(onAdd === undefined ? {} : { onAdd })} - addLabel="Create workspace" /* v8 ignore next -- structural noop: hero never passes running=true, so stop is unreachable. */ onStop={() => {}} /> diff --git a/packages/client/ui-conversation/src/client/skeleton/EmptyState.tsx b/packages/client/ui-conversation/src/client/skeleton/EmptyState.tsx index dd8865efb8..c363d094a6 100644 --- a/packages/client/ui-conversation/src/client/skeleton/EmptyState.tsx +++ b/packages/client/ui-conversation/src/client/skeleton/EmptyState.tsx @@ -72,7 +72,6 @@ export function EmptyState({ error={error} onDraftChange={updateSessionPrompt} onSend={() => { sendSession() }} - onAdd={() => { setPickerOpen(true) }} /> ) } diff --git a/packages/client/ui-conversation/tests/skeleton.spec.tsx b/packages/client/ui-conversation/tests/skeleton.spec.tsx index fc596ec821..e4a8aa2696 100644 --- a/packages/client/ui-conversation/tests/skeleton.spec.tsx +++ b/packages/client/ui-conversation/tests/skeleton.spec.tsx @@ -72,6 +72,8 @@ describe('EmptyState', () => { prompt: 'draft', phase: 'ready', }) expect(b.view.getByRole('button', { name: 'Choose workspace' }).textContent).toContain('workspace') + fireEvent.click(b.view.getByRole('button', { name: 'Add attachment' })) + expect((b.pickerOwner() as { open: boolean }).open).toBe(false) fireEvent.change(b.view.getByPlaceholderText('Describe what you want to build'), { target: { value: 'build it' } }) expect(b.updateSessionPrompt).toHaveBeenCalledWith('build it') fireEvent.click(b.view.getByRole('button', { name: 'Send message' }))