feat(frontend): add mobile composer tools menu and base branch select

This commit is contained in:
Chris Scott committed 2026-10-04 00:05:53 -04:00
1 parent fac23b1f1a
commit 4a2e695ec2
21 files changed
+819 -158

No files matched your search

@@ -22,6 +22,7 @@ const mocks = vi.hoisted(() => ({
useAutoScroll: vi.fn(),
useDialogParam: vi.fn(),
useSessionStatusForSession: vi.fn(),
interruptMutate: vi.fn(),
PromptInput: vi.fn(),
uiState: { isEditingMessage: false },
}))
@@ -39,7 +40,7 @@ vi.mock('@/config', () => ({
vi.mock('@/hooks/useOpenCode', () => ({
useSession: mocks.useSession,
useInterruptSession: vi.fn(() => ({ mutate: vi.fn() })),
useInterruptSession: vi.fn(() => ({ mutate: mocks.interruptMutate })),
useUpdateSession: vi.fn(() => ({ mutate: vi.fn() })),
useCreateSession: vi.fn(() => ({ mutateAsync: vi.fn() })),
useConfig: mocks.useConfig,
@@ -389,6 +390,22 @@ describe('SessionDetail scroll floating button', () => {
expect(screen.queryByLabelText('Clear')).not.toBeInTheDocument()
})
it('renders the mobile stop button while the session is active and interrupts on click', async () => {
renderWith({ mobile: true, showScrollButton: false, sessionActive: true })
const stopButton = await screen.findByTitle('Stop')
fireEvent.click(stopButton)
expect(mocks.interruptMutate).toHaveBeenCalledWith('test-session')
})
it('does not render the stop button while the session is idle', async () => {
renderWith({ mobile: true, showScrollButton: false, sessionActive: false })
await waitFor(() => expect(screen.getByText('MockedPromptInput')).toBeInTheDocument())
expect(screen.queryByTitle('Stop')).not.toBeInTheDocument()
})
it('clicking PromptInput scroll button calls scrollToBottom from useAutoScroll', async () => {
renderWith({ mobile: true, showScrollButton: true })