Skip to content

tab: Add optional overflow edge fades - #3379

Closed
ihavecoke wants to merge 1 commit into
mainfrom
fix/tab-bar-edge-fade
Closed

ihavecoke wants to merge 1 commit into
mainfrom
fix/tab-bar-edge-fade

Conversation

@ihavecoke

@ihavecoke ihavecoke commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Overflowing tab rows can now fade their clipped ends into the surrounding surface. Fades appear only where tabs are hidden and leave fixed controls and pointer events intact.

 TabBar::new("document-tabs")
     .outline()
+    .with_edge_fade(cx.theme().background)

Changes

  • Read scroll offset and actual first/last tab bounds during paint, including the first layout and explicit reveals.
  • Exclude the trailing spacer from overflow hints and keep prefixes, suffixes and menus clear.
  • Document the opt-in API in English and Chinese.

Evidence

  • Before: tabs and outlines ended abruptly at the scroll viewport.
  • After: all 13 TabBar tests pass, including edge visibility, resizing, explicit reveals and clicks beneath fades.
  • cargo clippy -p gpui-component --all-targets --no-default-features -- -D warnings passes.
  • cargo +nightly fmt --all -- --check passes.
  • Allsum integration: UI consistency checks, compilation and all 620 Allsum tests pass.

Public API

gpui-component

TabBar::with_edge_fade(self, color: impl Into<Hsla>) -> Self: optionally fade overflowing tab edges into the supplied surface color. Existing callers retain their current appearance.

Context

The preview toolbar needs a visible hint that more document tabs can be reached by scrolling. Implementation, tests and documentation were AI-assisted.

Merge Danger

Door: two-way

Blast Radius: tabs

The effect is opt-in; no data or migration changes.

Offer opt-in edge fades on TabBar so callers can reveal hidden tabs without hard clipping. Read tab bounds during paint to follow layout, manual scrolling and explicit reveals in the same frame, excluding trailing empty space and fixed controls.
@ihavecoke
ihavecoke force-pushed the fix/tab-bar-edge-fade branch from 38620c2 to acf7fff Compare October 6, 2026 10:17
@ihavecoke ihavecoke closed this Oct 6, 2026
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