fix: handle back navigation from single file view to files list

This commit is contained in:
weishu
2026-01-02 16:02:35 +08:00
parent db6b227122
commit 11c95126e3
+7
View File
@@ -13,6 +13,13 @@ export function useAppGoBack(): () => void {
return
}
// For single file view, go back to files list
if (pathname.match(/^\/sessions\/[^/]+\/file$/)) {
const filesPath = pathname.replace(/\/file$/, '/files')
navigate({ to: filesPath })
return
}
// For session routes, navigate to parent path
if (pathname.startsWith('/sessions/')) {
const parentPath = pathname.replace(/\/[^/]+$/, '') || '/sessions'