Skip to content

fix(cli): clean up interactive terminal transitions - #1582

Merged
aidenybai merged 2 commits into
mainfrom
codex/dedupe-tui-cancel-footer
Aug 5, 2026
Merged

fix(cli): clean up interactive terminal transitions#1582
aidenybai merged 2 commits into
mainfrom
codex/dedupe-tui-cancel-footer

Conversation

@aidenybai

@aidenybai aidenybai commented Aug 5, 2026

Copy link
Copy Markdown
Member

Why

Two adjacent interactive transitions left the terminal in the wrong state:

  • Ctrl-C correctly suppressed the duplicate completed-scan footer, but clearing the active Ink renderer also erased the final score and results from terminal history.
  • In large workspaces, project selection rendered inline at viewport height, so selector rows entered scrollback and remained above scanning after submission.

After: project selection is disposable, while scan results are durable. Choosing a project restores the normal terminal before scanning; cancelling a completed report keeps its final score/results visible and appends exactly one cancellation footer.

Product brief:

  • Job: let an interactive CLI user select a workspace target and later cancel without leaving setup UI behind or losing the result they were reviewing.
  • Change: isolate only project selection in the terminal's alternate screen and preserve the final report on normal terminal history.
  • Reuse: use Ink's existing alternateScreen, active-renderer lifecycle, and idempotent disposal instead of introducing another renderer or output mode.
  • Metric: record the affected selector cohort with tui.project_select_shown; retain the existing tui.cancelled counter for cancellation behavior.
  • Compatibility: patch changeset only; no flags, config, report schema, score, package API, or GitHub Action behavior changes.
  • Kill signal: revert if interactive cancellation/error telemetry rises after release or the PTY regressions stop proving a disposable selector and durable final report.

What changed

  • render project selection on a disposable alternate screen, then restore the normal terminal before scanning
  • keep scanning and final reports inline so useful output remains in terminal history
  • unmount the active report without clearing it during signal cancellation
  • prevent later scan cleanup from erasing a preserved report frame
  • replace the obsolete inline-selector metric with the mode-neutral tui.project_select_shown
  • cover selector/report renderer boundaries and cancellation lifecycle races

Test plan

  • nr test
  • nr lint
  • nr typecheck
  • nr format:check
  • nr smoke:json-report
  • npx -y react-doctor@latest --verbose --scope changed
  • real 14-package PTY at 12 rows: Enter from project selection restores the normal terminal before scanning and leaves no selector rows in history
  • real 14-package PTY at 12 rows: Ctrl-C from project selection restores the normal terminal before printing one cancellation footer
  • real Next.js PTY: full report → issue review → back → Ctrl-C keeps the final score/results visible and prints one Cancelled. footer

@pkg-pr-new

pkg-pr-new Bot commented Aug 5, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-react-doctor@1582
npm i https://pkg.pr.new/oxlint-plugin-react-doctor@1582
npm i https://pkg.pr.new/react-doctor@1582

commit: 1fab119

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 1fab119.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Interactive terminal E2E

React Doctor interactive terminal recording

Recorded from the built CLI at 1fab119 in a real terminal. The fixture holds Git busy for three seconds, so Scanning... must appear immediately after project selection, then exercises the compact interactive report.

Download the GIF and MP4 artifact

@aidenybai aidenybai changed the title fix(cli): preserve results on cancellation fix(cli): clean up interactive terminal transitions Aug 5, 2026
@aidenybai
aidenybai merged commit 1d0e4d6 into main Aug 5, 2026
29 checks passed
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