diff --git a/.Jules/palette.md b/.Jules/palette.md index f1823ff..53a14b7 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -25,6 +25,6 @@ **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-10 - [Terminal Accessibility & Color Contrast] -**Learning:** In terminal UIs, the 'bold' attribute often triggers the 'bright' color variant. For colors like blue on a dark background, the non-bold variant can have insufficient contrast, making text difficult to read. -**Action:** When using color-coded instructional or success messages in CLI tools, prefer using 'bold' (e.g., '[bold blue]') to ensure the text remains legible across a wide variety of terminal themes and configurations. +## 2026-04-02 - [Micro-UX Polish for Demo CLI Scripts] +**Learning:** For tutorial-style CLI scaffolds, several micro-UX touches significantly improve the professional feel and onboarding experience: (1) using `random.sample` instead of `random.choices` for unique mock data generation; (2) displaying the total execution duration in the final success panel; and (3) adding descriptive titles to `rich.Rule` components for better visual hierarchy between results and "Next Step" guidance. +**Action:** Ensure all demo scripts use unique mock data, provide performance feedback via execution duration, and utilize rule-titles for clear sectional separation. diff --git a/01_getting_started.py b/01_getting_started.py index e27fc74..09a4026 100644 --- a/01_getting_started.py +++ b/01_getting_started.py @@ -6,7 +6,6 @@ from rich.panel import Panel from rich.rule import Rule from rich.table import Table -from rich import box console = Console() @@ -21,8 +20,6 @@ def get_customer_ids() -> list[str]: ids = [f"customer-{n:02d}" for n in random.sample(range(100), k=5)] # Use random.sample to ensure unique customer IDs in the demo ids = [f"customer-{n:02d}" for n in random.sample(range(100), k=5)] - # Add a brief pause to make the fetching state visible in the UI - time.sleep(0.1) return sorted(ids) @@ -50,7 +47,7 @@ def main(): Panel( Markdown(main.__doc__.strip()), title="Prefect Workflow Guide", - border_style="bold blue", + border_style="blue", padding=(1, 2), ) ) @@ -73,20 +70,15 @@ def main(): duration = time.perf_counter() - start_time # Display results in a clean table for better readability - console.print() table = Table( title="Processing Summary", show_header=True, header_style="bold blue", show_footer=True, - box=box.ROUNDED, ) - table.add_column("Customer ID", style="cyan", footer="Total", footer_style="bold") + table.add_column("Customer ID", style="cyan", footer="Total") table.add_column( - "Status", - style="green", - footer=f"{len(results)} Processed", - footer_style="bold", + "Status", style="green", footer=f"[bold]{len(results)} Processed[/bold]" ) # Use zip to map results back to their original IDs more reliably @@ -112,7 +104,7 @@ def main(): console.print() console.print(Rule("🚀 Next Step", style="bold blue")) console.print( - "[bold blue]Try running [cyan]python 02_logging.py[/cyan] to learn about logging in Prefect![/bold blue]" + "[bold blue]➡️[/bold blue] 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 0ac8369..72e087a 100644 --- a/02_logging.py +++ b/02_logging.py @@ -7,7 +7,6 @@ from rich.panel import Panel from rich.rule import Rule from rich.table import Table -from rich import box console = Console() @@ -22,8 +21,6 @@ def get_customer_ids() -> list[str]: ids = [f"customer-{n:02d}" for n in random.sample(range(100), k=5)] # Use random.sample to ensure unique customer IDs in the demo ids = [f"customer-{n:02d}" for n in random.sample(range(100), k=5)] - # Add a brief pause to make the fetching state visible in the UI - time.sleep(0.1) return sorted(ids) @@ -59,7 +56,7 @@ def main(): Panel( Markdown(main.__doc__.strip()), title="Prefect Workflow Guide", - border_style="bold blue", + border_style="blue", padding=(1, 2), ) ) @@ -82,20 +79,15 @@ def main(): duration = time.perf_counter() - start_time # Display results in a clean table for better readability - console.print() table = Table( title="Processing Summary", show_header=True, header_style="bold blue", show_footer=True, - box=box.ROUNDED, ) - table.add_column("Customer ID", style="cyan", footer="Total", footer_style="bold") + table.add_column("Customer ID", style="cyan", footer="Total") table.add_column( - "Status", - style="green", - footer=f"{len(results)} Processed", - footer_style="bold", + "Status", style="green", footer=f"[bold]{len(results)} Processed[/bold]" ) # Use zip to map results back to their original IDs more reliably @@ -109,19 +101,20 @@ def main(): console.print( Panel.fit( - f"[bold green]✨ Successfully processed {len(results)} customers with detailed logging in {duration:.2f}s![/bold green]", + f"[bold green]✨ Successfully processed {len(results)} customers in {duration:.2f}s![/bold green]", title="Result", border_style="green", ) ) + console.print(Rule("Next Step", style="blue")) console.print(Rule("Conclusion", style="blue")) console.print( "🎉 You've completed the Quickstart! Check out the [cyan]README.md[/cyan] for more features." console.print() console.print(Rule("🎉 Finishing Up", style="bold blue")) console.print( - "[bold blue]You've completed the Quickstart! Check out the [cyan]README.md[/cyan] for more features.[/bold blue]" + "[bold blue]🎉 You've completed the Quickstart! Check out the [cyan]README.md[/cyan] for more features.[/bold blue]" ) return results diff --git a/pyproject.toml b/pyproject.toml index 57aee08..73f535c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,5 @@ dependencies = [ "prefect", "prefect-cloud", "rich", - "fakeredis<2.35.0", ]