Repository navigation
Keep the API rail scrollbar clear of code examples - #4948
Conversation
Co-Authored-By: Codex <[email protected]>
| flex: 0 1 auto; | ||
| min-height: 0; | ||
| overflow-y: auto; | ||
| scrollbar-gutter: stable; |
There was a problem hiding this comment.
Severity: P3 (Low)
Safari 16.2–18.1 ignores scrollbar-gutter, so with macOS “Show scroll bars” set to “Always,” the cards still narrow when the desktop rail starts overflowing. Add a fallback for browsers that lack the property if the rail is meant to keep a stable width across the supported browser range.
Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
There was a problem hiding this comment.
No change. Safari 18.2 and later support scrollbar-gutter. In older Safari the padding-inline-end: 12px still keeps the cards clear of the scrollbar, because classic scrollbars take layout space and overlay ones sit in the padding. The only difference is that the cards narrow by one scrollbar width when the rail starts to overflow. That happens only in windows too short for the chips and captions, so a fallback would add CSS for a cosmetic shift in a rare case.
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4948/ |
… by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
| scrolls: panel.scrollHeight > panel.clientHeight, | ||
| clearance: Math.round(visibleRight - card.getBoundingClientRect().right), |
There was a problem hiding this comment.
Severity: P3 (Low)
This check would still pass with scrollbar-gutter: stable removed: an overflowing rail already reserves space for a classic scrollbar, and the padding still supplies the measured gap. Also check that card width stays stable when the scrollbar appears, or assert the computed gutter if the runner uses overlay scrollbars.
Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
There was a problem hiding this comment.
No change. You're right that the test does not pin scrollbar-gutter. Testing it would mean forcing classic scrollbars in headless Chrome, which hides them by default. That is a fragile setup for one declarative CSS line, and the padding assertion already covers the overlap this PR fixes. The gutter only keeps the card width from shifting when the rail starts to scroll, which is cosmetic.
…by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…view by @infra-vault-gh-plugin-prod) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
| response card clear of the scrollbar: False | ||
| """ |
There was a problem hiding this comment.
Severity: P3 (Low)
The stacked-layout snapshot treats any gap under 12px as full width, so it would still pass if the stacked panel gained an 8px right inset. Check that the panel’s inline-end padding is zero (or assert the expected edge offsets within a rounding tolerance) so the test actually guards against extra spacing.
Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
Keep the API reference rail's scrollbar clear of the code example cards.
Affects: API reference, Site UI
Prompt summary: Add space for the scrollbar in the API docs' right rail. The scrollbar currently overlaps the code examples.
Why
In shorter desktop windows, the examples panel scrolls beside the article. Its cards extend to the panel's edge, where an overlay scrollbar can cover them.
What
Reserve scrollbar space
The examples panel reserves a stable scrollbar gutter. The cards keep a consistent width when a regular scrollbar appears.
Keep overlay scrollbars clear
A 12px inset separates the cards from the panel's right edge. Overlay scrollbars use this space because they do not reserve a CSS gutter.
Limit the spacing to the desktop rail
The spacing applies inside the existing desktop media query. The stacked mobile layout keeps its current spacing.
Verify
Open
/api/doc/elasticsearch/operation/operation-searchin a desktop window and reduce its height until the examples panel scrolls. Check that the scrollbar stays clear of the cards, then check that the mobile layout has no additional right inset.Check on the preview
Validation: Frontend tests, production asset build, formatting, and the focused browser spacing check pass. The local API operation page responds successfully and serves the gutter rule. Full visual comparisons are incomplete; baseline generation was stopped when it began cloning the full set of documentation repositories.