Skip to content

arch: files feature reads route identity via useMatch #275

Open

Description

@cursor

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions