Skip to content

Commit 400f62b

Browse files
Simplify session navigation to use repo-based routing only
1 parent 74d8c98 commit 400f62b

3 files changed

Lines changed: 3 additions & 11 deletions

File tree

frontend/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function AppContent() {
2727
<Route path="/" element={<Repos />} />
2828
<Route path="/repos/:id" element={<RepoDetail />} />
2929
<Route path="/repos/:id/sessions/:sessionId" element={<SessionDetail />} />
30-
<Route path="/session/:sessionId" element={<SessionDetail />} />
30+
3131
</Routes>
3232
<SettingsDialog open={isOpen} onOpenChange={close} />
3333
<Toaster

frontend/src/hooks/useOpenCode.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export const useCreateSession = (opcodeUrl: string | null | undefined, directory
6767
const client = useOpenCodeClient(opcodeUrl, directory);
6868
const queryClient = useQueryClient();
6969

70+
7071
return useMutation({
7172
mutationFn: async (data: {
7273
title?: string;

frontend/src/pages/SessionDetail.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -271,16 +271,7 @@ export function SessionDetail() {
271271
directory={repoDirectory}
272272
activeSessionID={sessionId || undefined}
273273
onSelectSession={(sessionID) => {
274-
// Navigate to the correct repo session URL pattern
275-
const currentPath = window.location.pathname
276-
const repoMatch = currentPath.match(/\/repos\/(\d+)\/sessions\//)
277-
if (repoMatch) {
278-
const repoId = repoMatch[1]
279-
navigate(`/repos/${repoId}/sessions/${sessionID}`)
280-
} else {
281-
// Fallback for direct session access
282-
navigate(`/session/${sessionID}`)
283-
}
274+
navigate(`/repos/${repoId}/sessions/${sessionID}`)
284275
setSessionsDialogOpen(false)
285276
}}
286277
/>

0 commit comments

Comments
 (0)