Skip to content

Have a card's room and the New reply placement re-read their distance as the page glides - #6908

Merged
max-sixty merged 2 commits into
mainfrom
glide-survives-layout
Nov 23, 2026
Merged

max-sixty merged 2 commits into
mainfrom
glide-survives-layout

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Two glides still aimed at a distance measured once: the comment card's room-making glide (makeRoom) and the thread card's glide that brings the user's turn into sight above New reply (#fitAnswer). With scroll anchoring held off during glides since #6904, layout that changed during the glide left each short: a card opening under its passage during a landing's glide got 150px less room than it asked for when 150px grew above the passage, and the turn ended 140px under New reply when a message above it grew 150px. makeRoom also replaced the landing's glide with a numeric one, dropping the landing's aim.

Now a glide keeps its base (where its landing puts the box, or the offset asked for) apart from one placement distance (glideBy), which it reads with the box at the base at each frame. A later landing clears the placement, a later placement replaces it, and makeRoom re-reads what the card stands clear of (attachmentClearance, split out of commentAttachment so a frame scans no margin rows) through a function that answers false once the card closes.

To weigh: a placement whose goal clamps at the box's end still leaves the box to it when a keeper asks for the end, as a landing's glide already did.

Max asked for this after #6904. Tests: the new cases in test_glides.py and test_card_reply.py fail on main in Chromium and Firefox and pass here; scrolling.test.mjs covers the base and placement arithmetic.

This was written by Claude Code on behalf of max-sixty

… as the page glides

Two glides still aimed at a distance measured once, so layout that changed during the
140 ms glide left them short. A comment card opening under its passage while a landing
glided made its room by replacing the landing's glide with a glide to the landing's
goal plus the room, which also dropped the landing's aim: with 150px grown above the
passage as the page glided, the card had 150px less room than it asked for, and 80px
less where the passage itself grew by 80px, in Chromium and Firefox. The thread card's
glide that brings the user's turn into sight above New reply left the turn 140px under
New reply when a message above it grew by 150px during the glide. Since #6904 holds
scroll anchoring off while a glide moves its box, anchoring no longer made up either
move.

A glide now keeps its base, where its landing puts the box or the offset a glide toward
a distance asked for, apart from one placement distance on top of it. At each frame the
landing reads the page with the box at the base, so a nearest landing doesn't take the
placement's distance for its own, and the placement (`glideBy`) reads its distance with
the box at the base as the box can now stand and adds it there. A later landing clears
the placement, a later placement replaces it, and it ends once it reads null.
`makeRoom` takes a function that re-reads what the card stands clear of
(`attachmentClearance`, split out of `commentAttachment` so a frame reads no margin
rows), which thread-preview.js answers with false once the card's session ends and null
while the subject isn't drawn, which asks for no move until it is. It joins any glide
holding the box (`gliding`), even one whose room asks for no move yet. The New reply placement glides
by `glideBy` too, reading the card's scale with the rest.

Codex reviewed four rounds. The first version wrapped the landing's aim in each
placement's, which kept a removed subject's or a closed card's room, let a glide toward a
distance keep room it no longer needed, and tracked the subject's top rather than its
attachment. Left as it was: a placement whose goal clamps at the box's end leaves the
box to it when a keeper asks for the end, as a landing's glide does.

Tests: the new room cases in test_glides.py (growth above the passage, of the passage,
and above a passage briefly not drawn) and the new card case in test_card_reply.py fail on main in Chromium and
Firefox and pass here. scrolling.test.mjs covers glideBy after a landing's glide, a
glide toward a distance and from rest, room given back, a placement whose subject
leaves, a nearest-style landing, and a box that shrinks under the glide.
@max-sixty
max-sixty merged commit 518385b into main Nov 23, 2026
6 checks passed
@max-sixty
max-sixty deleted the glide-survives-layout branch November 23, 2026 23:06
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.

2 participants