Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
16 changes: 4 additions & 12 deletions 01_getting_started.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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)


Expand Down Expand Up @@ -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),
)
)
Expand All @@ -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
Expand All @@ -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
Expand Down
19 changes: 6 additions & 13 deletions 02_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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)


Expand Down Expand Up @@ -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),
)
)
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ dependencies = [
"prefect",
"prefect-cloud",
"rich",
"fakeredis<2.35.0",
]

Loading