Skip to content

feat: make pair view one mode for the window with a draggable divider - #2748

Merged
yansfil merged 14 commits into
feat/lane-deskfrom
m78-pair-mode
Nov 20, 2026
Merged

yansfil merged 14 commits into
feat/lane-deskfrom
m78-pair-mode

Conversation

@yansfil

@yansfil yansfil commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Related: PRD lane-desk-pair-view (B16-B29), operator decisions D-44..D-49 (interview Addendum); follows #2722, part of the feat/lane-desk mission.

Summary

Problem

The operator tried pair view in the integration build and hit four problems.
Leaving pair view left the file View floating on the right.
Pair view was remembered per Agent tab: ⌃⇥ to another agent dropped it, and coming back to the first tab turned it on again by itself.
⌘E and several other gestures ended it, so it was unclear how to leave.
The split was fixed at half and half.
The pane head's two-cell button sat in a bordered box, heavier than the head's other icons.
In the installed build, closing the lane with ⌘E hid pair view without ending it, so pressing a View on the usual screen later jumped back into pair view.

Before → After

Before After
What the user gets Pair view is a tab's state; ⌘E, the desk's ✕ and the rail fold end it; leaving leaves the desk open; fixed 50/50 Pair view is one mode for the window: ⌃⇥, the sidebar and a tab switch keep it on the agent gone to; only ⌘., ◧, 원래 화면으로, the pane closing or the last View closing end it; leaving closes the desk; a draggable divider whose ratio the mode keeps
Screen before sidebar follows
Screen (divider) dragging dragged
Screen (leave, light) left, no desk light, ratio kept
Screen (pane head) head before head after in pair view
Flow ◧ → pair view → ⌃⇥ / sidebar / tab → same mode, that agent on the left → ⌘. → usual layout, no desk

Look at the divider between the terminal and the desk (its ⇆ grip on hover), and the right side after leaving.

  • Mode location: one saved value, pair_view {on, ratio} in workspace-views.json, next to the lane's own state; the left pane is runtime only and follows the operator's look.
  • Per-tab pair memory is gone, with its id-migration row; an older file with a tab's pair loads with the mode off.
  • A pane with nothing to show, a shell or an agent that opened no View, draws its tab's own layout and the mode stays on; pair view opens no record card of its own, and such a pane has no ◧ (D-49). A record card the operator opened counts as the agent's View.
  • Leaving folds every desk pair view drew, in any Workspace, not only the last one (D-44); a tab it passed drawing the usual screen keeps the lane the operator opened there.
  • Pair view ends when the left agent's last View closes or leaves the desk, even with the operator's own files still on it (D-46, read by the pane).
  • D-48: the head's N views and ◧ cells are drawn without a box, like the head's other icons, with one hairline between them (Separator).
  • The divider reuses LaneDivider (kind="pair"): a guide while dragging, one landing and one terminal resize on release.

Decide

  • With the mode on and a shell pane in front, nothing on screen says the mode is on, and ⌘. there turns it off with no visible change (D-45 as decided). Add a mark for that state, or keep it quiet?
  • After leaving, a tool column opened during pair view stays open (only the desk closes). Keep, or close the whole lane?
  • Pane head light captures: light-head-1-unfocused / light-head-2-in-pair-view (in the Evidence block). Does the hairline read in light mode?
  • Is the divider's grip visible enough at rest (it shows on hover only, like the lane's)?

Not verified

  • Windows and Linux: no native run; the chord and layout code is shared and CI's web e2e lanes run the spec there.
  • A device (remote) pane in pair view only through the core test, not a live device.
  • The Escape check in e2e presses Escape on a desk tab; Escape inside a document editor in pair view was not driven.
Evidence
  • Verified: web/e2e/pair-view.spec.ts 3/3 pass, twice in a row; the 16 lane-related web specs (right-lane, lane-desk, s3/s4/s6/s7, close-policy, view-close-focus and others) 204/206 locally, the two s3 misses timing out on the sidebar's project row while other runs loaded the machine and passing alone; core cargo nextest on the pair, desk, workspace view and migration suites (502 tests) pass; clippy -D warnings on hide-core clean; web unit tests and the design contract check pass.

  • Isolated candidate: the desktop host launched through desktop/e2e/fixture.ts on a private HOME, state folder and Electron profile, renderer captures of that window in dark and light: pair entered, sidebar follow, divider hover, drag and landing, leaving with no desk, ratio kept on re-entry.

  • Light pane head: light head light head in pair view

Tests
  • Layer: core unit (hide-core/src/runtime/tests/desk_views.rs, workspace_views.rs) for the mode, its ratio, the follow and the ends; web unit (workspace.test.ts) for the split math; e2e (pair-view.spec.ts) for the flows only a page shows: the tab switch, ⌃⇥ and the sidebar keeping the mode, ⌘E and Escape not ending it, the divider drag with one resize, the desk closing on leave.
  • Catches: a lane the operator opened on a tab pair view did not draw closed by the mode passing; pair view left on, hidden, after the left agent's last View closed beside the operator's file; the mode left on, hidden, after the last View of a pane with no session closes; a desk in another Workspace left open after leaving; a record card opened for an agent with no View; a core that treats the desk as drawn while a shell is on screen (unseen Views marked seen, a desk tab opening pair view, the mode ending on an emptied desk), a lane left open on a desk pair view put a record card on, the paired terminal resized by Expand, a tab-level pair coming back on return (the off-stays-off steps), a hidden pair view drawn again when a desk tab is pressed on the usual screen, ⌘E closing the lane in pair view, a resize per pointer move, the ratio lost on leave.
  • Repeat: the pair spec ran five times across the changes; a run of the lane-related specs alongside it had not finished when this opened.
  • Waits: quietFor 300-500 ms where the spec proves something did not happen (⌘E, Escape, a second resize).
Risky files
  • hide-core/src/runtime/look.rs: every completed selection now runs follow_pair_look, which returns at once while the mode is off.
  • hide-core/src/workspace_views.rs: saved file shape (pair_view at the top level; trays lose pair).
  • hide-core/src/runtime/pair_view.rs: the mode, its ends and its follow.
  • web/src/LaneDivider.tsx, web/src/workspace.ts: shared divider and lane frame; laneFrame now carries the paired pane's width in the expanded frame too.

@yansfil
yansfil merged commit 0dc8c22 into feat/lane-desk Nov 20, 2026
50 checks passed
@yansfil
yansfil deleted the m78-pair-mode branch November 20, 2026 11:44
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