Skip to content

scrollable_mask: Keep rounded scroll-table corners clean at any scroll offset - #3400

Merged
huacnlee merged 1 commit into
mainfrom
ihavecoke/rounded-frame-cover
Oct 8, 2026
Merged

huacnlee merged 1 commit into
mainfrom
ihavecoke/rounded-frame-cover

Conversation

@ihavecoke

@ihavecoke ihavecoke commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Problem

#3309 rounds the table's first and last rows, which only lines up while the content sits at its unscrolled position. Once a wide table scrolls horizontally, gpui's rectangular content mask slices the clipped side square into the frame's rounded corner notches — the known limit noted in #3309.

Fix

Add RoundedFrameCover, a sibling overlay (like ScrollableMask) pinned to the viewport: it fills each corner notch — inside the frame's rect corner, outside the border arc — with a backdrop color, so the frame reads as a rounded clip at every scroll offset. The frame's own border paints after its children, so it stays crisp on top of both the scrolled content and the covers; nothing is repainted.

horizontal_scroll_area installs the cover from the caller style's corner radii, so markdown tables get it automatically. The element is exported from gpui-base — RoundedFrameCover::uniform(radius), .backdrop(color), .frame_border(width) — so application frames with their own rounded scroll viewports can reuse it; frame_border grows the notches out to the border box when the cover is a child of the bordered element itself.

Before

image

After

image

Test

  • corner_notch_paths_stay_inside_their_corner_squares pins the notch geometry: each path tessellates to an r-sized square anchored at its frame corner.
  • cargo nextest run -p gpui-base scrollable_mask — 17 passed.
  • cargo clippy -p gpui-base --locked -- --deny warnings / cargo fmt -- --check — clean.
  • Verified end-to-end in a consuming application via a local patch: markdown tables and an application-owned scrollable card keep rounded corners through horizontal scrolling.

A horizontally scrolled table clips with gpui's rectangular content
mask, so content poked square into the frame's rounded corner notches
once it scrolled — #3309 rounds the rows themselves, which only covers
the unscrolled position. Paint a RoundedFrameCover sibling over the
viewport: it fills each corner notch with the backdrop color, and the
frame's own border, painted after children, stays crisp on top.

The cover is exported from gpui-base so application tables with their
own rounded scroll frames can reuse it.
@ihavecoke ihavecoke changed the title text: Keep rounded scroll-table corners clean at any scroll offset scrollable_mask: Keep rounded scroll-table corners clean at any scroll offset Oct 8, 2026
@ihavecoke
ihavecoke marked this pull request as ready for review October 8, 2026 02:09
@huacnlee
huacnlee merged commit 72ec173 into main Oct 8, 2026
16 checks passed
@huacnlee
huacnlee deleted the ihavecoke/rounded-frame-cover branch October 8, 2026 03:04
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.

2 participants