Split pages/session.tsx into focused modules without behavior changes.
packages/app/src/pages/session.tsx is still a large (~3,655 LOC) route coordinator. Recent refactoring already extracted packages/app/src/pages/session/helpers.ts and packages/app/src/pages/session/scroll-spy.ts, but review-panel wiring, message timeline orchestration, file-tab rendering, and terminal coordination remain tightly coupled. This spec continues the decomposition from that updated baseline.
packages/app/src/pages/session.tsx.packages/app/src/pages/session/.context/global-sync.tsx, context/file.tsx, or components/prompt-input.tsx in this workstream.This workstream owns:
packages/app/src/pages/session.tsxpackages/app/src/pages/session/**This workstream must not edit:
packages/app/src/pages/layout.tsx (owned by spec 10)packages/app/src/components/prompt-input.tsx (owned by spec 11)packages/app/src/context/global-sync.tsx (owned by spec 12)packages/app/src/context/file.tsx (owned by spec 13)packages/app/src/pages/session/helpers.ts (terminal focus and shared handlers)packages/app/src/pages/session/scroll-spy.ts (message visibility + active-section tracking)createEffect) and local-state density (createStore + createSignal) remain in session.tsx.Build on the existing packages/app/src/pages/session/ directory and keep current extracted helpers in place. Add modules such as:
review-panel.tsx - review tab rendering and focused diff logic.message-timeline.tsx - session turn rendering and active message tracking UI wiring.file-tabs.tsx - file tab content rendering, file scroll persistence, and line-comment overlays.terminal-panel.tsx - terminal tabs and focus behavior.use-session-page-state.ts - page-level derived state and imperative handlers.packages/app/src/pages/session.tsx remains the route entry and orchestrator only.
helpers.ts and scroll-spy.ts as baseline; extract any additional pure helpers first (no behavior changes).use-session-page-state.ts.session.tsx to composition and routing glue.packages/app/src/pages/session.tsx is reduced substantially (target: under 1,400 LOC).bun run typecheck (from packages/app).e2e/session/session.spec.tse2e/files/file-viewer.spec.tse2e/terminal/terminal.spec.tspages/session/ for now; cross-spec shared utilities can be unified later.