Skip to content

Conversation

@google-labs-jules
Copy link

🎨 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/23


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

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
@google-labs-jules
Copy link
Author

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

return
percent = float(self.current) / self.total
filled = int(self.length * percent)
bar = '█' * filled + '-' * (self.length - filled)

Check warning

Code scanning / Prospector (reported by Codacy)

Black listed name "bar" (blacklisted-name) Warning

Black listed name "bar" (blacklisted-name)
BOLD = ''
UNDERLINE = ''

class ProgressBar:

Check warning

Code scanning / Pylint (reported by Codacy)

Too few public methods (1/2) Warning

Too few public methods (1/2)
BOLD = ''
UNDERLINE = ''

class ProgressBar:

Check warning

Code scanning / Pylint (reported by Codacy)

Missing class docstring Warning

Missing class docstring
self.length = length
self.current = 0

def increment(self):

Check warning

Code scanning / Pylint (reported by Codacy)

Missing method docstring Warning

Missing method docstring
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

Black listed name "bar"
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

Line too long (106/100)
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

Variable name "pb" doesn't conform to snake_case naming style
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

Variable name "pb" doesn't conform to snake_case naming style
BOLD = ''
UNDERLINE = ''

class ProgressBar:

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Missing class docstring Warning

Missing class docstring
BOLD = ''
UNDERLINE = ''

class ProgressBar:

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Too few public methods (1/2) Warning

Too few public methods (1/2)
self.length = length
self.current = 0

def increment(self):

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Missing function or method docstring Warning

Missing function or method docstring
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

Black listed name "bar"
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

Line too long (106/100)
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

Variable name "pb" doesn't conform to snake_case naming style
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

Variable name "pb" doesn't conform to snake_case naming style
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.

1 participant