diff --git a/.Jules/palette.md b/.Jules/palette.md index ccae255..2677c36 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -5,3 +5,7 @@ ## 2026-03-28 - [Guided CLI Onboarding] **Learning:** For tutorial-style scaffolds, adding "Next Step" guidance directly to the terminal output after a successful run creates a much smoother onboarding experience than relying solely on the README. **Action:** Always include a clear, visually distinct "Next Step" message at the end of introductory scripts to guide users through the intended learning path. + +## 2026-03-30 - [Demo Scale vs. Terminal Readability] +**Learning:** For demo scripts, larger data sets can degrade the UX by flooding the terminal with logs, making it harder for users to see the structure of the output. +**Action:** Limit the default number of items in demo loops (e.g., 5 items) to maintain a high signal-to-noise ratio while still demonstrating the functionality. diff --git a/01_getting_started.py b/01_getting_started.py index 2f57417..4669797 100644 --- a/01_getting_started.py +++ b/01_getting_started.py @@ -10,7 +10,7 @@ @task def get_customer_ids() -> list[str]: # Fetch customer IDs from a database or API - return [f"customer{n}" for n in random.choices(range(100), k=50)] + return [f"customer{n}" for n in random.choices(range(100), k=5)] @task @@ -26,13 +26,16 @@ def main(): This flow demonstrates how to map a task over a list of inputs. It fetches a list of customer IDs and processes each one individually. """ - customer_ids = get_customer_ids() + with console.status("[bold green]Fetching customer data..."): + customer_ids = get_customer_ids() + # Map the process_customer task across all customer IDs console.print(f"[bold blue]📦 Fetched {len(customer_ids)} customer IDs[/bold blue]") with console.status("[bold green]Processing customers..."): results = process_customer.map(customer_ids) + console.print() console.print( Panel.fit( f"[bold green]✅ Successfully processed {len(results)} customers![/bold green]", diff --git a/02_logging.py b/02_logging.py index 5a0753b..f225f64 100644 --- a/02_logging.py +++ b/02_logging.py @@ -11,7 +11,7 @@ @task def get_customer_ids() -> list[str]: # Fetch customer IDs from a database or API - return [f"customer{n}" for n in random.choices(range(100), k=50)] + return [f"customer{n}" for n in random.choices(range(100), k=5)] @task @@ -36,13 +36,16 @@ def main(): - Use the Prefect logger for structured logging in tasks. - Map tasks across a list of inputs. """ - customer_ids = get_customer_ids() + with console.status("[bold green]Fetching customer data..."): + customer_ids = get_customer_ids() + # Map the process_customer task across all customer IDs console.print(f"[bold blue]📦 Fetched {len(customer_ids)} customer IDs[/bold blue]") with console.status("[bold green]Processing customers with logging..."): results = process_customer.map(customer_ids) + console.print() console.print( Panel.fit( f"[bold green]✅ Successfully processed {len(results)} customers with detailed logging![/bold green]",