Skip to content

Keep a generating chat's spinner clear of the kebab on hover - #7751

Open
danielhanchen wants to merge 1 commit into
mainfrom
studio-sidebar-spinner-kebab-hover
Open

Keep a generating chat's spinner clear of the kebab on hover#7751
danielhanchen wants to merge 1 commit into
mainfrom
studio-sidebar-spinner-kebab-hover

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Follow-up to #7749, which lined the sidebar spinners up on one column. This handles the other half of that trailing slot, the hover state.

Problem

An unpinned Recents row is pr-4 at rest and widens to pr-6 on hover to make room for the kebab. The kebab is absolutely positioned at the row's right edge, and .sidebar-row-action (pr-1.5) plus its size-6 glyph puts the glyph 30px in. 24px of hover padding is 6px short of that, so a row that is generating ends up with its spinner underneath the icon.

Measured on a running Studio at a 1440px viewport, row right edge at 273:

State spinner kebab icon result
rest, pr-4 241 to 257 247 to 263, opacity 0 kebab hidden, nothing visible
hover, pr-6 233 to 249 247 to 263, opacity 1 2px overlap

The kebab's 24px glyph box (243 to 267) overlaps the spinner by 6px, and the painted icon by 2px. The two glyphs touch for as long as the pointer stays on the row.

Fix

Use pr-8 (32px) for the hover and menu-open states, but only while the row is generating. That clears the 30px inset with 2px to spare.

Rows that are not generating keep pr-6 untouched, so the existing tradeoff noted in the comment there, that the title keeps one more character, still holds for every row that has no spinner to protect.

Verification

Same measurement after the change:

BEFORE hover (pr-6): spinner 233 to 249, icon 247 to 263, gap -2px (overlap)
AFTER  hover (pr-8): spinner 225 to 241, icon 247 to 263, gap  6px
  • npm run typecheck clean
  • npm run test 288 passing, including a new case that derives the 30px kebab inset from index.css and asserts every padding on the generating branch clears it
  • biome and eslint report identical counts on this file before and after
  • the new test fails on the pre-fix source, and an AST check confirms the edit is confined to the buttonClass declaration, with all 10085 nodes outside it identical

An unpinned Recents row sits at pr-4 and widens to pr-6 on hover to make
room for the kebab. The kebab is absolutely positioned at the row's right
edge and its glyph starts 30px in (pr-1.5 plus a size-6 glyph), so 24px
of padding leaves the trailing spinner 2px under the icon, with the two
glyphs touching for as long as the pointer is on the row.

Use pr-8 instead, but only while the row is generating. Rows without a
spinner keep pr-6 and the extra character of title that goes with it.

Measured on a running Studio, hovering a generating row goes from a 2px
overlap to a 6px gap, and the spinner clears the kebab's 24px glyph box
by 2px.
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