fix(web): keep composer add action attachment-only

This commit is contained in:
imccyu
2026-07-25 16:19:36 +08:00
parent 08ce02da2b
commit 468c64a078
3 changed files with 2 additions and 5 deletions

View File

@@ -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={() => {}}
/>

View File

@@ -72,7 +72,6 @@ export function EmptyState({
error={error}
onDraftChange={updateSessionPrompt}
onSend={() => { sendSession() }}
onAdd={() => { setPickerOpen(true) }}
/>
)
}

View File

@@ -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' }))