mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
Simplify session navigation to use repo-based routing only
This commit is contained in:
1 parent
74d8c983a7
commit
400f62bbee
3 files changed
+3
-11
No files matched your search
@@ -27,7 +27,7 @@ function AppContent() {
|
||||
<Route path="/" element={<Repos />} />
|
||||
<Route path="/repos/:id" element={<RepoDetail />} />
|
||||
<Route path="/repos/:id/sessions/:sessionId" element={<SessionDetail />} />
|
||||
<Route path="/session/:sessionId" element={<SessionDetail />} />
|
||||
|
||||
</Routes>
|
||||
<SettingsDialog open={isOpen} onOpenChange={close} />
|
||||
<Toaster
|
||||
|
||||
@@ -67,6 +67,7 @@ export const useCreateSession = (opcodeUrl: string | null | undefined, directory
|
||||
const client = useOpenCodeClient(opcodeUrl, directory);
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async (data: {
|
||||
title?: string;
|
||||
|
||||
@@ -271,16 +271,7 @@ export function SessionDetail() {
|
||||
directory={repoDirectory}
|
||||
activeSessionID={sessionId || undefined}
|
||||
onSelectSession={(sessionID) => {
|
||||
// Navigate to the correct repo session URL pattern
|
||||
const currentPath = window.location.pathname
|
||||
const repoMatch = currentPath.match(/\/repos\/(\d+)\/sessions\//)
|
||||
if (repoMatch) {
|
||||
const repoId = repoMatch[1]
|
||||
navigate(`/repos/${repoId}/sessions/${sessionID}`)
|
||||
} else {
|
||||
// Fallback for direct session access
|
||||
navigate(`/session/${sessionID}`)
|
||||
}
|
||||
navigate(`/repos/${repoId}/sessions/${sessionID}`)
|
||||
setSessionsDialogOpen(false)
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user