Repository navigation
fix: keep the full width beside a closed comments list - #294
Open
hardikg2907 wants to merge 1 commit into
Open
hardikg2907 wants to merge 1 commit into
hardikg2907 wants to merge 1 commit into
Conversation
On frame ready the app asks the frame to make room for a panel that covers 0 pixels. roomFor still computed a shift whenever a body child ended past innerWidth: a sub-pixel frame width (at a browser zoom other than 100 %), or a child wider than the frame. With a full-width child there is no left margin to move into, so roomFor returned null, the frame reported crowded, and the app added a 392 px margin while the list was closed. With no panel nothing is covered, so roomFor now returns 0, as its own contract says for a panel that covers margin only.
hardikg2907
requested review from
anuragrao04 and
razvi-razorpay
as code owners
November 18, 2026 11:32
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.
What and why
Closes #293.
On some documents the app keeps a 392 px margin beside the document while the Comments list is closed, so an empty strip the size of the list shows at the right.
On frame ready the app asks the frame to make room for a panel that covers 0 pixels.
roomForinfrontend/bridge/bridge.tsstill computed a shift whenever a direct body child ended pastinnerWidth:innerWidthis a whole number, the child's rect is not, andceil(0.5)is 1;When a full-width child (for example a sticky header) leaves no left margin, the shift cannot fit, so
roomForreturnednull. The frame then postedcrowded: true, and the app addedlg:mr-[392px]. It keeps that until the list opens and closes.The fix is one line at the top of
roomFor: with no panel nothing is covered, so it returns 0, as its own comment says for a panel that covers margin only. This PR changes only this cause. The app side and the rounding inroomForare unchanged.Note, not changed here:
onCrowdedindoc-workspace.tsxaccepts acrowdedreply at any time. A reply sent while the list was open but delivered after it closed would still add the margin. I have not seen this happen.How it was tested
frontend/e2e/document-layout.spec.ts, next to "a document with no margin to spare makes room beside the comments list": a document with a full-width header and a block ofcalc(100vw + 40px), at 1440 × 900, with the list closed, keeps the full frame width.Expected: 1440, Received: 1048(1440 − 392).document-layout.spec.tspasses (13 tests, including the existing crowded-with-list-open case).npm test(1308 tests),npm run lint,npm run format:checkandnpm run buildpass.Checklist
make lintandmake testpass locallyREADME.md,docs/,.env.example, chartvalues.yaml) if behaviour or configuration changed