Write the widget-era html width without viewport units - #4074
Merged
Merged
Conversation
The Qualified widget's docking.js rewrites every vw/dvw unit in the page's stylesheets into calc(1 * var(--qdvw)), where --qdvw is 100dvw minus the scrollbar width N it measured. The full-width rule from DOC-7044 used width: 100dvw on html, so after the rewrite html was N pixels short of the window. Two visible effects for every visitor with classic scrollbars: a white N-pixel band at the window edge with body's scrollbar sitting inboard of it, and, because the swap from root scroller to body scroller happens ~0.5-2s after every page load, the centered layout shifting ~8px left on every navigation ('the scroll bar disappears and reappears with a jump'). Express full width as the sum of the widget's own variables, var(--qdvw) + var(--q-docked-viewport-offset), which is exactly 100dvw and contains nothing the rewriter touches. Verified on the live pages in Chrome and Firefox at 1200px and 2200px windows: html and body span the full window, body's scrollbar lands precisely where the root scrollbar was and is draggable there, and main, sidebar and heading keep the same pixel positions across the widget takeover. Docked-panel geometry is untouched (rule is scoped to :not([q-docked])). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
Contributor
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at 7afa1ad |
Contributor
Collaborator
Author
|
This fixes the scrollbar issue |
EliShteinman
added a commit
to EliShteinman/docs
that referenced
this pull request
Sep 24, 2026
Qualified-widget html width rewritten from 100dvw to --qdvw + viewport offset to stop scrollbar gap and layout jump. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The Qualified widget's docking.js rewrites every vw/dvw unit in the page's stylesheets into calc(1 * var(--qdvw)), where --qdvw is 100dvw minus the scrollbar width N it measured. The full-width rule from DOC-7044 used width: 100dvw on html, so after the rewrite html was N pixels short of the window. Two visible effects for every visitor with classic scrollbars: a white N-pixel band at the window edge with body's scrollbar sitting inboard of it, and, because the swap from root scroller to body scroller happens ~0.5-2s after every page load, the centered layout shifting ~8px left on every navigation ('the scroll bar disappears and reappears with a jump').
Express full width as the sum of the widget's own variables, var(--qdvw) + var(--q-docked-viewport-offset), which is exactly 100dvw and contains nothing the rewriter touches. Verified on the live pages in Chrome and Firefox at 1200px and 2200px windows: html and body span the full window, body's scrollbar lands precisely where the root scrollbar was and is draggable there, and main, sidebar and heading keep the same pixel positions across the widget takeover. Docked-panel geometry is untouched (rule is scoped to :not([q-docked])).
Note
Low Risk
Single scoped CSS change for third-party widget compatibility; no auth, data, or core app logic.
Overview
Fixes Qualified chat widget layout glitches when the panel is closed by expressing full-width
htmlsizing withoutdvwunits that the widget rewrites.The
html[q-docked-target]:not([q-docked])rule now usescalc(var(--qdvw) + var(--q-docked-viewport-offset))instead of100dvwfor width/min-width/max-width. The widget’sdocking.jsreplaces everyvw/dvwin stylesheets withcalc(1 * var(--qdvw))(where--qdvwis already100dvwminus scrollbar width N), so the old100dvwrule madehtmlN pixels too narrow, left a gap at the window edge, moved the body scrollbar inboard, and caused a visible ~8px horizontal jump when the widget took over scrolling after load.The new expression equals true full viewport width but uses only widget variables the rewriter does not touch. Docked-open geometry is unchanged because the rule still applies only when
q-dockedis not set.Reviewed by Cursor Bugbot for commit 7afa1ad. Bugbot is set up for automated code reviews on this repo. Configure here.