fix(cli): prevent TUI menu from overwriting quota/verify output#562
fix(cli): prevent TUI menu from overwriting quota/verify output#562lawRathod wants to merge 2 commits intoNoeFabris:mainfrom
Conversation
Resolves NoeFabris#537. The TUI menu clears the screen when it renders, which causes outputs from commands like 'Check quotas', 'Verify account', etc. to flash and disappear immediately. Added a 'Press Enter to return to menu...' prompt to allow the user to read the output.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
WalkthroughAdds a new exported function Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 6/8 reviews remaining, refill in 10 minutes and 29 seconds.Comment |
Greptile SummaryThis PR fixes a UX bug where the TUI menu would immediately redraw and overwrite quota/verification output by introducing a
Confidence Score: 3/5The fix logic is correct, but the unexplained lock-file version bump must be resolved before merging. The package-lock.json — version bump needs reconciliation with package.json Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[promptLoginMode called] --> B{isTTY?}
B -- No --> C[promptLoginModeFallback\nreadline on stdin]
B -- Yes --> D[showAuthMenu TUI]
C --> E[Returns mode: check/verify/verify-all/etc.]
D --> F[Returns action]
F -- configure-models --> G[updateOpencodeConfig]
G --> H[Print result]
H --> I[promptContinue NEW]
I --> D
E --> J[plugin.ts handles mode]
F --> J
J -- check quotas --> K[Print quota output]
K --> L[promptContinue NEW]
L --> A
J -- verify / verify-all --> M[Run verification]
M --> N[Print result]
N --> O[promptContinue NEW]
O --> A
J -- manage toggle --> P[Toggle account\nPrint status]
P --> Q[promptContinue NEW]
Q --> A
style I fill:#90EE90
style L fill:#90EE90
style O fill:#90EE90
style Q fill:#90EE90
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
package-lock.json:4
**Unexplained version bump in lock file**
`package-lock.json` changes the package version from `1.3.3-beta.2` to `1.6.0`, but `package.json` does not appear in this PR's diff. If `package.json` wasn't also updated, the lock file is out of sync with the source of truth — `npm ci` and `npm install` will regenerate it from `package.json`, which would immediately undo this change and could cause CI confusion. Was an `npm version` bump intended as part of this fix, or did a merge/rebase pick up stale lock file changes?
Reviews (2): Last reviewed commit: "fix(cli): add isTTY guard to promptConti..." | Re-trigger Greptile |
This fixes an issue where promptContinue could throw an unhandled rejection in a piped/non-interactive environment when stdin reaches EOF.
|
Thanks for the feedback! I've added the |
| "name": "opencode-antigravity-auth", | ||
| "version": "1.3.3-beta.2", | ||
| "version": "1.6.0", | ||
| "lockfileVersion": 3, |
There was a problem hiding this comment.
Unexplained version bump in lock file
package-lock.json changes the package version from 1.3.3-beta.2 to 1.6.0, but package.json does not appear in this PR's diff. If package.json wasn't also updated, the lock file is out of sync with the source of truth — npm ci and npm install will regenerate it from package.json, which would immediately undo this change and could cause CI confusion. Was an npm version bump intended as part of this fix, or did a merge/rebase pick up stale lock file changes?
Prompt To Fix With AI
This is a comment left during a code review.
Path: package-lock.json
Line: 4
Comment:
**Unexplained version bump in lock file**
`package-lock.json` changes the package version from `1.3.3-beta.2` to `1.6.0`, but `package.json` does not appear in this PR's diff. If `package.json` wasn't also updated, the lock file is out of sync with the source of truth — `npm ci` and `npm install` will regenerate it from `package.json`, which would immediately undo this change and could cause CI confusion. Was an `npm version` bump intended as part of this fix, or did a merge/rebase pick up stale lock file changes?
How can I resolve this? If you propose a fix, please make it concise.
Summary
Resolves #537.
When executing
opencode auth loginand selecting Check quotas, Verify one account, or Verify all accounts, the output is printed to the console but immediately overwritten by the TUI menu. This makes the information impossible to read as it flashes briefly before the menu reappears.This PR adds a
promptContinuehelper that pauses execution and waits for the user to press Enter before returning to the main TUI menu, allowing the output to be read.Changes
promptContinueinsrc/plugin/cli.ts.await promptContinue()insrc/plugin.tsandsrc/plugin/cli.tsafter printing informative data (quotas, verification statuses, model configuration).