-
Notifications
You must be signed in to change notification settings - Fork 0
🎨 Palette: Add progress bar for CLI wait states #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
🎨 Palette: Add progress bar for CLI wait states #91
Conversation
Implements a text-based ProgressBar for long-running operations in the CLI. This improves user experience by providing visual feedback during wait states, specifically for parallel network requests in `warm_up_cache` and `sync_profile`. * Added `ProgressBar` class to `main.py` * Integrated progress bar into `warm_up_cache` loop * Integrated progress bar into `sync_profile` loop * Ensures progress bar is only shown when TTY/Colors are enabled
|
👋 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. |
| BOLD = '' | ||
| UNDERLINE = '' | ||
|
|
||
| class ProgressBar: |
Check warning
Code scanning / Pylint (reported by Codacy)
Too few public methods (1/2) Warning
| BOLD = '' | ||
| UNDERLINE = '' | ||
|
|
||
| class ProgressBar: |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing class docstring Warning
| self.length = length | ||
| self.current = 0 | ||
|
|
||
| def increment(self): |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing method docstring Warning
| return | ||
| percent = float(self.current) / self.total | ||
| filled = int(self.length * percent) | ||
| bar = '█' * filled + '-' * (self.length - filled) |
Check warning
Code scanning / Pylint (reported by Codacy)
Black listed name "bar" Warning
| percent = float(self.current) / self.total | ||
| filled = int(self.length * percent) | ||
| bar = '█' * filled + '-' * (self.length - filled) | ||
| sys.stderr.write(f"\r{Colors.CYAN}{self.prefix} |{bar}| {self.current}/{self.total}{Colors.ENDC}") |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (106/100) Warning
| log.info(f"Warming up cache for {len(urls_to_fetch)} URLs...") | ||
| with concurrent.futures.ThreadPoolExecutor() as executor: | ||
| futures = {executor.submit(_gh_get, url): url for url in urls_to_fetch} | ||
| pb = ProgressBar(len(futures), "Fetching") |
Check warning
Code scanning / Pylint (reported by Codacy)
Variable name "pb" doesn't conform to snake_case naming style Warning
| for folder_data in folder_data_list | ||
| } | ||
|
|
||
| pb = ProgressBar(len(future_to_folder), "Syncing folders") |
Check warning
Code scanning / Pylint (reported by Codacy)
Variable name "pb" doesn't conform to snake_case naming style Warning
| BOLD = '' | ||
| UNDERLINE = '' | ||
|
|
||
| class ProgressBar: |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing class docstring Warning
| BOLD = '' | ||
| UNDERLINE = '' | ||
|
|
||
| class ProgressBar: |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Too few public methods (1/2) Warning
| self.length = length | ||
| self.current = 0 | ||
|
|
||
| def increment(self): |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing function or method docstring Warning
| return | ||
| percent = float(self.current) / self.total | ||
| filled = int(self.length * percent) | ||
| bar = '█' * filled + '-' * (self.length - filled) |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Black listed name "bar" Warning
| percent = float(self.current) / self.total | ||
| filled = int(self.length * percent) | ||
| bar = '█' * filled + '-' * (self.length - filled) | ||
| sys.stderr.write(f"\r{Colors.CYAN}{self.prefix} |{bar}| {self.current}/{self.total}{Colors.ENDC}") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (106/100) Warning
| log.info(f"Warming up cache for {len(urls_to_fetch)} URLs...") | ||
| with concurrent.futures.ThreadPoolExecutor() as executor: | ||
| futures = {executor.submit(_gh_get, url): url for url in urls_to_fetch} | ||
| pb = ProgressBar(len(futures), "Fetching") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Variable name "pb" doesn't conform to snake_case naming style Warning
| for folder_data in folder_data_list | ||
| } | ||
|
|
||
| pb = ProgressBar(len(future_to_folder), "Syncing folders") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Variable name "pb" doesn't conform to snake_case naming style Warning
🎨 Palette: Added progress bar for long-running operations
💡 What: Added a simple, dependency-free text progress bar to the CLI output.
🎯 Why: Users were facing silent waits during cache warming (fetching 20+ URLs) and folder syncing. This provides reassurance that the tool is working.
📸 Before/After:
Before:
INFO | Warming up cache for 23 URLs...(silence for 5-10s)
After:
INFO | Warming up cache for 23 URLs...Fetching |██████████--------------------| 10/23PR created automatically by Jules for task 6552939739177589967 started by @abhimehro