From 9ea239cfcb4f1dde826e02391bdf94c04a8d9e1a Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 22:35:41 +0000 Subject: [PATCH] feat(ux): Add interactive countdown for wait states - Replace static sleep with visual countdown timer for retries and folder propagation - Improve feedback during long waits (>2s) - Ensure graceful fallback for non-interactive environments - Update Palette journal with UX learnings --- .jules/palette.md | 15 +++++---------- main.py | 13 ++++++++++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.jules/palette.md b/.jules/palette.md index fbedb30..6f3987c 100644 --- a/.jules/palette.md +++ b/.jules/palette.md @@ -1,16 +1,11 @@ -# Palette's Journal - -## 2024-10-18 - CLI UX Adaptation -**Learning:** When a "frontend" agent encounters a CLI-only repo, the "interface" becomes the terminal output. Accessibility principles (contrast, readability, clear feedback) still apply but translate to ANSI colors, clear spacing, and descriptive log messages instead of ARIA labels. -**Action:** Adapting web-centric UX patterns (like "toast notifications") to CLI equivalents (colored log lines or summary tables). - -## 2025-02-18 - Visual Feedback in CLI Tables -**Learning:** CLI summary tables are the "dashboard" of a command-line tool. Missing visual cues (like color-coding status) in these tables reduces scannability, just like a dashboard widget without status indicators. -**Action:** Always check if status indicators in CLI output are visually distinct (colored) to improve "glanceability" of the results. - ## 2025-05-23 - Interactive Wait States **Learning:** Long static sleeps (like 60s) in CLIs cause "is it hung?" anxiety for users. Static logs aren't enough for long pauses. **Action:** Always use a countdown or progress indicator for waits > 5s to provide reassurance of activity. + ## 2024-03-22 - CLI Interactive Fallbacks **Learning:** CLI tools often fail hard when config is missing, but interactive contexts allow for graceful recovery. Users appreciate being asked for missing info instead of just receiving an error. **Action:** When `sys.stdin.isatty()` is true, prompt for missing configuration instead of exiting with an error code. + +## 2024-03-24 - Active Waiting Feedback +**Learning:** Even short recurring waits (like polling retries) can feel unresponsive if they only show a static log message. A "spinner" or countdown makes the CLI feel alive and working. +**Action:** Replace static `sleep()` loops with visual countdowns in interactive modes, while preserving logs for non-interactive/audit modes. diff --git a/main.py b/main.py index e6aabc5..ff444fc 100644 --- a/main.py +++ b/main.py @@ -267,7 +267,11 @@ def _retry_request(request_func, max_retries=MAX_RETRIES, delay=RETRY_DELAY): raise wait_time = delay * (2 ** attempt) log.warning(f"Request failed (attempt {attempt + 1}/{max_retries}): {e}. Retrying in {wait_time}s...") - time.sleep(wait_time) + + if wait_time >= 2: + countdown_timer(wait_time, "Retrying") + else: + time.sleep(wait_time) def _gh_get(url: str) -> Dict: if url not in _cache: @@ -450,8 +454,11 @@ def create_folder(client: httpx.Client, profile_id: str, name: str, do: int, sta if attempt < MAX_RETRIES: wait_time = FOLDER_CREATION_DELAY * (attempt + 1) - log.info(f"Folder '{name}' not found yet. Retrying in {wait_time}s...") - time.sleep(wait_time) + if USE_COLORS: + countdown_timer(wait_time, f"Waiting for folder '{name}'") + else: + log.info(f"Folder '{name}' not found yet. Retrying in {wait_time}s...") + time.sleep(wait_time) log.error(f"Folder {sanitize_for_log(name)} was not found after creation and retries.") return None