Skip to content

desktop: keep sidebar unread pill below top chrome strip#1136

Merged
tlongwell-block merged 1 commit into
mainfrom
sami/fix-unread-button-traffic-light-overlap
Jun 19, 2026
Merged

desktop: keep sidebar unread pill below top chrome strip#1136
tlongwell-block merged 1 commit into
mainfrom
sami/fix-unread-button-traffic-light-overlap

Conversation

@tlongwell-block

Copy link
Copy Markdown
Collaborator

Problem

The sidebar's "more unread above" pill (MoreUnreadButton with position="top") was anchored at top-0, placing it inside the 40 px top chrome strip. On macOS that strip holds the traffic-light buttons, so the pink "↑ N new" pill rendered right on top of them whenever channels were unread above the viewport.

Reported in buzz-bugs with this screenshot:

overlap

Fix

Anchor the top variant to topChromeInset.top (top-(--buzz-top-chrome-height,2.5rem)). This matches the existing mt-(--buzz-top-chrome-height) on SidebarContent and auto-tracks any future chrome-height change via the same CSS variable. Two-line source diff to MoreUnreadButton.tsx; no prop API change.

Before / After

A new Playwright regression in the smoke project injects two synthetic pill divs into the sidebar — one with the legacy top-0, one with the fixed topChromeInset.top — and screenshots the top-left of the window. The pill's boundingBox y-coordinate is asserted to clear the 40 px chrome strip in the fixed variant.

Before (top-0) After (topChromeInset.top)
Pill overlaps the chrome strip Pill sits cleanly below it

(Screenshots posted in the bug thread.)

Notes

  • Added data-testid="app-sidebar-scroll-anchor" to the sidebar's relative wrapper so the spec has a stable selector without coupling to shadcn Sidebar internals.
  • pnpm typecheck, pnpm check, and the new spec pass locally.

The "more unread above" pill in the sidebar (`MoreUnreadButton`
`position="top"`) was anchored to `top-0` inside a column starting at
window y=0. On macOS, the 40px top chrome strip with the traffic-light
buttons lives at exactly that y range, so the centered pill overlapped
the traffic lights when channels were unread above the viewport.

Anchor the top variant to `topChromeInset.top`
(`top-(--buzz-top-chrome-height,2.5rem)`) so it lines up with the
existing `mt-(--buzz-top-chrome-height)` on `SidebarContent` and tracks
any future chrome-height changes via the same CSS variable.

Also adds a Playwright regression in the smoke project that injects two
synthetic pill divs into the sidebar's relative wrapper — one with the
legacy `top-0` and one with the fixed `topChromeInset.top` — and
asserts the boundingBox y-coordinate sits below the 40px chrome strip
in the fixed variant. A new `data-testid="app-sidebar-scroll-anchor"`
on that wrapper gives the spec a stable selector without coupling to
the shadcn Sidebar internals.

Co-authored-by: Tyler Longwell <tlongwell@squareup.com>
Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
@tlongwell-block tlongwell-block merged commit aeafb0b into main Jun 19, 2026
25 checks passed
@tlongwell-block tlongwell-block deleted the sami/fix-unread-button-traffic-light-overlap branch June 19, 2026 14:12
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