Skip to content

🎨 Palette: Improved CLI Feedback & Visuals#144

Closed
abhimehro wants to merge 2 commits intomainfrom
palette-ux-improvements-2627976932165401543
Closed

🎨 Palette: Improved CLI Feedback & Visuals#144
abhimehro wants to merge 2 commits intomainfrom
palette-ux-improvements-2627976932165401543

Conversation

@abhimehro
Copy link
Owner

🎨 Palette: Improved CLI Feedback & Visuals

💡 What:

  • Enhanced the interactive Profile ID prompt to show specific validation errors (e.g., "Invalid profile ID 'abc$': contains unsafe characters") instead of a generic "Invalid ID" error.
  • Standardized progress bar and countdown timer widths to 30 characters (up from 20/15).
  • Cleaned up duplicate code for render_progress_bar.

🎯 Why:

  • Users were getting generic error messages that didn't help them fix their input.
  • Visual consistency makes the tool feel more professional.

📸 Visuals:

  • Progress Bar: [██████████░░░░░░░░░░░░░░░░░░░░] (Wider)
  • Completion: ✅ Waiting for deletions to propagate: Complete!

Accessibility:

  • Clearer error messages reduce cognitive load.

PR created automatically by Jules for task 2627976932165401543 started by @abhimehro

- Improved validation feedback for Profile ID prompts: users now see specific error reasons (e.g., invalid characters) instead of a generic message.
- Standardized progress bar width to 30 characters for better visibility.
- Removed duplicate `render_progress_bar` function definition.
- Updated completion message to "Complete!".
- Added journal entry in `.jules/palette.md`.

Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
@google-labs-jules
Copy link

👋 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.

Copilot AI review requested due to automatic review settings January 29, 2026 22:52
@trunk-io
Copy link

trunk-io bot commented Jan 29, 2026

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@gemini-code-assist
Copy link

Summary of Changes

Hello @abhimehro, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the user experience of the CLI by providing more informative feedback and a more polished visual presentation. Users will now receive actionable error messages when entering invalid profile IDs, reducing frustration and guiding them to correct their input. Additionally, the visual elements like progress bars and countdown timers are now consistent and wider, contributing to a more professional and user-friendly interface.

Highlights

  • Enhanced Profile ID Validation: The interactive Profile ID prompt now provides specific validation error messages, such as detailing unsafe characters or excessive length, instead of a generic 'Invalid ID' error.
  • Standardized Visual Feedback: Progress bars and countdown timers have been standardized to a width of 30 characters, improving visual consistency across the CLI.
  • Code Refactoring: Duplicate code for the render_progress_bar function has been removed, streamlining the codebase.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

assert "█" in combined_output
assert "Test" in combined_output
assert "Done!" in combined_output
assert "Complete!" in combined_output

Check notice

Code scanning / Bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly improves the CLI user experience by providing more specific validation errors and standardizing the visual style of progress bars and timers. The code is also cleaner with the removal of a duplicated function. I've identified a potential security issue with logging unsanitized user input and a minor maintainability improvement by suggesting the use of a constant for a shared value. Overall, these are great enhancements to the tool's usability.

main.py Outdated
Comment on lines +393 to +397
log.error(
f"Invalid profile ID '{profile_id}': contains unsafe characters (allowed: A-Z, a-z, 0-9, _, -)"
)
elif len(profile_id) > 64:
log.error("Invalid profile ID length (max 64 chars)")
log.error(f"Invalid profile ID '{profile_id}': too long (max 64 chars)")

Choose a reason for hiding this comment

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

high

The user-provided profile_id is logged directly in these error messages. If it contains special characters like ANSI escape codes, it could manipulate terminal output. This is a potential security risk (log injection). Please use the existing sanitize_for_log helper to make the output safe.

Suggested change
log.error(
f"Invalid profile ID '{profile_id}': contains unsafe characters (allowed: A-Z, a-z, 0-9, _, -)"
)
elif len(profile_id) > 64:
log.error("Invalid profile ID length (max 64 chars)")
log.error(f"Invalid profile ID '{profile_id}': too long (max 64 chars)")
log.error(
f"Invalid profile ID '{sanitize_for_log(profile_id)}': contains unsafe characters (allowed: A-Z, a-z, 0-9, _, -)"
)
elif len(profile_id) > 64:
log.error(f"Invalid profile ID '{sanitize_for_log(profile_id)}': too long (max 64 chars)")

return

width = 20
width = 30

Choose a reason for hiding this comment

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

medium

The width 30 is now used here and in countdown_timer on line 188. To improve maintainability and avoid magic numbers, consider defining this as a constant in the constants section (e.g., PROGRESS_BAR_WIDTH = 30) and using it in both places.

