Skip to content

🎨 Palette: [UX improvement] Improve TUI Accessibility and Keyboard Navigation#117

Open
haseeb-heaven wants to merge 1 commit into
mainfrom
palette-tui-ux-enhancement-17679741543865928256
Open

🎨 Palette: [UX improvement] Improve TUI Accessibility and Keyboard Navigation#117
haseeb-heaven wants to merge 1 commit into
mainfrom
palette-tui-ux-enhancement-17679741543865928256

Conversation

@haseeb-heaven

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

Copy link
Copy Markdown
Owner

💡 What: Added explicit keyboard cancel hints, properly handled Ctrl-C/Ctrl-D, and improved non-interactive prompt visibility.
🎯 Why: To prevent keyboard traps in raw mode, offer clear escape routes, and provide explicit choice visibility in basic prompts.
📸 Before/After: N/A
♿ Accessibility: Improved keyboard navigation clarity and choice visibility.


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

Summary by CodeRabbit

  • New Features

    • Terminal selector now displays available options inline in prompts for clearer visibility.
    • Help text displayed in footer when available, with fallback to default instructions.
  • Bug Fixes

    • Fixed interrupt handling—Ctrl-C and Ctrl-D now properly exit terminal selection loops.
  • Documentation

    • Added guidance on terminal UI interrupt handling.

@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 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Terminal UI selection now handles user interrupts (Ctrl-C, Ctrl-D, escape) consistently, displays allowed options inline within the prompt text, supports custom help text in footers with an expanded default, and documents this interrupt-handling pattern in the project learning notes.

Changes

Terminal UI Interrupt and Prompt Handling

Layer / File(s) Summary
Terminal UI selector improvements
libs/terminal_ui.py
Footer text now uses help_text when provided, else expands to mention cancellation keys. Prompt text now includes options inline as `title [opt1
Terminal interrupt handling documentation
.jules/palette.md
Palette entry documents that raw terminal loops must explicitly handle interrupt bytes and notes bracket-escaping issues when injecting option lists into Prompt.ask.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐇 A rabbit hops through terminal keys,
Escape and Ctrl meet user needs,
Options inline, no bracket squeeze—
Interrupt handling's a gentle breeze!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: TUI improvements including handling of keyboard interrupts (Ctrl-C/Ctrl-D) and enhanced option visibility in prompts, which are accessibility and keyboard navigation enhancements.
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-enhancement-17679741543865928256

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


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

🤖 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: The entry heading "## 2024-06-09 - Terminal UI Escape and Interrupt
Handling" has the wrong year; update that heading to the correct PR timeline
(e.g., "## 2026-06-09 - Terminal UI Escape and Interrupt Handling") so the date
in the file matches the change set; edit the heading line exactly (the string
starting with "## 2024-06-09 - Terminal UI Escape and Interrupt Handling") to
replace the year and/or date as appropriate.

In `@libs/terminal_ui.py`:
- Line 70: Footer text omits the Ctrl-D shortcut; update the footer assignment
(variable footer in libs/terminal_ui.py) to include "Ctrl-D" so it matches the
actual cancel behavior in the selector (the cancel handling that listens for
Esc, Ctrl-C, and Ctrl-D). Replace the current string 'Esc/Ctrl-C to cancel.'
with a wording that includes Ctrl-D (e.g., 'Esc/Ctrl-C/Ctrl-D to cancel.') so
the UI help matches the implemented shortcuts.
🪄 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: e6c22558-e432-47bd-8e5f-08c860c3765b

📥 Commits

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

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

Comment thread .jules/palette.md
@@ -0,0 +1,3 @@
## 2024-06-09 - Terminal UI Escape and Interrupt Handling

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

Fix the entry date to match this PR’s timeline.

The heading uses 2024-06-09, but this change set is from June 2026. Keeping dates accurate is important for learning-history traceability.

🤖 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, The entry heading "## 2024-06-09 - Terminal UI
Escape and Interrupt Handling" has the wrong year; update that heading to the
correct PR timeline (e.g., "## 2026-06-09 - Terminal UI Escape and Interrupt
Handling") so the date in the file matches the change set; edit the heading line
exactly (the string starting with "## 2024-06-09 - Terminal UI Escape and
Interrupt Handling") to replace the year and/or date as appropriate.

Comment thread libs/terminal_ui.py
table.add_row(marker, label, style=style)

footer = help_text or 'Use Up/Down arrows and Enter to select.'
footer = help_text or 'Use Up/Down arrows and Enter to select. Esc/Ctrl-C to cancel.'

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

Update the cancel hint to include Ctrl-D.

The selector now cancels on Esc, Ctrl-C, and Ctrl-D (Line 102), but the footer only advertises Esc/Ctrl-C. This leaves one active shortcut undiscoverable.

Suggested fix
-        footer = help_text or 'Use Up/Down arrows and Enter to select. Esc/Ctrl-C to cancel.'
+        footer = help_text or 'Use Up/Down arrows and Enter to select. Esc/Ctrl-C/Ctrl-D to cancel.'
📝 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
footer = help_text or 'Use Up/Down arrows and Enter to select. Esc/Ctrl-C to cancel.'
footer = help_text or 'Use Up/Down arrows and Enter to select. Esc/Ctrl-C/Ctrl-D to cancel.'
🤖 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 `@libs/terminal_ui.py` at line 70, Footer text omits the Ctrl-D shortcut;
update the footer assignment (variable footer in libs/terminal_ui.py) to include
"Ctrl-D" so it matches the actual cancel behavior in the selector (the cancel
handling that listens for Esc, Ctrl-C, and Ctrl-D). Replace the current string
'Esc/Ctrl-C to cancel.' with a wording that includes Ctrl-D (e.g.,
'Esc/Ctrl-C/Ctrl-D to cancel.') so the UI help matches the implemented
shortcuts.

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