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

A loading terminal screen holds its own keys until load settles, and every load awaits its first read #17529

opened this

Merged 13h 14m ago, live in production

The Dependencies screen dropped f (main's red, 2026-12-02). Its load() started the lockfile read and returned at once, so the app called it settled while it said "Reading the lockfiles…", and a key then hit a screen with nothing to act on. A person typing fast meets the same thing.

Notes

opened this

The Dependencies screen dropped f (main's red, 2026-12-02). Its load() started the lockfile read and returned at once, so the app called it settled while it said "Reading the lockfiles…", and a key then hit a screen with nothing to act on. A person typing fast meets the same thing.

  • The class, in one place (app.ts): while the top screen's load() runs, a key that screen binds is held and replayed in order once load() settles. That covers screens that await correctly too (boards, jobs, runlog…), which used to get keys mid-read. The globals (back, quit, the palette) still answer at once, so a slow screen can be left, and what it held goes with it.
  • The sweep: of 73 load() bodies under src/tui/screens/, one dropped its first read, Dependencies. Its load() now awaits the read, and its re-reads go through ctx.track (the same change as fix/dep-accept-keys, a4c82efad, so the two merge cleanly). Displays reads its first rows, then the rest "behind the screen", on purpose.
  • The rule: test/tui-load-awaits.test.ts reads every screen and refuses, at the top level of a load() body, a void <call> or a bare call of a local function that starts a promise and drops it. It allows work the comment above says runs behind the screen. Against main's Dependencies screen it names again();.
  • test/tui-load-holds-keys.test.ts: a bound key pressed during a slow load reaches the screen after it, in order, with what load read (it fails on main's app.ts), and q leaves the loading screen and drops its held keys.

Try: in the terminal, open a repository's Dependencies and press f before the report shows: it waits, then answers. No door: the terminal's own key handling; no page or screen is added. Direction: a key a person presses is never lost (#17221).

Co-Authored-By: Claude Fable 5 <[email protected]>

🤖 Generated with Claude Code

Sign in to join this conversation.

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

Keyboard shortcuts

Docs