Repository navigation
Keep margin thread reading stable after a streaming interjection - #4865
Conversation
Exercise the streaming-interjection test with a scrollbar that takes room on every host, and include transcript scroll, content height, viewport height and gutter width in its failure. Both accepted and pending cases still fail on current main: the first token update clamps scrollTop from 11 to 0 as the transcript grows to fit its contents, moving every message down 11px while the card stays at 8px. This is a reproduction, not a repair; the reading-stability assertion remains intact. Refs #4863
leaf-agent
left a comment
There was a problem hiding this comment.
The runtime repair remains the merge blocker, as the description states. Both focused cases (accepted and pending) fail at append_tokens(8): message tops move from [10, 111, 191] to [21, 122, 202] while the card stays at 8px and transcript scrollTop clamps from 11 to zero. This confirms the reproduction, but leaves the reading-stability failure in #4863 unresolved. Withholding the merge verdict until that repair is included.
# Conflicts: # dist/kernel/kernel.json
leaf-agent
left a comment
There was a problem hiding this comment.
The current head fails test because check:browser reports a stale dist/kernel/kernel.json. I reproduced that failure locally; rebuilding changes the vendored chunk paths and hashes in the manifest, and the browser build check then passes. I’m applying that generated-file repair on this bot-authored branch before handing the new head to its queued review.
Keep a margin thread's messages at their reading position when more words arrive after the user sends an interjection. The card grows down while retaining the transcript's existing scroll travel, and follows its tail after fitting. The reproduction keeps classic scrollbars explicit and preserves its original stability assertions.
Send can legitimately leave earlier lines scrolled away: the failing baseline has 320px of content in a 309px transcript, at
scrollTop: 11. Previously, arriving tokens expanded the transcript to its full content height, clamping that scroll to zero and moving every message down 11px. Fitting now retains the reading taken before the update. The placement owner supplies whether the attachment moved, and CardAnchor supplies whether the user is writing, so scrolling into more room and growing a draft retain their existing behavior. Newer input invalidates an earlier saved reading.The on-screen states covered are the card immediately after Send, arriving words after that interjection (accepted and pending), reading back through a longer answer, a card gaining room after page scrolling, and the next draft. A catalogue state also exercises an interjection and arriving progress through the delivery contract. Its before/after captures are unchanged at rest; the streaming regression checks message positions across captured frames. The kernel is rebuilt.
Validation: 11 focused margin-card cases, both pending-reply smoke cases, and all 717 runtime tests pass.
pnpm run check:browserand the changed files' pre-commit checks pass. The two streaming cases failed before the runtime repair with the recorded 11px movement. Current main is merged into this branch.Startup comparison against main on
review-a-plan: both arms load 36 requests through widget upgrade and first state presentation; the repair adds 691 code bytes, with no console errors or recorded layout shifts. The added code preserves the reading during live card fitting; it adds no startup requests.Closes #4863