Split pages/layout.tsx into composable layout modules with stable behavior.
packages/app/src/pages/layout.tsx is a 3,000+ line coordinator for sidebar navigation, project/workspace controls, deep-link handling, dialogs, drag/drop overlays, and global shell interactions. This spec decomposes it into focused modules to improve maintainability and reduce merge risk for future features.
packages/app/src/pages/layout.tsx into smaller units.pages/session.tsx in this workstream.This workstream owns:
packages/app/src/pages/layout.tsxpackages/app/src/pages/layout/**This workstream must not edit:
packages/app/src/pages/session.tsx (spec 09)packages/app/src/components/prompt-input.tsx (spec 11)packages/app/src/context/global-sync.tsx (spec 12)Create packages/app/src/pages/layout/ modules such as:
use-layout-page-state.ts - orchestration state and handlers.sidebar-panel.tsx - sidebar shell and root interactions.project-item.tsx - project-level row and actions.workspace-item.tsx - workspace row, sessions list, and workspace actions.deep-links.ts - deep-link parsing/draining/handler utilities.Keep packages/app/src/pages/layout.tsx as route-level composition and provider wiring.
use-layout-page-state.ts.layout.tsx to composition-only entry.packages/app/src/pages/layout.tsx is significantly smaller (target: under 1,200 LOC).bun run typecheck (from packages/app).e2e/sidebar/sidebar.spec.tse2e/projects/workspaces.spec.tse2e/projects/project-edit.spec.tse2e/app/navigation.spec.tspages/layout/ for now to avoid cross-spec conflicts.