Skip to content

feat: Add interactive pause after checking quota#443

Open
jcromero wants to merge 1 commit intoNoeFabris:mainfrom
jcromero:fix/quota-check-interactive
Open

feat: Add interactive pause after checking quota#443
jcromero wants to merge 1 commit intoNoeFabris:mainfrom
jcromero:fix/quota-check-interactive

Conversation

@jcromero
Copy link

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.

Copilot AI review requested due to automatic review settings February 13, 2026 09:14
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

Walkthrough

The 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)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding an interactive pause after quota checking, which is the primary modification in the changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining the UX improvement of waiting for user input before clearing the quota display.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ 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
src/plugin.ts (1)

2733-2738: Avoid blocking in non‑interactive contexts and ensure readline cleanup.

This pause can hang when stdin isn’t a TTY (headless/CI), and rl.close() isn’t guaranteed on errors. Guard with stdin.isTTY and wrap in try/finally to close safely.

🔧 Proposed update
-                  console.log("\nPress Enter to return to the menu...");
-                  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();
+                  console.log("\nPress Enter to return to the menu...");
+                  const { createInterface } = await import("node:readline/promises");
+                  const { stdin, stdout } = await import("node:process");
+                  if (stdin.isTTY) {
+                    const rl = createInterface({ input: stdin, output: stdout });
+                    try {
+                      await rl.question("");
+                    } finally {
+                      rl.close();
+                    }
+                  }
📜 Recent review details

Configuration 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

📥 Commits

Reviewing files that changed from the base of the PR and between f7e0c50 and e4cbc24.

📒 Files selected for processing (1)
  • src/plugin.ts
⏰ 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)
  • GitHub Check: Greptile Review
  • GitHub Check: Agent

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 13, 2026

Greptile Overview

Greptile Summary

This 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:

  • Added readline prompt after quota display to wait for user input
  • Imports node:readline/promises and node:process inline for the pause functionality
  • Displays message "Press Enter to return to the menu..." before waiting

Minor issue:

  • The readline interface cleanup should use a try-finally block for consistency with other readline usage in the codebase (lines 553-584, 670-678)

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk
  • The change is a small, focused UX improvement that adds user input handling after quota display. The implementation follows existing patterns in the codebase, though it could be slightly improved with try-finally error handling for readline cleanup
  • No files require special attention

Important Files Changed

Filename Overview
src/plugin.ts Added interactive pause after quota display to improve UX; missing try-finally for readline cleanup

Last reviewed commit: e4cbc24

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +2734 to +2738
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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing try-finally block for readline cleanup

Suggested change
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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/promises to wait for an Enter keypress.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +2737 to +2738
await rl.question("");
rl.close();
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
await rl.question("");
rl.close();
try {
await rl.question("");
} finally {
rl.close();
}

Copilot uses AI. Check for mistakes.
await saveAccounts(existingStorage);
}
console.log("");
console.log("\nPress Enter to return to the menu...");
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
console.log("\nPress Enter to return to the menu...");
console.log("Press Enter to return to the menu...");

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant