Repository navigation
Stop scrollbars appearing and disappearing across the console - #339
Merged
Merged
Conversation
A classic scrollbar changes the content box when it appears, which can rewrap the content taller, pull the neighbouring axis over its threshold and make the bar vanish again. The console now has one thin scrollbar look, and every vertical scroll container reserves its gutter, so an overflow change cannot reflow anything beside it. Tab strips no longer show a bar at all. The server view strip was overflow-x-auto, so a narrow window grew a horizontal bar inside the bar and changed its height; it now uses the scroll-strip utility, which scrolls but never draws a bar. Tabs no longer shrink or wrap, so the strip height cannot change with the window, and the selection indicator sits on the strip's inner edge where the hidden overflow cannot clip it. The indicator also re-measures from a ResizeObserver on the strip instead of window resize, so a sidebar collapse or a zoom change no longer leaves it parked under the previously selected tab.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the choppy behaviour caused by scrollbars toggling, and removes them from surfaces that should never show one.
Why it flickered
A classic scrollbar is ~17px. When content crosses the overflow threshold the bar appears, the content box narrows, text rewraps taller — which can push the other axis over its threshold and pull the bar back out. Each toggle reflows the layout, so the sequence repeats.
Measured in the browser against the built CSS, before/after on a container whose content toggles 299px ↔ 301px:
What changed
One scrollbar look, and a thin one.
app.csssetsscrollbar-width: thinand a Carbon thumb colour globally, with a::-webkit-scrollbarfallback for browsers without the standard properties.Vertical scrollers reserve their gutter. A single
:where(.overflow-y-auto, .overflow-y-scroll, .overflow-auto)rule appliesscrollbar-gutter: stablewherever Tailwind's overflow utilities are used, so nobody has to remember a class.overflow-x-autotable wrappers are deliberately not matched, so tables are not inset.Tab strips never show a bar.
CarbonTabsand the bits-ui tab list now use ascroll-striputility (overflow-x: auto; overflow-y: hidden; scrollbar-width: none). The server view strip hadoverflow-x-auto, so a narrow window grew a horizontal bar inside the bar and changed its height; that class is gone from the page and from Settings.Tabs cannot shrink or wrap, so the strip height is constant. Measured with 12 tabs at 600px and at 380px: strip height 41px in both,
scrollbar-width: none, overflow present.The selection indicator stays inside the strip. It was at
bottom-[-1px], which the strip's hidden vertical overflow would clip; it now sits on the strip's inner bottom edge, exactly over the selected tab's 2px border.The indicator re-measures from a ResizeObserver on the strip instead of
window.resize. A sidebar collapse, a zoom change or a badge appearing changes the strip's layout without firing a window resize, which left the indicator parked under the previously selected tab. Verified in the running console: after a CSS zoom to 1.15 the indicator tracked the tab (left 181px, button left 181px).Verification
svelte-check0 errors/0 warnings,bun run test63 pass, knowledge-lint 10/10.CarbonTabs.test.ts(strip utility present, tabs shrink-0 + nowrap, indicator not clipped) andscrollbar-policy.test.ts(thin global scrollbars, gutter rule, strip utility, opt-out utility, WebKit fallback).