Skip to content

fix(cli-rs): show the hovered tab's title beside the compact rail - #67281

Merged
simonklee merged 3 commits into
devfrom
native-tooltip
Nov 30, 2026
Merged

simonklee merged 3 commits into
devfrom
native-tooltip

Conversation

@simonklee

@simonklee simonklee commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

What it does

On the compact vertical tab rail (narrower than SESSION_TABS_COMPACT_BREAKPOINT), hovering a tab now shows the session's
title 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 zIndex only orders it among the rail's own
children, so the prompt and footer paint over it near the bottom; parity/deviations/W01-compact-tooltip-layer.md
records that difference.

Also updates the C.8/invalid-config machine mock for #67058's status union, and covers the protocol-mismatch and
protocol-error refusals in machine.rs and C.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 the
bottom differs only by W01. cargo fmt --check, clippy, check:drift, and the TUI and CLI suites with the
TypeScript interop tests. The merge lane's gate and full suites passed on this commit.


Added by the opencode bot (AI-generated).

Related: #67045

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.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@simonklee
simonklee merged commit ca4c03d into dev Nov 30, 2026
11 checks passed
@simonklee
simonklee deleted the native-tooltip branch November 30, 2026 10:03
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