Skip to content

Reserve quick-action space only on collapsed parent rows - #8056

Merged
ymichael merged 2 commits into
get-bb:mainfrom
lanjak:fix-8053-parent-row-title-width
Nov 23, 2026
Merged

ymichael merged 2 commits into
get-bb:mainfrom
lanjak:fix-8053-parent-row-title-width

Conversation

@lanjak

@lanjak lanjak commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

In the sidebar, a parent thread row with children always reserved the full quick-action width (30 px per configured action) on its right edge. The 26 px slot of its disclosure chevron stayed reserved too, also when the chevron was hidden at rest.

#6088 added this reserve to fix #5909: it keeps the chevron still on hover, so Archive cannot appear where the chevron was. But an expanded parent hides its chevron until hover, so there is nothing to keep still at rest. Its title still truncated 56 px (1 action) to 116 px (3 actions) earlier than a leaf title. Reproduction report.

What changed

plugins/thread-list/app/rows/ThreadRow.tsx:

  • Only collapsed parents keep the permanent reserve, because their chevron shows at rest. Expanded parents use the hover-only inset, the same as leaf rows.
  • At rest, the hidden chevron of an expanded parent goes out of the layout flow (absolute). It comes back into the flow under the same row states that apply the inset: hover, keyboard focus, or an open actions menu. It stays focusable, so Tab from the row link still goes to the chevron. Touch screens (hover: none) do not change.

This is a partial fix for #8053. Collapsed parents still reserve the space. A full fix needs the chevron at the leading edge of the row.

The table compares three layouts, each built and measured in Chromium. It shows the title width at rest in a 288 px sidebar, with a long title and provider icons on. The leaf title is 210 px.

Layout Expanded parent Collapsed parent
main 154 px (1 action), 94 px (3 actions) 154 px, 94 px
A: reserve only on collapsed parents (this PR) 210 px 154 px, 94 px
B: chevron before the title 190 px 190 px
C: chevron in the provider icon slot 210 px 210 px

In all three layouts, Archive and the menu stay in the leaf columns and the chevron does not move on hover. A is the closest to how the app works now. Every expandable row (project headers, environment groups, sidebar sections, timeline disclosures) keeps the chevron right after its label. B and C also fix collapsed parents, but they add a new pattern. With C, a collapsed parent also does not show its provider icon. B or C can follow in a separate PR if the maintainer prefers.

No wire, SDK, CLI or setting change.

How you verified

  • ThreadRow.test.tsx: the test "reserves quick-action space after parent disclosure" now asserts that a collapsed parent keeps the permanent padding and an expanded parent uses the hover-only inset. The expanded case fails on main (expected true to be false) and passes with this change.

  • pnpm exec turbo run typecheck test lint --filter=bb-plugin-thread-list: typecheck passes. Lint has 0 errors. Its 6 warnings are also on main. Tests: 460 of 460 pass. On Node 26, app.test.tsx "keys its slot and preferences mirror" fails because Node's own localStorage replaces the jsdom one. It passes with NODE_OPTIONS=--no-experimental-webstorage. CI uses Node 22.

  • Browser check in Chromium with hover. The rows are real ThreadRow DOM from the test harness, with the built app CSS and thread-list plugin CSS. Sidebar width 288 px, depth 0, 1 and 3 actions, provider icons on and off. Positions are from the left edge of the row:

    Row (1 action, icons on) main: title at rest This PR: title at rest Chevron x on hover Archive x on hover Space from chevron to Archive
    Leaf, long title 210 210 - 220 -
    Expanded parent 154 210 192 (main 192) 220 8 px
    Collapsed parent 154 154 192 (main 192) 220 8 px
    Sticky expanded parent 154 210 192 (main 192) 220 8 px

    With 3 actions: expanded parent 94 px to 210 px, chevron at 132 px, Archive at 160 px, 8 px between them. With provider icons off: expanded parent 178 px to 234 px (1 action) and 118 px to 234 px (3 actions).

  • In every case the row height is 28 px at rest and on hover, and the menu is at 250 px.

  • A click at the visible chevron of a collapsed parent hits Expand.

  • Keyboard focus on the row link and an open actions menu both show the chevron and apply the inset. Tab from the link goes to the chevron, then Archive, as on main.

  • Rename mode is the same as on main: 246 px input, chevron hidden, no padding.

  • Not checked: WebKit, the packaged desktop app, touch devices with a real pointer.

Fixes #8053

AGENT GENERATED

An expanded parent hides its disclosure at rest, so the row does not need
to keep the hover-action width and the chevron slot. Use the hover-only
inset, like a leaf row, and take the hidden chevron out of the flow until
the row is hovered, focused, or has an open actions menu.
The expanded parent chevron left the row's layout at rest through a long
Tailwind variant that restated, in a second place, the row states theme.css
uses to reveal hover actions and reserve their inset. A new reveal state
added to theme.css alone would show the chevron while it was still
absolutely positioned at the row's leading edge.

theme.css now owns a bb-sidebar-hover-actions-collapse class whose
in-row states use the same selector list as the actions inset, and a theme
test fails when the two lists differ. SidebarChildToggleChevron takes
collapseAtRest to apply it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit 977baf3 into get-bb:main Nov 23, 2026
49 checks passed
@lanjak
lanjak deleted the fix-8053-parent-row-title-width branch November 23, 2026 23:24
ymichael added a commit that referenced this pull request Nov 24, 2026
## Human comments

## What was wrong

Hovering an expanded parent thread row in the sidebar made the row 4 px
taller and pushed every row below it down. #8056 takes an expanded
parent's hidden disclosure chevron out of the layout at rest and puts it
back on hover. The chevron button is 20 px tall (`size-5`), but in a row
with a metadata line (for example a PR badge) the title line is only 16
px (`leading-4`). When the chevron came back on hover it set the title
line to 20 px. #8056 measured only one-line 28 px rows, which have spare
height, so this did not show there. For the same reason, collapsed
parents with a metadata line were 4 px taller than leaf rows all the
time.

## What changed

`plugins/thread-list/app/rows/ThreadRow.tsx`: the thread row's
`SidebarChildToggleChevron` gets `-my-0.5`, so its 20 px box takes 16 px
of line height. The button, its hover background and its touch hit area
keep the same size. Expanded parents keep their height on hover, and
collapsed parents with metadata are now the same height as leaf rows.
One-line rows do not change, because the chevron was already shorter
than the row.

No wire, SDK, CLI or setting change.

## How you verified

- Chromium (`hover: hover` emulated, 288 px sidebar): real thread-list
rows from the `sidebar/Thread list` Ladle fixture, with a temporary
row-metadata contributor so every row has a second line. Row heights at
rest → on hover:

  | Row | main | This PR |
  |---|---|---|
  | Expanded parent | 43 → 47 px | 43 → 43 px |
  | Collapsed parent | 47 → 47 px | 43 → 43 px |
  | Leaf | 43 → 43 px | 43 → 43 px |

A screenshot of a hovered expanded parent shows the chevron, Archive and
menu buttons lined up with the rows around it.
- `pnpm exec turbo run typecheck test lint
--filter=bb-plugin-thread-list`: passes, 460/460 tests.
- Not checked: WebKit, packaged desktop app.

Separately, the `sidebar/Thread list` Ladle stories crash on main.
`PluginThreadList.stories.tsx` calls `installTestPluginRuntime()`, which
replaces the plugin runtime that `.ladle/components.tsx` already
installs. Its slot then throws "useBbContext() needs the test slot
environment". For the measurements I removed that call in a local copy;
this PR does not change the story.

> AGENT GENERATED

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants