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
4 changes: 4 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@
## 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.

## 2026-04-04 - [Consistent Visual Hierarchy and Accessibility in CLI]
**Learning:** Using 'bold blue' for all structural components (Panels, Rules, and instructional text) creates a strong, consistent visual hierarchy and improves accessibility by ensuring sufficient contrast. Applying `footer_style="bold"` in `rich.table.Table` definitions instead of inline markup maintains cleaner code and consistent visual weight for summary data.
**Action:** Standardize on `bold blue` for CLI structural elements and use explicit `footer_style` properties in tables to ensure high-contrast, professional-grade terminal interfaces.
28 changes: 9 additions & 19 deletions 01_getting_started.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ def get_customer_ids() -> list[str]:
"""Fetch customer IDs from a database or API."""
# Use sorted and zero-padded IDs for better terminal alignment
# Use random.sample to ensure unique IDs in the demo output
# Use random.sample to ensure unique customer IDs
ids = [f"customer-{n:02d}" for n in random.sample(range(100), k=5)]
# Using random.sample ensures unique IDs for a more realistic demo
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)]
return sorted(ids)

Expand Down Expand Up @@ -50,7 +45,7 @@ def main():
Panel(
Markdown(main.__doc__.strip()),
title="Prefect Workflow Guide",
border_style="blue",
border_style="bold blue",
padding=(1, 2),
)
)
Expand All @@ -71,9 +66,10 @@ def main():
results = [f.result() for f in futures]

# Calculate duration
duration = time.perf_counter() - start_time

# Add visual breathing room before results
console.print()
duration = time.perf_counter() - start_time

# Display results in a clean table for better readability
table = Table(
Expand All @@ -83,9 +79,12 @@ def main():
show_footer=True,
box=box.ROUNDED,
)
table.add_column("Customer ID", style="cyan", footer="Total")
table.add_column("Customer ID", style="cyan", footer="Total", footer_style="bold")
table.add_column(
"Status", style="green", footer=f"[bold]{len(results)} Processed[/bold]"
"Status",
style="green",
footer=f"{len(results)} Processed",
footer_style="bold",
)

# Use zip to map results back to their original IDs more reliably
Expand All @@ -95,8 +94,6 @@ def main():
console.print(table)
console.print()

duration = time.perf_counter() - start_time

console.print(
Panel.fit(
f"[bold green]✨ Successfully processed {len(results)} customers in {duration:.2f}s![/bold green]",
Expand All @@ -105,17 +102,10 @@ def main():
)
)

console.print(Rule("Next Step", style="blue"))
console.print(
"➑️ Try running [cyan]python 02_logging.py[/cyan] to learn about logging in Prefect!"
console.print(
"Try running [cyan]python 02_logging.py[/cyan] to learn about logging in Prefect!"
console.print(
"Try running [cyan]python 02_logging.py[/cyan] to learn about logging in Prefect!"
console.print()
console.print(Rule("πŸš€ Next Step", style="bold blue"))
console.print(
"[bold blue]➑️[/bold blue] Try running [cyan]python 02_logging.py[/cyan] to learn about logging in Prefect!"
"[bold blue]➑️[/bold blue] [bold blue]Try running[/bold blue] [cyan]python 02_logging.py[/cyan] [bold blue]to learn about logging in Prefect![/bold blue]"
)

return results
Expand Down
30 changes: 9 additions & 21 deletions 02_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ def get_customer_ids() -> list[str]:
"""Fetch customer IDs from a database or API."""
# Use sorted and zero-padded IDs for better terminal alignment
# Use random.sample to ensure unique IDs in the demo output
# Use random.sample to ensure unique customer IDs
ids = [f"customer-{n:02d}" for n in random.sample(range(100), k=5)]
# Using random.sample ensures unique IDs for a more realistic demo
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)]
return sorted(ids)

Expand Down Expand Up @@ -59,7 +54,7 @@ def main():
Panel(
Markdown(main.__doc__.strip()),
title="Prefect Workflow Guide",
border_style="blue",
border_style="bold blue",
padding=(1, 2),
)
)
Expand All @@ -80,9 +75,10 @@ def main():
results = [f.result() for f in futures]

# Calculate duration
duration = time.perf_counter() - start_time

# Add visual breathing room before results
console.print()
duration = time.perf_counter() - start_time

# Display results in a clean table for better readability
table = Table(
Expand All @@ -92,9 +88,12 @@ def main():
show_footer=True,
box=box.ROUNDED,
)
table.add_column("Customer ID", style="cyan", footer="Total")
table.add_column("Customer ID", style="cyan", footer="Total", footer_style="bold")
table.add_column(
"Status", style="green", footer=f"[bold]{len(results)} Processed[/bold]"
"Status",
style="green",
footer=f"{len(results)} Processed",
footer_style="bold",
)

# Use zip to map results back to their original IDs more reliably
Expand All @@ -104,29 +103,18 @@ def main():
console.print(table)
console.print()

duration = time.perf_counter() - start_time
console.print(
Panel.fit(
f"[bold green]✨ Successfully processed {len(results)} customers with detailed logging in {duration:.2f}s![/bold green]",

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("Conclusion", style="blue"))
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(
"πŸŽ‰ You've completed the Quickstart! Check out the [cyan]README.md[/cyan] for more features."
"[bold blue]πŸŽ‰ You've completed the Quickstart! Check out the[/bold blue] [cyan]README.md[/cyan] [bold blue]for more features.[/bold blue]"
)

return results
Expand Down
Loading