arch: files feature reads route identity via useMatch #275
Copy link
Copy link
Open
Description
Problem
`frontend-state.md` limits route-identity reads to composition roots (`routes/`, `app-interface.tsx`, `components/layout/`). The files feature bypasses this seam.
`useSessionWorkspace` calls `useMatch({ from: "/session/$sessionId" })` to derive `projectId`, while `__root.tsx` already owns the authoritative `sessionRef` match for the same route.
Affected files
- `apps/app/src/features/files/use-session-workspace.ts`
- Consumers: `files-panel.tsx`, `file-panel.tsx`
Why it matters
When the session route loader shape changes, the shell and files feature can drift independently. Panel handles already carry `sessionRef.projectId`; panels should use that instead of re-reading the router.
Suggested fix
Change `useSessionWorkspace(projectId)` to accept `instance.sessionRef.projectId` from the panel handle. Remove `useMatch` from the feature.
Severity
P2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity