From fafe6ab7798a59d8d352ec0475bae922f70ed060 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 05:18:01 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20enhance=20CLI=20visua?= =?UTF-8?q?l=20consistency=20and=20data=20reliability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit improves the CLI UX in the demo scripts by: 1. Using rounded corners for result tables to match existing panels. 2. Ensuring unique customer IDs in demo output via random.sample. 3. Reducing visual noise in the next-step guidance. Co-authored-by: ruh-al-tarikh <203426218+ruh-al-tarikh@users.noreply.github.com> --- .Jules/palette.md | 4 ++++ 01_getting_started.py | 7 +++++-- 02_logging.py | 5 ++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.Jules/palette.md b/.Jules/palette.md index 75953c9..db658b6 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -20,3 +20,7 @@ ## 2026-04-02 - [Execution Feedback & Visual Hierarchy] **Learning:** For CLI-based onboarding, providing immediate feedback on execution duration via `time.perf_counter()` and using titled `rich.Rule` components significantly improves the professional feel and clarity of the workflow completion state. **Action:** Incorporate high-resolution execution timing in final result panels and add descriptive titles to terminal rules to better guide users through multi-step onboarding processes. + +## 2026-04-03 - [Consistent CLI Aesthetics & Data Integrity] +**Learning:** Using `box.ROUNDED` for `rich.table.Table` components ensures visual consistency with rounded `Panel` elements, creating a more polished and cohesive CLI experience. Furthermore, using `random.sample` instead of `random.choices` for demo data prevents confusing duplicates, which improves the perceived reliability of the workflow being demonstrated. +**Action:** Apply consistent border styling across all container components and prefer unique data generation for tutorial-style outputs to maintain a high-quality user experience. diff --git a/01_getting_started.py b/01_getting_started.py index a9bcdce..98a5e14 100644 --- a/01_getting_started.py +++ b/01_getting_started.py @@ -1,6 +1,7 @@ from prefect import flow, task import random import time +from rich import box from rich.console import Console from rich.markdown import Markdown from rich.panel import Panel @@ -14,7 +15,8 @@ def get_customer_ids() -> list[str]: """Fetch customer IDs from a database or API.""" # Use sorted and zero-padded IDs for better terminal alignment - ids = [f"customer-{n:02d}" for n in random.choices(range(100), k=5)] + # Use random.sample to ensure unique IDs in the demo output + ids = [f"customer-{n:02d}" for n in random.sample(range(100), k=5)] return sorted(ids) @@ -70,6 +72,7 @@ def main(): show_header=True, header_style="bold blue", show_footer=True, + box=box.ROUNDED, ) table.add_column("Customer ID", style="cyan", footer="Total") table.add_column( @@ -93,7 +96,7 @@ def main(): console.print(Rule("Next Step", style="blue")) console.print( - "[bold blue]➡️ Next Step:[/bold blue] Try running [cyan]python 02_logging.py[/cyan] to learn about logging in Prefect!" + "Try running [cyan]python 02_logging.py[/cyan] to learn about logging in Prefect!" ) return results diff --git a/02_logging.py b/02_logging.py index f5e6ab6..6ab7e97 100644 --- a/02_logging.py +++ b/02_logging.py @@ -2,6 +2,7 @@ from prefect.logging import get_run_logger import random import time +from rich import box from rich.console import Console from rich.markdown import Markdown from rich.panel import Panel @@ -15,7 +16,8 @@ def get_customer_ids() -> list[str]: """Fetch customer IDs from a database or API.""" # Use sorted and zero-padded IDs for better terminal alignment - ids = [f"customer-{n:02d}" for n in random.choices(range(100), k=5)] + # Use random.sample to ensure unique IDs in the demo output + ids = [f"customer-{n:02d}" for n in random.sample(range(100), k=5)] return sorted(ids) @@ -79,6 +81,7 @@ def main(): show_header=True, header_style="bold blue", show_footer=True, + box=box.ROUNDED, ) table.add_column("Customer ID", style="cyan", footer="Total") table.add_column(