Skip to content

feat(desktop): lay the context panel's view tabs out side by side - #1677

Merged
huichen merged 3 commits into
mainfrom
pr/huichen
Nov 23, 2026
Merged

huichen merged 3 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

The context panel's view switch becomes a segmented control — one click per tab — when the panel is wide enough to hold every label. Narrow panels keep the existing dropdown, where squeezing the labels side by side would only truncate them.

Commits

  • feat(desktop): lay the context panel's view tabs out side by side — the panel header renders the view tabs as segments once the panel width covers all labels plus the header padding, gap and collapse button, and falls back to the current Select below that threshold; the screenshot scenarios that anchor on #context-panel-view are updated for both layouts.

Verification

Run locally in the worktree on dev-huichen @ 5a8f6075b:

  • npm --prefix desktop run typecheck (tsc --noEmit) → pass
  • npx eslint src/components/layout/ContextPanel.tsx src/components/layout/ContextPanel.test.tsx → pass
  • npx vitest run src/components/layout/ContextPanel.test.tsx → 46 tests passed
  • JSON validity check on the four touched scripts/screenshots/scenarios*.json files → pass

No Rust crates are touched, so no cargo checks were run.

Notes

  • #context-panel-view stays the view-switch anchor in both layouts (a role="group" container when inline, the Select id when collapsed), so screenshot scenarios and tests that use it to tell an open panel from a closed one keep working.
  • The segmented control mirrors the one the remote files panel already renders in the same slot, so the header does not change shape when the conversation is on another machine.

User-visible changes

  • Context panel view switch: before → always a dropdown listing the view names; after → a segmented control with one click per tab when the panel is wide enough (labels fit at 72 px per segment plus header padding, gap and collapse button width), otherwise the dropdown as before. Rollback: commit 5a8f6075b.
  • Screenshot scenario definitions (scripts/screenshots/scenarios.json, scenarios.d/{fusion-detail,git-lane-window,git-paged}.json) follow the new layout; no other product behaviour changes.

The panel's view picker was a dropdown, so changing views took two clicks:
open the list, then pick. At column width the header has room for the views
themselves, so draw them as one-click segments — the same control the remote
files panel already puts in that slot — and keep the dropdown only for a panel
too narrow to hold them without truncating a label.

The screenshot scenarios that drove the picker through the `<select>` now click
`#context-panel-view [data-context-tab=…]`, and the narrow-panel scenario
asserts the three segments sit on one row without clipping. The not-a-repo
scenario's `.grid` probe is scoped to the Review panel's own strip, which the
panel header now legitimately matches.
@huichen
huichen enabled auto-merge (squash) November 23, 2026 09:18
@huichen
huichen merged commit 962420b into main Nov 23, 2026
10 checks passed
@huichen
huichen deleted the pr/huichen branch November 23, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant