diff --git a/ui/src/pages/ProjectDetail.tsx b/ui/src/pages/ProjectDetail.tsx index 4de40782..a0f1b7d7 100644 --- a/ui/src/pages/ProjectDetail.tsx +++ b/ui/src/pages/ProjectDetail.tsx @@ -443,8 +443,21 @@ export function ProjectDetail() { return ; } - // Redirect bare /projects/:id to /projects/:id/issues + // Redirect bare /projects/:id to cached tab or default /issues if (routeProjectRef && activeTab === null) { + let cachedTab: string | null = null; + if (project?.id) { + try { cachedTab = localStorage.getItem(`paperclip:project-tab:${project.id}`); } catch {} + } + if (cachedTab === "overview") { + return ; + } + if (cachedTab === "configuration") { + return ; + } + if (isProjectPluginTab(cachedTab)) { + return ; + } return ; } @@ -453,6 +466,10 @@ export function ProjectDetail() { if (!project) return null; const handleTabChange = (tab: ProjectTab) => { + // Cache the active tab per project + if (project?.id) { + try { localStorage.setItem(`paperclip:project-tab:${project.id}`, tab); } catch {} + } if (isProjectPluginTab(tab)) { navigate(`/projects/${canonicalProjectRef}?tab=${encodeURIComponent(tab)}`); return; @@ -527,8 +544,8 @@ export function ProjectDetail() { handleTabChange(value as ProjectTab)}> ({