Repository navigation
fix(cli-rs): show the hovered tab's title beside the compact rail - #67281
Conversation
Port the compact vertical tab rail tooltip from packages/tui's VerticalSessionTabs: when the vertical rail is below SESSION_TABS_COMPACT_BREAKPOINT and a tab is hovered (not pressed or dragged), render a 4-row floating box beside the rail with half-row edges in background.raised.base over background.base, the session title truncated to fit in text.base, and the tab detail in text.muted. Clamp the top row to the screen height and hide on press/drag, leave, or mode switch. Mount the tooltip on Frame::body above the main column at z_index(2000) so transcript and prompt cells do not overwrite it (documented in W01-compact-tooltip-layer.md). Add a hover step to P-APP and record E.12/tab-tooltip covering top hover truncation and bottom clamping.
There was a problem hiding this comment.
The change looks sound. The new rail test, the E.12/tab-tooltip parity scenario (via app::scenarios) and the existing tabs::/app:: and machine tests pass, and clippy and fmt are clean. In the full opencode-tui suite, only plugin_pipe::the_tui_ending_leaves_nothing_its_plugins_started fails, and it fails the same way on the base. Pulling session_text out of items doesn't change behaviour, and the tooltip hides correctly on press, on leave, on a compact/wide switch, and when its tab goes away (through sync_tooltip on refresh).
Public API: unchanged (the new hover step exists only in the parity test harness).
One small missing case: wheel-scrolling the rail leaves the tooltip on the old tab (see inline comment).
I couldn't drive the native TUI here to take screenshots. Could you attach a before/after screenshot of the compact rail with the tooltip showing?
Related: #67045
There was a problem hiding this comment.
The new commit fixes the scroll point: wheel-scrolling the rail now updates the hovered tab, the marquee and the tooltip through the same hover() path as a pointer move, so the tooltip stays on the tab under the pointer. The new compact_rail_tooltip_follows_scroll test and the existing tabs::/app:: tests (19, including the parity scenarios) pass, and clippy and fmt are clean. Nothing new to raise. The public API is unchanged.
What it does
On the compact vertical tab rail (narrower than
SESSION_TABS_COMPACT_BREAKPOINT), hovering a tab now shows the session'stitle and its detail line in a box beside the rail, as the TypeScript TUI has done since #47938. The box has the same
placement, width (at most 54 cells), half-row edges and colours as TS, is clamped to the screen near the bottom, and
hides while a tab is pressed or dragged, when the pointer leaves, and when the rail stops being compact.
The Rust box floats above the transcript and prompt. In TS the tooltip's
zIndexonly orders it among the rail's ownchildren, so the prompt and footer paint over it near the bottom;
parity/deviations/W01-compact-tooltip-layer.mdrecords that difference.
Also updates the
C.8/invalid-configmachine mock for #67058's status union, and covers the protocol-mismatch andprotocol-error refusals in
machine.rsandC.9/machine.Checks
A new P-APP scenario,
E.12/tab-tooltip: hovering a top tab matches TS on every cell; hovering the last tab near thebottom differs only by W01.
cargo fmt --check,clippy,check:drift, and the TUI and CLI suites with theTypeScript interop tests. The merge lane's gate and full suites passed on this commit.
Added by the opencode bot (AI-generated).
Related: #67045