Repository navigation
test(app): parse the whole note before checking live preview's widgets - #57
Merged
Merged
Conversation
CodeMirror's first parse stops after 20 ms (Work.Apply) and finishes in idle time. On a busy CI runner the tree could end before the note's list, so 'draws every kind of widget in a note' found the tag on line 3 but no bullet on line 14. open() now forces the full parse first. Shrinking the parse budget (a fast Date.now) reproduced the CI failure exactly; with this change the test passes under it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
4 tasks done
bketelsen
pushed a commit
that referenced
this pull request
Nov 23, 2026
frostui v0.10.1 scrolls an Info dialog's body under its fixed title and Close button (frostyard/frostui#51, #57). The Conflicts dialog lists one row per flagged file with no height of its own: on v0.10.0 a long list ran below a 1280x800 window, out of reach. TestConflictsDialogScrollsAt1280x800 opens it with 40 conflicts and scrolls with the wheel until the last file is in view below a fixed Close; on v0.10.0 the dialog is 1632 DIPs tall and the test fails. TestShortcutsDialogScrollsAt1280x800 checks that Keyboard shortcuts, which keeps its own 420-DIP scroll box, still scrolls to its last row inside the new scrolling body. About is short and needs no check. go-sources.json (make flatpak-sources) and AGENTS.md follow the bump. Co-authored-by: frostyard-machines <[email protected]>
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.
Fixes the flaky
src/app/preview.test.tsx > live preview > draws every kind of widget in a note. It failed in CI on #49 (af142bc) and #56 (a138f77) withexpected .cm-pv-bullet to have a length of 1 but got 0at line 84, while the same tree passed on other runs.Cause
CodeMirror's first parse of a document has a 20 ms budget (
Work.Applyin@codemirror/language), and the rest is parsed in idle time 100–500 ms later. On a busy CI runner, with the whole suite in parallel on 4 vCPUs and the failing test taking 800–1000 ms, the first tree could end before the note's list on line 14. Live preview then drew the tag, inline code and footnote on line 3, but no bullet yet, and the test looked before the idle parse arrived.I reproduced it: making
Date.nowrun fast, so the first parse is cut short, fails the test exactly as CI did. The tag, code and footnote assertions pass and the bullet gets 0.Fix
The test's
open()now forces the whole note's parse (forceParsing(view, doc.length, 10_000)inact) before any assertion. Live preview redraws on the new tree, so the synchronous checks see every widget. With this change the test passes under the forced short parse. The app is unchanged: in a browser, the end of a long note simply draws a moment later.make ui-check: 94 files and 772 tests pass. Biome's one warning is an existing one insrc/spike/drive.tsx.🤖 Generated with Claude Code