Skip to content

fix: the TUI tour gif stops racing its own workers - #213

Merged
vicenteliu merged 2 commits into
mainfrom
fix/gen-tui-gif-race
Sep 1, 2026
Merged

fix: the TUI tour gif stops racing its own workers#213
vicenteliu merged 2 commits into
mainfrom
fix/gen-tui-gif-race

Conversation

@vicenteliu

Copy link
Copy Markdown
Owner

What

scripts/gen_tui_gif.py health check: three defects fixed, artifact regenerated.

  1. Frame-capture race (the real one). Every TUI command runs as a @work(thread=True) worker, but frames were captured after a fixed per-command sleep. A verification run shipped a /wiki list frame containing only "listing wiki pages…" — the results arrived one frame later. Capture now awaits app.workers.wait_for_complete() + a 0.2s render flush; the per-command settle column is gone from TOUR.
  2. Phantom 80-col wrapping. Headless, the app's Rich console defaults to 80 cols and RichLog measures content against it — so /help descriptions and /kb list rows wrapped even though they fit the 110-col terminal (visible in the previously committed gif). The script now sets console.width to the terminal width. Real ttys never hit this.
  3. Silent Chrome failures. Missing binary → bare FileNotFoundError; render failure → stderr swallowed by capture_output. Now: upfront existence check with a clear message, and stderr surfaced in the raised error.

Verification

  • Script run end-to-end twice post-fix; all 5 frames inspected visually.
  • /wiki list frame reliably contains the wiki table; /help and /kb list no longer wrap.
  • Regenerated docs/assets/tui.gif keeps the exact original geometry (1341×731, 5 frames, 110×30 terminal).
  • ruff check + format clean; the one mypy import-untyped note is pre-existing and CI only type-checks src/.

Out of scope, tracked separately

/kb list shows 6 of 11 docs titled doc-meta (KB fixture metadata listed as documents) — TUI/KB layer issue, filed as a separate issue.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KXrF6HMB12V1hC9xFtooDE

Three defects in scripts/gen_tui_gif.py, found by re-running it against
the current TUI:

- Frames were captured after a fixed per-command sleep, racing the
  @work(thread=True) workers that actually produce the output; one run
  shipped a /wiki list frame with no wiki list in it. Capture now waits
  on app.workers.wait_for_complete() plus a short render flush, and the
  magic settle column is gone from TOUR.
- Headless, the app's Rich console defaults to 80 cols, so RichLog
  wrapped lines that fit the 110-col terminal (visible in the committed
  gif: /help descriptions and /kb list rows). The script now aligns
  console.width with the terminal size.
- Chrome failures were silent: a missing binary raised a bare
  FileNotFoundError and render errors swallowed stderr. Now there is an
  upfront existence check and stderr in the raised error.

docs/assets/tui.gif is regenerated with the fixed script; geometry is
unchanged (1341x731, 5 frames).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KXrF6HMB12V1hC9xFtooDE
@vicenteliu

Copy link
Copy Markdown
Owner Author

CI is failing at the Install step on every job — repo-wide breakage, not this PR: lancedb 0.5.x no longer exists on PyPI. Tracked in #215; re-run checks once that lands.

@vicenteliu
vicenteliu merged commit a98ee05 into main Sep 1, 2026
4 checks passed
@vicenteliu
vicenteliu deleted the fix/gen-tui-gif-race branch September 1, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant