Repository navigation
Draw the unread line on load - #90
Merged
Merged
Conversation
The line never appeared. In the commit where ready turned true, the effect that follows the end scrolled to the bottom and the one that notes the scroll position stored the head as read, and the marker, deferred to a microtask, then read back that head. So it was always caught up. The stored mark is now captured on mount, in an effect declared ahead of everything that advances it, and the line is drawn from that capture once the transcript is ready. It is still read after mount, never during render, so the server and client renders still agree, and it is still frozen for the visit. Fixing that surfaced a line on every first visit: with nothing stored the mark is 0, and the divider went above the first item. A line with nothing read above it marks nothing, so it is not drawn there. That rule is pure, in unreadLineBefore, and tested; the effect ordering is not reachable from the node test environment and was checked on the dev server: mark 2 of 4 draws the line before seq 3, no mark draws none, and a message arriving mid-visit leaves the line where it was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
The "New messages below" divider never appeared. In the commit where
readyturned true, the page scrolled to the end and stored the head as read, and the marker, deferred to a microtask, then read back that head. So every visit looked caught up.use-read-marker.ts: the stored mark is captured on mount, in an effect declared ahead of everything that advances it. The line is drawn from that capture once the transcript is ready. It is still read after mount, never during render, and still frozen for the visit.transcript.tsx: with the line working, a first visit (nothing stored, so mark 0) drew it above the first item. A line with nothing read above it marks nothing, sounreadLineBeforedoesn't draw it there.Testing
unreadLineBeforeand the rendered position of the line are unit-tested inapp/components/transcript.test.tsx.npm test,tscand lint are clean.🤖 Generated with Claude Code