Skip to content

Write the widget-era html width without viewport units - #4074

Merged
paoloredis merged 1 commit into
mainfrom
DOC-7092
Sep 23, 2026
Merged

paoloredis merged 1 commit into
mainfrom
DOC-7092

Conversation

@paoloredis

@paoloredis paoloredis commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

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 html sizing without dvw units that the widget rewrites.

The html[q-docked-target]:not([q-docked]) rule now uses calc(var(--qdvw) + var(--q-docked-viewport-offset)) instead of 100dvw for width/min-width/max-width. The widget’s docking.js replaces every vw/dvw in stylesheets with calc(1 * var(--qdvw)) (where --qdvw is already 100dvw minus scrollbar width N), so the old 100dvw rule made html N 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-docked is not set.

Reviewed by Cursor Bugbot for commit 7afa1ad. Bugbot is set up for automated code reviews on this repo. Configure here.

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>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 5 related items from repository history (5 new this commit):

Memory updated at 7afa1ad

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

DOC-7092

@paoloredis

Copy link
Copy Markdown
Collaborator Author

This fixes the scrollbar issue

@mich-elle-luna mich-elle-luna left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@paoloredis
paoloredis merged commit 8b12079 into main Sep 23, 2026
191 of 193 checks passed
@paoloredis
paoloredis deleted the DOC-7092 branch September 23, 2026 07:48
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>
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.

3 participants