if log_errors:
if not re.match(r"^[a-zA-Z0-9_-]+$", profile_id):
log.error("Invalid profile ID format (contains unsafe characters)")
log.error(

Check notice

Code scanning / Pylintpython3 (reported by Codacy)

Use lazy % formatting in logging functions Note

Use lazy % formatting in logging functions
assert "█" in combined_output
assert "Test" in combined_output
assert "Done!" in combined_output
assert "Complete!" in combined_output

Check notice

Code scanning / Bandit (reported by Codacy)

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
- Applied `sanitize_for_log` to user inputs in `validate_profile_id` logs.
- Fixes CodeQL alert for potential cleartext logging of sensitive data.
- Maintains improved UX feedback for validation errors.

Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
Copy link

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

This PR enhances the CLI user experience by improving error feedback and visual consistency in progress indicators. The changes address user confusion from generic error messages and inconsistent visual widths.

Changes:

  • Removed duplicate render_progress_bar function definition
  • Standardized progress bar and countdown timer widths from 20/15 characters to 30 characters
  • Enhanced validation error messages to show specific profile IDs and detailed reasons for rejection
  • Updated completion message from "Done!" to "Complete!" in countdown timer
  • Added learning journal entry documenting the UX pattern

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
main.py Removed duplicate function, standardized visual widths to 30 chars, enhanced validation errors with specific profile IDs and detailed feedback, changed generic error to reference specific errors above
tests/test_ux.py Updated test assertion from "Done!" to "Complete!" to match countdown_timer output change
.jules/palette.md Added learning journal entry documenting CLI error feedback pattern

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

Comment on lines 1234 to 1236
def validate_profile_input(value: str) -> bool:
ids = [extract_profile_id(p) for p in value.split(",") if p.strip()]
return bool(ids) and all(
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

When multiple profile IDs are entered, the all() function will short-circuit on the first invalid ID, meaning users will only see the validation error for the first invalid ID, not all of them. For better UX, consider validating all IDs before returning, e.g., using a list comprehension to collect all validation results: results = [validate_profile_id(pid, log_errors=True) for pid in ids] then return bool(ids) and all(results).

Copilot uses AI. Check for mistakes.
if not re.match(r"^[a-zA-Z0-9_-]+$", profile_id):
log.error("Invalid profile ID format (contains unsafe characters)")
log.error(
f"Invalid profile ID {sanitize_for_log(profile_id)}: contains unsafe characters (allowed: A-Z, a-z, 0-9, _, -)"

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (131/100) Warning

Line too long (131/100)
if not re.match(r"^[a-zA-Z0-9_-]+$", profile_id):
log.error("Invalid profile ID format (contains unsafe characters)")
log.error(
f"Invalid profile ID {sanitize_for_log(profile_id)}: contains unsafe characters (allowed: A-Z, a-z, 0-9, _, -)"

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (131/100) Warning

Line too long (131/100)
Copilot AI added a commit that referenced this pull request Feb 8, 2026
…itization, add dry-run plan details

Incorporates the best changes from 36 Jules PRs, addressing review feedback:

Bolt (Performance) - from PR #173:
- Pre-compile PROFILE_ID_PATTERN and RULE_PATTERN at module level
- Use compiled patterns in is_valid_profile_id_format, validate_profile_id, and is_valid_rule
- Supersedes PRs: #140, #143, #152, #155, #158, #161, #167, #170, #173

Sentinel (Security) - from PR #172 with review feedback:
- Enhance sanitize_for_log to redact Basic Auth credentials in URLs
- Redact sensitive query parameters (token, key, secret, password, etc.)
- Handle fragment separators (#) per Gemini Code Assist review
- Use [^&#\s]* pattern per Copilot reviewer suggestion
- Update docstring per reviewer suggestion
- Supersedes PRs: #142, #145, #148, #151, #154, #157, #160, #169, #172

Palette (UX) - from PR #174 with lint fixes:
- Add print_plan_details function for dry-run visibility
- Fix duplicate render_progress_bar definition bug
- Supersedes PRs: #139, #141, #144, #147, #150, #153, #156, #159, #162, #165, #168, #171, #174

Also: #146, #149, #164 (parallel folder deletion) and #166 (auto-fix .env perms) are independent features not consolidated here.

Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
@abhimehro abhimehro closed this Feb 9, 2026
@abhimehro abhimehro deleted the palette-ux-improvements-2627976932165401543 branch February 9, 2026 00:21
abhimehro added a commit that referenced this pull request Feb 9, 2026
…itization, add dry-run plan details

Incorporates the best changes from 36 Jules PRs, addressing review feedback:

Bolt (Performance) - from PR #173:
- Pre-compile PROFILE_ID_PATTERN and RULE_PATTERN at module level
- Use compiled patterns in is_valid_profile_id_format, validate_profile_id, and is_valid_rule
- Supersedes PRs: #140, #143, #152, #155, #158, #161, #167, #170, #173

Sentinel (Security) - from PR #172 with review feedback:
- Enhance sanitize_for_log to redact Basic Auth credentials in URLs
- Redact sensitive query parameters (token, key, secret, password, etc.)
- Handle fragment separators (#) per Gemini Code Assist review
- Use [^&#\s]* pattern per Copilot reviewer suggestion
- Update docstring per reviewer suggestion
- Supersedes PRs: #142, #145, #148, #151, #154, #157, #160, #169, #172

Palette (UX) - from PR #174 with lint fixes:
- Add print_plan_details function for dry-run visibility
- Fix duplicate render_progress_bar definition bug
- Supersedes PRs: #139, #141, #144, #147, #150, #153, #156, #159, #162, #165, #168, #171, #174

Also: #146, #149, #164 (parallel folder deletion) and #166 (auto-fix .env perms) are independent features not consolidated here.

Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants