-
Notifications
You must be signed in to change notification settings - Fork 0
fix(cli): implement confirmDestructive prompts #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
galligan
wants to merge
2
commits into
graphite-base/104
Choose a base branch
from
fix/cli-confirm
base: graphite-base/104
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+91
−37
Conversation
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
Contributor
Author
8188ebf to
bde2b19
Compare
f08e961 to
b561c5a
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Greptile Summary
|
| Filename | Overview |
|---|---|
| packages/cli/src/input.ts | Replaces placeholder implementation with functional destructive confirmation prompts using Result pattern |
| packages/cli/src/tests/input.test.ts | Adds comprehensive test suite for confirmation prompts with mock infrastructure and multiple scenarios |
Confidence score: 4/5
- This PR is safe to merge with only minor concerns about test complexity
- Score reflects solid implementation following TDD principles but complexity in mock infrastructure could lead to maintenance challenges
- Pay close attention to
packages/cli/src/__tests__/input.test.tsfor mock queue management and test isolation
Sequence Diagram
sequenceDiagram
participant User
participant CLI
participant prompts as "@clack/prompts"
participant process as "Process/TTY"
User->>CLI: "Invoke destructive command"
CLI->>CLI: "Check bypassFlag"
alt bypassFlag is true
CLI->>User: "Return Ok(true)"
else bypassFlag is false
CLI->>process: "Check TTY and TERM"
alt non-TTY or TERM=dumb
CLI->>User: "Return Err(CancelledError)"
else interactive mode
CLI->>prompts: "confirm({ message })"
prompts->>User: "Show confirmation prompt"
User->>prompts: "User response (true/false/cancel)"
prompts->>CLI: "Return response"
alt response is true
CLI->>User: "Return Ok(true)"
else response is false or cancel
CLI->>User: "Return Err(CancelledError)"
end
end
end
b561c5a to
590e6df
Compare
bde2b19 to
cd7f5ae
Compare
Contributor
Author
|
Restacked and resubmitted. No additional changes in this PR. |
This was referenced Jan 23, 2026
This was referenced Jan 23, 2026
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.

Summary
confirmDestructiveprompt handling in CLI input.Changes
Testing