mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 21:04:23 +01:00
Feat/mobile session actions (#206)
* feat: improve mobile session actions * feat(frontend): improve mobile session actions Replace inline file search in MoreDrawer with FileBrowserSheet for mention-file interactions. Add activePromptFileBasePath state to track workspace context, normalize file paths on selection, and improve command sorting with relevance ranking (exact > prefix > partial match). * refactor(frontend): remove dead state and deduplicate event reconciliation Remove unused activePromptDirectory from uiStateStore and its writers in SessionDetail and PromptInput. Consolidate duplicated permission and question reconciliation helpers in EventContext behind a generic session-scoped helper. --------- Co-authored-by: Chris Scott <>
This commit is contained in:
1 parent
389120559f
commit
04400c91cc
17 files changed
+709
-132
No files matched your search
@@ -164,4 +164,46 @@ describe('RepoQuickSwitchSheet', () => {
|
||||
expect(screen.getByTestId('location')).toHaveTextContent('/repos/1/assistant')
|
||||
expect(handleClose).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('navigates from assistant to repo detail when clicking active repo', async () => {
|
||||
vi.mocked(listRepos).mockResolvedValue([
|
||||
{
|
||||
id: 1,
|
||||
repoUrl: 'https://github.com/test/repo1.git',
|
||||
localPath: '/path/to/repo1',
|
||||
sourcePath: null,
|
||||
currentBranch: 'main',
|
||||
isLocal: false,
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
},
|
||||
])
|
||||
const handleClose = vi.fn()
|
||||
render(
|
||||
<QueryClientProvider client={new QueryClient()}>
|
||||
<MemoryRouter initialEntries={['/repos/1/assistant?mobileTab=repos']}>
|
||||
<Routes>
|
||||
<Route
|
||||
path="*"
|
||||
element={
|
||||
<>
|
||||
<RepoQuickSwitchSheet isOpen onClose={handleClose} />
|
||||
<LocationSpy />
|
||||
</>
|
||||
}
|
||||
/>
|
||||
</Routes>
|
||||
</MemoryRouter>
|
||||
</QueryClientProvider>,
|
||||
)
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText('repo1')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
fireEvent.click(screen.getByText('repo1'))
|
||||
|
||||
expect(screen.getByTestId('location')).toHaveTextContent('/repos/1')
|
||||
expect(handleClose).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user