Repository navigation
mac: the header's hairline waits for the transcript to scroll - #295
Merged
Merged
Conversation
§3 draws that rule only once the transcript has scrolled or a pane is open. It was unconditional, so a header with nothing above it still carried a line separating nothing from nothing. The signal was already being measured: publishPosition computes fromTop to decide when to ask for the previous page, and the hairline asks a different question of the same number -- has anything gone under the header yet. One call beside the existing one, not a second measurement. Deliberately NOT onUserScroll, which reports isAtBottom: a long transcript resting at its top is not at the bottom and has scrolled nothing, so that signal would draw the rule immediately on any session with history. The deliverable and side-by-side pages keep their rule unconditionally -- there a pane IS open, §3's other clause -- and a guard asserts that arm never gains the condition. One mutation survived first time round and was worth it: the guard counted `let fromTop = documentView.isFlipped`, while the mutation duplicated the calculation under a new name, which is the realistic drift. It now pins the expression rather than the variable name, and that mutation fails. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SfEX6bfwCGXtThk1JRNmsE
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.
§3: "A hairline appears under the header only once the transcript scrolls or a pane opens." It was drawn unconditionally, so a header with nothing above it still carried a rule — a line separating nothing from nothing.
The signal was already being measured
publishPosition()computesfromTopto decide when to ask for the previous page (onReachTop). The hairline asks a different question of the same number — has anything gone under the header yet — so this adds one call beside the existing one rather than measuring twice.It is deliberately not
onUserScroll. That reportsisAtBottom, which is a different question: a long transcript resting at its top is not at the bottom and has still scrolled nothing. Using it would have drawn the rule immediately on every session with a scrollable history.The guarded expression
onUserScroll(document.height <= visible.height || distance <= 8)is untouched — it is what keeps a streaming row followed.Both of §3's reasons
The conversation page waits for the scroll. The deliverable and side-by-side pages keep their rule unconditionally, because there a pane is open — §3's other clause — and a guard asserts that arm never gains the condition.
Mutation battery, including one that got away
The last one is the useful one. My guard counted
let fromTop = documentView.isFlipped, and the mutation duplicated the calculation asfromTopCopy— a different name, so the regex correctly didn't match and the guard passed. That is also the realistic drift: someone adds a second top-distance under a new name rather than reusing this one. The guard now pins the expression (documentView.isFlipped ? visible.minY - document.minY) instead of the variable name, and the same mutation fails it.Gate
bun test2300/0 exit 0 (2299 on main plus this guard) ·tsc --noEmitexit 0 ·swift testexit 0 · MacxcodebuildBUILD SUCCEEDED · iOSxcodebuildBUILD SUCCEEDED — the Mac build matters here: a new closure is threaded through anNSViewRepresentable'sCoordinator, and CI builds neither app.🤖 Generated with Claude Code
https://claude.ai/code/session_01SfEX6bfwCGXtThk1JRNmsE