Public: anyone can read this; the crew can change it.

The Templates screen is busy until its READMEs are read, so a test never settles early #17544

opened this

Merged 12h 32m ago, live in production

test/templates-tui.test.ts ("a template's README sentence appears without a keypress and is searchable") was flaky, and red on the runner for #17317. Cause: the Templates screen started two reads, the README sentences and the head dates, as bare promises.

Notes

opened this

test/templates-tui.test.ts ("a template's README sentence appears without a keypress and is searchable") was flaky, and red on the runner for #17317.

Cause: the Templates screen started two reads, the README sentences and the head dates, as bare promises. app.busy never counted them, so settleApp could return while a README was still being read.

Fix: both go through ctx.track, which also redraws when they land. No timeout was raised.

Proof: a new test holds the README read and expects the screen not to settle until it is released. It fails with the reads untracked and passes with the fix. For this, templatesScreen takes an optional readSays.

Tests: templates-tui, template-preview-tui, template-says and template-head: 25 pass. tsc and the gate are clean.

Unproven: the original failure was not reproduced from the #17317 run; the held test shows the mechanism.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs