🎨 Palette: Add visual progress bars for CLI operations#130
Conversation
|
👋 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. |
|
Merging to
|
| return safe | ||
|
|
||
|
|
||
| def render_progress_bar(current: int, total: int, label: str, prefix: str = "🚀") -> None: |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing function docstring Warning
| width = 20 | ||
| progress = min(1.0, current / total) | ||
| filled = int(width * progress) | ||
| bar = "█" * filled + "░" * (width - filled) |
Check warning
Code scanning / Pylint (reported by Codacy)
Black listed name "bar" Warning
| percent = int(progress * 100) | ||
|
|
||
| # Use \033[K to clear line residue | ||
| sys.stderr.write(f"\r\033[K{Colors.CYAN}{prefix} {label}: [{bar}] {percent}% ({current}/{total}){Colors.ENDC}") |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (115/100) Warning
| if USE_COLORS: | ||
| sys.stderr.write(f"\r{Colors.CYAN}🚀 Folder {sanitize_for_log(folder_name)}: Pushing batch {successful_batches}/{total_batches}...{Colors.ENDC}") | ||
| sys.stderr.flush() | ||
| render_progress_bar(successful_batches, total_batches, f"Folder {sanitize_for_log(folder_name)}") |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (109/100) Warning
| if successful_batches == total_batches: | ||
| if USE_COLORS: | ||
| sys.stderr.write(f"\r{Colors.GREEN}✅ Folder {sanitize_for_log(folder_name)}: Finished ({len(filtered_hostnames)} rules) {Colors.ENDC}\n") | ||
| sys.stderr.write(f"\r\033[K{Colors.GREEN}✅ Folder {sanitize_for_log(folder_name)}: Finished ({len(filtered_hostnames)} rules){Colors.ENDC}\n") |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (154/100) Warning
| return safe | ||
|
|
||
|
|
||
| def render_progress_bar(current: int, total: int, label: str, prefix: str = "🚀") -> None: |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing function or method docstring Warning
| width = 20 | ||
| progress = min(1.0, current / total) | ||
| filled = int(width * progress) | ||
| bar = "█" * filled + "░" * (width - filled) |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Black listed name "bar" Warning
| percent = int(progress * 100) | ||
|
|
||
| # Use \033[K to clear line residue | ||
| sys.stderr.write(f"\r\033[K{Colors.CYAN}{prefix} {label}: [{bar}] {percent}% ({current}/{total}){Colors.ENDC}") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (115/100) Warning
| if USE_COLORS: | ||
| sys.stderr.write(f"\r{Colors.CYAN}🚀 Folder {sanitize_for_log(folder_name)}: Pushing batch {successful_batches}/{total_batches}...{Colors.ENDC}") | ||
| sys.stderr.flush() | ||
| render_progress_bar(successful_batches, total_batches, f"Folder {sanitize_for_log(folder_name)}") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (109/100) Warning
| if successful_batches == total_batches: | ||
| if USE_COLORS: | ||
| sys.stderr.write(f"\r{Colors.GREEN}✅ Folder {sanitize_for_log(folder_name)}: Finished ({len(filtered_hostnames)} rules) {Colors.ENDC}\n") | ||
| sys.stderr.write(f"\r\033[K{Colors.GREEN}✅ Folder {sanitize_for_log(folder_name)}: Finished ({len(filtered_hostnames)} rules){Colors.ENDC}\n") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (154/100) Warning
💡 What: Replaced text-based progress counters with visual progress bars [██░░] in
warm_up_cacheandpush_rules.🎯 Why: Provides better psychological feedback for long-running operations and improves the "polish" of the CLI.
📸 Before/After:
Before:
⏳ Warming up cache: 5/50...After:
⏳ Warming up cache: [██░░░░░░░░] 10% (5/50)♿ Accessibility: Uses
\033[Kto ensure clean line updates for screen readers/terminals. Uses high-contrast cyan/green colors.PR created automatically by Jules for task 2833095607090920927 started by @abhimehro