feat: Add interactive pause after checking quota#443
feat: Add interactive pause after checking quota#443jcromero wants to merge 1 commit intoNoeFabris:mainfrom
Conversation
WalkthroughThe changes add an interactive pause mechanism to src/plugin.ts. After displaying quota or status information, the code now prints a message prompting the user to press Enter and waits for input using readline before returning to the menu. This pause functionality is implemented in two locations within the login or verification flow. Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting 📒 Files selected for processing (1)
⏰ 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). (2)
✏️ Tip: You can disable this entire section by setting Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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. Comment |
Greptile OverviewGreptile SummaryThis PR adds an interactive pause after displaying quota information, requiring users to press Enter before returning to the main menu. This prevents the quota bars from being immediately cleared, addressing the UX issue where users couldn't read the information. Changes:
Minor issue:
Confidence Score: 4/5
Important Files Changed
Last reviewed commit: e4cbc24 |
| const { createInterface } = await import("node:readline/promises"); | ||
| const { stdin, stdout } = await import("node:process"); | ||
| const rl = createInterface({ input: stdin, output: stdout }); | ||
| await rl.question(""); | ||
| rl.close(); |
There was a problem hiding this comment.
missing try-finally block for readline cleanup
| const { createInterface } = await import("node:readline/promises"); | |
| const { stdin, stdout } = await import("node:process"); | |
| const rl = createInterface({ input: stdin, output: stdout }); | |
| await rl.question(""); | |
| rl.close(); | |
| const { createInterface } = await import("node:readline/promises"); | |
| const { stdin, stdout } = await import("node:process"); | |
| const rl = createInterface({ input: stdin, output: stdout }); | |
| try { | |
| await rl.question(""); | |
| } finally { | |
| rl.close(); | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/plugin.ts
Line: 2734:2738
Comment:
missing try-finally block for readline cleanup
```suggestion
const { createInterface } = await import("node:readline/promises");
const { stdin, stdout } = await import("node:process");
const rl = createInterface({ input: stdin, output: stdout });
try {
await rl.question("");
} finally {
rl.close();
}
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Pull request overview
Improves the interactive quota-check flow in the Antigravity OAuth CLI so users can read the printed quota bars before the menu re-renders/clears the screen.
Changes:
- Add an “Press Enter to return to the menu…” pause after displaying quota information.
- Implement the pause using
node:readline/promisesto wait for an Enter keypress.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| await rl.question(""); | ||
| rl.close(); |
There was a problem hiding this comment.
The readline interface should be closed in a finally block (or by reusing an existing helper like promptOAuthCallbackValue) so it’s always cleaned up if rl.question() throws (e.g., stdin closed, SIGINT). As written, an exception here can leave the interface open and potentially keep the process in a bad input state.
| await rl.question(""); | |
| rl.close(); | |
| try { | |
| await rl.question(""); | |
| } finally { | |
| rl.close(); | |
| } |
| await saveAccounts(existingStorage); | ||
| } | ||
| console.log(""); | ||
| console.log("\nPress Enter to return to the menu..."); |
There was a problem hiding this comment.
This prints an extra blank line because there’s already a console.log("") immediately above and this string also starts with \n. Consider removing one of the newlines to avoid double-spacing the prompt.
| console.log("\nPress Enter to return to the menu..."); | |
| console.log("Press Enter to return to the menu..."); |
This PR modifies the quota check flow to wait for user input (Enter key) before returning to the main menu. Previously, the screen would clear immediately after displaying the quota bars, making it impossible for users to read the information. This change improves UX by allowing users to dismiss the quota view when ready.