Conversation
add Q hotkey to discard all annotations and quit without output. when annotations exist, show inline confirmation in status bar. confirmation is skippable via --no-confirm-discard flag.
There was a problem hiding this comment.
Pull request overview
Adds a new “discard and quit” flow to the revdiff TUI: pressing Q exits without emitting annotations, optionally prompting for confirmation when annotations exist (unless disabled via config/flags or when the status bar is hidden).
Changes:
- Add
Qhandling to the UI model, including an inline confirm prompt in the status bar and aDiscarded()accessor for the final model. - Add
--no-confirm-discard(env/config supported) and skip output emission when the session was discarded. - Add unit tests for confirmation scenarios and update user-facing documentation (README + plugin reference docs).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
ui/model.go |
Implements discard/confirm state, Q hotkey handling, and status bar messaging. |
ui/model_test.go |
Adds tests covering discard/confirm scenarios and config wiring. |
cmd/revdiff/main.go |
Adds --no-confirm-discard plumbing and skips output when m.Discarded() is true. |
cmd/revdiff/main_test.go |
Adds flag/env/config parsing tests for --no-confirm-discard. |
README.md |
Documents the new option and Q keybinding. |
docs/plans/completed/20260401-discard-quit.md |
Records the completed implementation plan and acceptance criteria. |
.claude-plugin/skills/revdiff/references/usage.md |
Updates keybindings reference to include Q. |
.claude-plugin/skills/revdiff/references/config.md |
Updates config/options reference to include --no-confirm-discard. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| func TestParseArgs_NoConfirmDiscard(t *testing.T) { | ||
| t.Run("flag", func(t *testing.T) { | ||
| opts, err := parseArgs([]string{"--no-confirm-discard"}) |
There was a problem hiding this comment.
TestParseArgs_NoConfirmDiscard's "flag" subtest calls parseArgs([]string{"--no-confirm-discard"}) without the --config isolation that noConfigArgs is meant to provide (to avoid picking up a user's real default config at ~/.config/revdiff/config). This can make the test environment-dependent. Update the test to include a temp --config path (e.g., parseArgs(append(noConfigArgs(t), "--no-confirm-discard"))), or bring back an extra ...string helper pattern.
| opts, err := parseArgs([]string{"--no-confirm-discard"}) | |
| opts, err := parseArgs(append(noConfigArgs(t), "--no-confirm-discard")) |
* feat: add discard-quit confirmation flow with Q keypress add Q hotkey to discard all annotations and quit without output. when annotations exist, show inline confirmation in status bar. confirmation is skippable via --no-confirm-discard flag. * fix: use noConfigArgs in flag parsing test to isolate from user config
adds
Q(shift+q) to exit revdiff without outputting annotations. when annotations exist, shows inline confirmation in the status bar ("discard N annotations? [y/n]"). secondQoryconfirms,n/Esccancels.if no annotations exist,
Qbehaves the same asq.--no-confirm-discardflag (envREVDIFF_NO_CONFIRM_DISCARD, configno-confirm-discard) skips the prompt. also skips when status bar is hidden (--no-status-bar).changes
ui/model.go- discard state fields,handleDiscardQuit(),handleConfirmDiscardKey(), updated status bar hintscmd/revdiff/main.go---no-confirm-discardoption, skip output when discardedui/model_test.go- 11 new tests covering all discard/confirm scenarioscmd/revdiff/main_test.go- flag parsing test