Skip to content

🎨 Palette: [UX improvement] Add keyboard trap exit, clear choices, and shortcut hints#122

Open
haseeb-heaven wants to merge 1 commit into
mainfrom
palette/tui-ux-enhancements-15196289772185900456
Open

🎨 Palette: [UX improvement] Add keyboard trap exit, clear choices, and shortcut hints#122
haseeb-heaven wants to merge 1 commit into
mainfrom
palette/tui-ux-enhancements-15196289772185900456

Conversation

@haseeb-heaven

@haseeb-heaven haseeb-heaven commented Jun 11, 2026

Copy link
Copy Markdown
Owner

💡 What: Mapped \x03 (Ctrl-C) to exit actions in raw mode, exposed choices in non-interactive prompts, and added cancel shortcut hints to the UI footer.
🎯 Why: To prevent terminal keyboard traps, make available choices visible, and give users clear instructions on how to cancel TUI selections.
📸 Before/After: Visual update to prompts to include choice arrays and updated footer strings.
♿ Accessibility: Improved keyboard accessibility by explicitly providing an exit hatch for standard interrupts and making options immediately visible to screen readers using headless prompts.


PR created automatically by Jules for task 15196289772185900456 started by @haseeb-heaven

Summary by CodeRabbit

  • Bug Fixes
    • Ctrl-C now works consistently as a cancel signal across all platforms
    • UI footer messages now explicitly display available keyboard shortcuts
    • Option prompts now display available choices inline for improved readability

- Map \x03 to exit actions in raw mode
- Expose choices in non-interactive prompts explicitly
- Add cancel shortcut hints to UI footers
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR extends keyboard interrupt handling in the terminal UI to recognize Ctrl-C as an escape/cancel signal on both Windows and Unix platforms, updates UI footer text to communicate this capability, and formats non-TTY option prompts to display available choices inline.

Changes

TUI Keyboard Handling and Presentation

Layer / File(s) Summary
Ctrl-C escape handling
libs/terminal_ui.py
_read_key on Windows expands the escape condition to treat Ctrl-C (\x03) the same as Escape (\x1b), and on Unix-like platforms adds an explicit branch to return 'escape' when Ctrl-C is pressed.
UI text and option presentation
libs/terminal_ui.py
_render_selector footer text is updated to explicitly state "Esc/Ctrl-C to cancel", and _select_option in non-TTY mode now includes the list of selectable options inline with the prompt title instead of displaying only the title.
Changelog documentation
.jules/palette.md
New dated entry documents the TUI raw-mode keyboard interrupt handling and clearer presentation of prompt options with shortcut hints.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit hops through the keyboard with glee,
Ctrl-C now works as it ought to be!
On Windows or Unix, escape runs true,
Footers and prompts show what to do! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title mentions emoji, vague framing terms, and brackets that obscure clarity; however, it does directly reference the core changes (keyboard exit, choice clarity, shortcut hints) in a way that relates to the actual changeset. Simplify the title by removing emoji and brackets (e.g., 'Add Ctrl-C keyboard exit and improve choice visibility in TUI') to improve clarity and scannability in commit history.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette/tui-ux-enhancements-15196289772185900456

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.jules/palette.md:
- Line 1: Update the changelog entry header in .jules/palette.md by changing the
date string "2024-06-11" to "2026-06-11" so the entry matches this PR's creation
date; edit the top header line that currently reads "## 2024-06-11 - TUI
Keyboard Trap & Options Clarity" to "## 2026-06-11 - TUI Keyboard Trap & Options
Clarity".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dc7c4ca0-42a9-4ac9-82d7-f10b352f6061

📥 Commits

Reviewing files that changed from the base of the PR and between 2a47494 and bfa73c8.

📒 Files selected for processing (2)
  • .jules/palette.md
  • libs/terminal_ui.py

Comment thread .jules/palette.md
@@ -0,0 +1,3 @@
## 2024-06-11 - TUI Keyboard Trap & Options Clarity

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Correct the changelog date to match this PR timeline.

Line 1 uses 2024-06-11, but this PR was created on 2026-06-11; this will make the entry appear out of sequence in historical notes.

Suggested patch
-## 2024-06-11 - TUI Keyboard Trap & Options Clarity
+## 2026-06-11 - TUI Keyboard Trap & Options Clarity
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## 2024-06-11 - TUI Keyboard Trap & Options Clarity
## 2026-06-11 - TUI Keyboard Trap & Options Clarity
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.jules/palette.md at line 1, Update the changelog entry header in
.jules/palette.md by changing the date string "2024-06-11" to "2026-06-11" so
the entry matches this PR's creation date; edit the top header line that
currently reads "## 2024-06-11 - TUI Keyboard Trap & Options Clarity" to "##
2026-06-11 - TUI Keyboard Trap & Options Clarity".

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