mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
Merge branch 'main' into feat/walkthrough-plan-explain
Resolve ChangesWalkthroughSheet conflicts by keeping main's overview/paging model and the branch's source picker, per-stop status, and mechanical hunks.
This commit is contained in:
commit
b01d3ab6db
21 files changed
+390
-121
No files matched your search
@@ -130,6 +130,27 @@ describe('useCommands', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('loads commands for a newly selected directory even when queries have a stale time', async () => {
|
||||
vi.mocked(listCommands).mockImplementation(async (directory) => [
|
||||
{ name: directory === '/repo-b' ? 'from-b' : 'from-a', description: '' },
|
||||
])
|
||||
const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false, staleTime: 60_000 } } })
|
||||
const wrapper = ({ children }: { children: React.ReactNode }) => (
|
||||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
||||
)
|
||||
|
||||
const { result, rerender } = renderHook(({ directory }) => useCommands({ directory }), {
|
||||
wrapper,
|
||||
initialProps: { directory: '/repo-a' },
|
||||
})
|
||||
await waitFor(() => expect(result.current.findCommand('from-a')).toBeDefined())
|
||||
|
||||
rerender({ directory: '/repo-b' })
|
||||
|
||||
await waitFor(() => expect(result.current.findCommand('from-b')).toBeDefined())
|
||||
expect(listCommands).toHaveBeenCalledWith('/repo-b')
|
||||
})
|
||||
|
||||
it('finds only exact command names, ignoring case', () => {
|
||||
const { result } = renderHook(() => useCommands({ enabled: false }), { wrapper: createWrapper() })
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ export function useCommands(options: UseCommandsOptions = {}) {
|
||||
},
|
||||
enabled,
|
||||
initialData: SORTED_BUILTIN_COMMANDS,
|
||||
initialDataUpdatedAt: 0,
|
||||
})
|
||||
|
||||
const searchCommands = useCallback((query: string) => rankByMatch(commands, query, {
|
||||
|
||||
Reference in new issue
Block a user