feat(ui): app-wide keyboard shortcuts with TUI keybind import

This commit is contained in:
Chris Scott committed 2026-10-08 10:47:52 -04:00
1 parent b18e4f13b3
commit b06de60f6b
38 files changed
+2467 -440

No files matched your search

@@ -422,6 +422,30 @@ describe('PromptInput command submission', () => {
expect(screen.getByTestId('model-quick-select')).toHaveAttribute('data-open', 'true')
})
it('resets bash mode through the imperative clearPrompt', async () => {
const queryClient = createTestQueryClient()
queryClient.setQueryData(['opencode', 'session', 'test-session', '/test'], sessionInfo())
const ref = createRef<PromptInputHandle>()
render(
<QueryClientProvider client={queryClient}>
<PromptInput {...defaultProps} ref={ref} />
</QueryClientProvider>
)
const input = await screen.findByPlaceholderText('Send a message...')
fireEvent.change(input, { target: { value: '!' } })
expect(input).toHaveValue('!')
expect(screen.getByTestId('composer-mode-badge')).toHaveTextContent('BASH')
act(() => {
ref.current?.clearPrompt()
})
expect(input).toHaveValue('')
expect(screen.queryByTestId('composer-mode-badge')).not.toBeInTheDocument()
})
it('keeps attachments and clears only the text when a built-in command is submitted', async () => {
const { container } = renderComponent()