Goal
packages/app/src/pages/session/session-side-panel.tsx is split into a small shell + a few focused subcomponents, each readable in one pass, with no user-visible behavior change.
Scope
In scope:
- Move the 5 small exported helpers (
formatRightPanelWidth, makeRightPanelResizeHandler, shouldShowReviewFileOpenButton, sortableShellTabIds, openReviewShellTab) and RightPanelShellIcon to a sibling helpers/icons file.
- Extract the portalled tab strip (chips + sortable +
+ DropdownMenu + the absolute-positioned right utility toggle from apps#887) into a RightPanelTabStrip component.
- Extract the Review panel body (the nested
Tabs for inner file tabs + DragDropProvider + per-tab content switch, currently the largest single block at lines ~465–577) into a RightPanelReviewBody component.
- Trim the top-level
SessionSidePanel to a thin shell that owns the resize handle, the open/bodyMounted lifecycle, and dispatches each Tabs.Content.
- Preserve all imports, context dependencies, and DnD wiring.
Out of scope:
- Any change to the right-panel visual contract, animation, tab semantics, drag-and-drop behavior, or persisted state.
- Renaming or re-shaping the layout context,
createSizing, or useSessionLayout.
- Touching
session.tsx, session-main-view.tsx, or any callsite of SessionSidePanel.
Relevant files or context
Likely files:
packages/app/src/pages/session/session-side-panel.tsx (604 lines today; target ~200 after extraction)
packages/app/src/pages/session/helpers.ts (natural home for the 5 helpers)
- New:
packages/app/src/pages/session/right-panel-tab-strip.tsx
- New:
packages/app/src/pages/session/right-panel-review-body.tsx
Context:
- Surfaced during review of apps#887 (right-panel titlebar seam fixes). That PR added ~21 lines to the file but the bulk of the bloat predates it.
- Per AGENTS.md: "New or actively modified frontend code should be agent-readable: keep files focused, easy to grep, and small enough to read in one pass."
- Existing test fixture:
packages/app/src/pages/session/session-side-panel.test.tsx should keep passing without modification (extraction is structural, not behavioral).
Verification
bun test — clean (including session-side-panel.test.tsx).
bun --cwd packages/app run typecheck — clean.
bun run lint — clean.
bun run test:e2e:local session/ — clean (right-panel-tabs hover, right-panel-titlebar contract, session-tab-chip contract, titlebar-right-rail contract).
bun run snap right-panel-titlebar and bun run snap right-panel-tabs-hover — pixel-identical to current baselines (PNGs unchanged).
- Manual:
bun run dev:desktop, walk through opening/closing the right panel, switching all five tabs (Status / Files / Review / Terminal / Context), opening files into Review, drag-reordering Review's inner file tabs, drag-reordering Status/Files/Review chips in the titlebar strip, resizing the panel.
Execution mode
Wait for human approval — the agent must not write code or open a PR until a human leaves an explicit "approved" comment on this issue
Goal
packages/app/src/pages/session/session-side-panel.tsxis split into a small shell + a few focused subcomponents, each readable in one pass, with no user-visible behavior change.Scope
In scope:
formatRightPanelWidth,makeRightPanelResizeHandler,shouldShowReviewFileOpenButton,sortableShellTabIds,openReviewShellTab) andRightPanelShellIconto a sibling helpers/icons file.+DropdownMenu + the absolute-positioned right utility toggle from apps#887) into aRightPanelTabStripcomponent.Tabsfor inner file tabs + DragDropProvider + per-tab content switch, currently the largest single block at lines ~465–577) into aRightPanelReviewBodycomponent.SessionSidePanelto a thin shell that owns the resize handle, the open/bodyMounted lifecycle, and dispatches eachTabs.Content.Out of scope:
createSizing, oruseSessionLayout.session.tsx,session-main-view.tsx, or any callsite ofSessionSidePanel.Relevant files or context
Likely files:
packages/app/src/pages/session/session-side-panel.tsx(604 lines today; target ~200 after extraction)packages/app/src/pages/session/helpers.ts(natural home for the 5 helpers)packages/app/src/pages/session/right-panel-tab-strip.tsxpackages/app/src/pages/session/right-panel-review-body.tsxContext:
packages/app/src/pages/session/session-side-panel.test.tsxshould keep passing without modification (extraction is structural, not behavioral).Verification
bun test— clean (includingsession-side-panel.test.tsx).bun --cwd packages/app run typecheck— clean.bun run lint— clean.bun run test:e2e:local session/— clean (right-panel-tabs hover, right-panel-titlebar contract, session-tab-chip contract, titlebar-right-rail contract).bun run snap right-panel-titlebarandbun run snap right-panel-tabs-hover— pixel-identical to current baselines (PNGs unchanged).bun run dev:desktop, walk through opening/closing the right panel, switching all five tabs (Status / Files / Review / Terminal / Context), opening files into Review, drag-reordering Review's inner file tabs, drag-reordering Status/Files/Review chips in the titlebar strip, resizing the panel.Execution mode
Wait for human approval — the agent must not write code or open a PR until a human leaves an explicit "approved" comment on this issue