Simplify session navigation to use repo-based routing only

This commit is contained in:
Chris Scott committed 2025-12-12 18:38:58 -05:00
1 parent 74d8c983a7
commit 400f62bbee
3 files changed
+3 -11

No files matched your search

+1 -1
View File
@@ -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
+1
View File
@@ -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;
+1 -10
View File
@@ -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)
}}
/>