fix(cli): print cancellation footer once - #1581
Merged
Merged
Conversation
commit: |
Contributor
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Contributor
Interactive terminal E2ERecorded from the built CLI at |
This was referenced Aug 5, 2026
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.

Why
Before: pressing Ctrl-C after opening and closing the issue review cleared Ink and printed the cancellation footer, then the resolved report lifecycle printed the normal scan footer again.
After: Ctrl-C marks the existing TUI quit state before clearing Ink, so cancellation owns the only footer while normal completion remains unchanged.
Product brief:
pendingActions.didQuitfooter suppression instead of adding another output mode or state owner.tui.cancelledcounter; no new telemetry surface is needed.What changed
ScanApp's existing quit owner before the Ctrl-C path clears the active Ink rendererTest plan
nr testnr lintnr typechecknr format:checknr smoke:json-reportnpx -y react-doctor@latest --verbose --scope changed--scope full --verbose --yes, enter issue review, escape back, then Ctrl-C; exits 130 with one cancellation footerNote
Low Risk
Small CLI-only change to Ctrl-C handling with a focused regression test; no auth, data, or API impact.
Overview
Fixes a TUI bug where Ctrl-C after visiting issue review and returning to the report could print two footers: the cancellation message and then the normal completed-scan footer.
useExitOnCtrlCnow accepts an optionalonCancelcallback andScanApppassesonQuitinto it so Ctrl-C sets the samependingActions.didQuitflag as q / Esc before Ink tears down. That reuses existing footer suppression instead of new state.A new
scan-apptest covers report → issue review → back → Ctrl-C and assertsonQuitandexitGracefullyrun once.Reviewed by Cursor Bugbot for commit 408aa3c. Bugbot is set up for automated code reviews on this repo. Configure here.