Review follow-up: a scroll restore that never ran, and six smaller lies - #17
Merged
Conversation
The largest one first: both deferred scroll restores were dead code. A ScrollPane keeps its vvalue across a children swap by itself, so the capture-and-restore-a-pulse-later never fired -- instrumented, the rail's guard saw 0.5 where it needed 0.0 and skipped every time, and SkimView's either skipped or restored 0.0 onto 0.0. Both carried comments claiming to protect the reader's place, and the two tests written for the rail pass on the ScrollPane's own behaviour. Removed, along with the rebuild parameter that existed only to steer it; the tests stay as a guard that the position keeps surviving, with comments that say who actually does it. The rest: - searchText expanded the rail and immediately asked for focus, which is dropped while the field is out of the scene graph. The same trap the slash key was fixed for; the one caller that predates the fix. - Each rail collapse started a Timeline without stopping the last one, so a collapse overtaking an expand let the expand's onFinished swap the full content into a 46px strip with no way out. Reachable now that the width listener drives this on a resize drag. - Dropping a repeated signature line dropped its changed-line marker with it, so a member whose declaration changed was tagged "changed" and then shown a body with nothing highlighted. - Keeping the open file's row suppressed the rail's "no file here matches" message: one row that looked like a hit, beside a footer reading 0 matches. - A failed preference save left the checkbox showing a value that is not on disk, and required toggling twice to retry. - saveAsync writes the whole record and has no production callers left; it is package-private now so a future one cannot reset a field with it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Follow-up to #14, from a code review that landed after it was merged. Seven findings, all real; the first is the one worth reading.
The scroll restores were dead code
Both
SearchRail.rebuildandSkimView.rebuildcaptured the scroll position, cleared their children, and restored it a pulse later behind anif (vvalue == 0)guard. Instrumented, that guard never passes:A
ScrollPanekeeps itsvvalueacross a children swap by itself, so the position was never lost and the restore never ran. Both sites carried comments claiming to protect the reader's place, and the two tests written for the rail in #14 pass on the ScrollPane's own behaviour rather than on the mechanism they were written for.Removed, along with the
rebuild(boolean restoreScroll)parameter that existed only to steer it. The tests stay — they still guard the observable behaviour — with comments that name who actually delivers it.The other six
searchTextexpanded the rail and immediately asked for focus. While collapsed the query field is out of the scene graph, and expanding only puts it back when the 160ms animation finishes, so the focus was dropped. Exactly the trap/was fixed for in The Explorer stops fighting the reader #14; this caller predates that fix. Reachable on any window under the new 1100px threshold.Timelinewithout stopping the previous one, and only the expand direction had anonFinished. A collapse overtaking an expand let the expand's finish swap the full content back in after the width had gone to 46px — with no ⌕ to get out of it. The Explorer stops fighting the reader #14 made this reachable by driving collapse fromwidthProperty().· changed, pre-expanded, and then shown a body with nothing highlighted.0 matches.saveAsyncwrites the whole record and has no production callers left. Package-private now, so a future caller cannot use it to reset a field — the exact bugupdateAsyncexists to prevent.Verification
1295 tests, 0 failures, on top of current
main.Two pre-existing tests were corrected rather than accommodated: the signature-dedupe test's fixture happened to mark the signature line itself as changed, which the marker fix now legitimately keeps.
🤖 Generated with Claude Code