Skip to content

Dock the comment composer on narrow screens - #151

Open
jwarwick78 wants to merge 1 commit into
Lex-Inc:mainfrom
jwarwick78:jw/floating-comment-composer
Open

jwarwick78 wants to merge 1 commit into
Lex-Inc:mainfrom
jwarwick78:jw/floating-comment-composer

Conversation

@jwarwick78

Copy link
Copy Markdown

You're deep in a spec. You find the sentence that's wrong. You highlight it, hit Comment, and Roughdraft throws you back to the top of the document to type. Then you go hunt for your place again. Every time.

Under 1100px the review rail is hidden, so the composer stacks above the document. Focusing it drags the scroll container to 0.

So I docked it to the bottom instead.

Now there's nothing to scroll into view. The composer floats over the page, lined up with the text column so it reads like part of the document instead of a window that wandered in. If your highlight would land behind the dock, the page nudges up by the smallest amount that clears it. 100px in the test case. You barely notice.

It sits under the handoff controls in the stack, so "I'm done" stays clickable while a comment is open.

Above 1100px I changed nothing. The anchored rail is good. I left it alone.

One freebie while I was in there: the comment body was bg-white with no dark variant. Invisible before, because it sat on a white panel. Once it became the main surface at narrow widths it lit up like a fridge. One line.

Tests

5 Playwright specs. I reverted the source with the tests in place, and the two that matter fail while the wide-viewport one keeps passing. 6 unit tests on the clearance math. pnpm check and pnpm test:smoke both green. Screenshot guide updated.

Happy long weekend.

Below the 1100px review-rail breakpoint the anchored rail is hidden and
the comment composer stacks above the document. Autofocusing it drags the
scroll container back to 0, so adding a comment deep in a document costs
the reviewer their place.

Render the composer in a fixed dock at the bottom of the viewport instead.
Out of the document flow, focus has nothing to scroll into view. The dock
mirrors the document column's gutter and max width so it reads as part of
the page, and it layers below the fixed review-handoff controls so the
handoff button stays clickable.

When the dock would cover the highlight that was just commented on, scroll
by the smallest amount that clears it rather than jumping to the anchor.
The document also grows bottom padding matching the dock height so a
comment on the last line still has room to clear.

Above the breakpoint the anchored rail is unchanged.

Also fixes a dark-mode regression this surfaces: the banner comment body
used bg-white with no dark variant, which was invisible on a white panel
but obvious once the dock became the primary comment surface.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

@jwarwick78 is attempting to deploy a commit to the Lex Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

1 participant