🎨 Palette: Add visual progress bar to CLI timer#116
Conversation
- Replaced simple countdown with ASCII progress bar [██░░] - Used ANSI clear-line code for cleaner updates - Added tests for UX visuals in `tests/test_ux.py` - Updated journal with CLI learnings
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
😎 Merged manually by Abhi Mehrotra (@abhimehro) - details. |
| combined_output = "".join(writes) | ||
|
|
||
| # Check for progress bar chars | ||
| assert "░" 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
|
|
||
| # Check for progress bar chars | ||
| assert "░" in combined_output | ||
| assert "█" 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
| # Check for progress bar chars | ||
| assert "░" in combined_output | ||
| assert "█" in combined_output | ||
| assert "Test" 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
| assert "░" in combined_output | ||
| assert "█" in combined_output | ||
| assert "Test" in combined_output | ||
| assert "Done!" 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
| assert "Done!" in combined_output | ||
|
|
||
| # Check for ANSI clear line code | ||
| assert "\033[K" 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
| sys.stderr.write(f"\r{Colors.CYAN}⏳ {message}: {remaining}s...{Colors.ENDC}") | ||
| progress = (seconds - remaining) / seconds | ||
| filled = int(width * progress) | ||
| bar = "█" * filled + "░" * (width - filled) |
Check warning
Code scanning / Prospector (reported by Codacy)
Black listed name "bar" (blacklisted-name) Warning
| sys.stderr.write(f"\r{Colors.CYAN}⏳ {message}: {remaining}s...{Colors.ENDC}") | ||
| progress = (seconds - remaining) / seconds | ||
| filled = int(width * progress) | ||
| bar = "█" * filled + "░" * (width - filled) |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Black listed name "bar" Warning
| @@ -0,0 +1,47 @@ | |||
|
|
|||
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing module docstring Warning test
| combined_output = "".join(writes) | ||
|
|
||
| # Check for progress bar chars | ||
| assert "░" 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
|
|
||
| # Check for progress bar chars | ||
| assert "░" in combined_output | ||
| assert "█" 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
| # Check for progress bar chars | ||
| assert "░" in combined_output | ||
| assert "█" in combined_output | ||
| assert "Test" 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
| assert "░" in combined_output | ||
| assert "█" in combined_output | ||
| assert "Test" in combined_output | ||
| assert "Done!" 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
| assert "Done!" in combined_output | ||
|
|
||
| # Check for ANSI clear line code | ||
| assert "\033[K" 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
| sys.stderr.write(f"\r{Colors.CYAN}⏳ {message}: {remaining}s...{Colors.ENDC}") | ||
| progress = (seconds - remaining) / seconds | ||
| filled = int(width * progress) | ||
| bar = "█" * filled + "░" * (width - filled) |
Check warning
Code scanning / Pylint (reported by Codacy)
Black listed name "bar" Warning
| @@ -0,0 +1,47 @@ | |||
|
|
|||
Check warning
Code scanning / Pylint (reported by Codacy)
Missing module docstring Warning test
There was a problem hiding this comment.
Pull request overview
This PR enhances the CLI user experience by replacing a simple countdown timer with a visual progress bar during the 60-second deletion propagation wait. The implementation uses ASCII block characters (█ and ░) and ANSI clear-line codes for smoother terminal updates while maintaining NO_COLOR environment variable support.
Changes:
- Added visual progress bar with configurable width to
countdown_timer()function - Implemented ANSI clear-line code (
\033[K) for cleaner terminal output - Added comprehensive test coverage for both color-enabled and color-disabled modes
- Documented the learning about ANSI codes and progress bars in palette.md
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| main.py | Enhanced countdown_timer function with 15-character progress bar using block characters and improved ANSI clear-line handling |
| tests/test_ux.py | Added unit tests for visual progress bar rendering and NO_COLOR behavior verification |
| .Jules/palette.md | Documented best practices for ANSI clear-line codes and visual progress feedback |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
🎨 Palette: Added visual progress bar to CLI timer
💡 What: Replaced the simple "waiting: 60s..." countdown with a visual progress bar
[████░░] 45s....🎯 Why: Making users wait 60s for deletion propagation is tedious; a visual bar reduces perceived wait time and provides better feedback.
📸 Before:
⏳ Waiting for deletions to propagate: 59s...After:
⏳ Waiting for deletions to propagate: [██████░░░░] 35s...♿ Accessibility: Uses standard ASCII chars and high-contrast colors (Cyan/Green). Preserves
NO_COLORbehavior.PR created automatically by Jules for task 1599368006489282321 started by @abhimehro