Skip to content

Add presentation slideshow, expand docs examples#414

Merged
jlowin merged 4 commits intomainfrom
examples-and-slideshow
Apr 9, 2026
Merged

Add presentation slideshow, expand docs examples#414
jlowin merged 4 commits intomainfrom
examples-and-slideshow

Conversation

@jlowin
Copy link
Copy Markdown
Member

@jlowin jlowin commented Apr 8, 2026

Adds a presentation slideshow example that exercises the new key bindings feature, a set of mini examples for blog embeds, and a broad expansion of the docs examples gallery. Also fixes two previews that were silently broken.

Presentation (examples/presentation/): fleet_performance.py (DataTable with progress gauges), cost_overview.py (pie + area chart), and slideshow.py (stitches them with arrow-key nav, prev/next buttons, and a Shift+? shortcuts dialog).

Mini examples (examples/mini/): hello_world, reactive_binding, dynamic_list, conditional, actions — small self-contained PrefabApps for blog embeds. Removes the old loose dashboard.py/growth.py/etc.

Docs examples gallery: seven new pages — actions, conditional, deploy-pipeline, dynamic-list, expense-tracker, reactive-binding, server-dashboard — and a restructured nav (Interactivity / Data & Visualization / Apps). Updates contract fixtures for Dialog.dismissible and Kbd.

Broken-preview fixes:

  • cross-filter referenced metrics_north, metrics_all, etc. in a let binding but never loaded them into state — the dashboard rendered empty. Wraps the layout in a PrefabApp(state=...) with flattened per-region keys.
  • server-dashboard passed variant names into Metric.delta, which rendered as neutral "— success" / "— stable" badges. Drops the bogus deltas, pins the app container to max-w-md to stop it from flexing width each tick, and makes Uptime/Requests/p99 Latency reactive.
# cross-filter: state is now flattened and wired through the let binding
state = {"region": "all"}
for prefix, data in (("metrics", metrics), ("monthly", monthly), ...):
    for region in REGIONS:
        state[f"{prefix}_{region}"] = data[region]

with PrefabApp(state=state, css_class="max-w-none p-0"):
    with Dashboard(columns=12, let={"m": pick("metrics"), ...}):
        Metric(label="Revenue", value=m.revenue.currency())

Presentation slides (fleet_performance, cost_overview) with a
slideshow that uses keyboard shortcuts for navigation. Mini examples
for blog embeds: hello_world, reactive_binding, dynamic_list,
conditional, actions. Removes old loose example files. Updates
contract fixtures for Dialog.dismissible and Kbd.
@marvin-context-protocol marvin-context-protocol Bot added documentation Updates to docs, examples, or guides. Primary change is documentation-related. python Related to the Python SDK: components, actions, serialization. labels Apr 8, 2026
jlowin added 2 commits April 9, 2026 09:47
Adds seven new example pages (actions, conditional, deploy-pipeline,
dynamic-list, expense-tracker, reactive-binding, server-dashboard) and
restructures the examples nav into Interactivity / Data & Visualization /
Apps groups.

Fixes two broken previews:
- cross-filter: the let-binding referenced metrics_north/etc. which
  were never loaded into state. Wraps the layout in PrefabApp(state=...)
  with flattened per-region keys and moves the let onto Dashboard.
- server-dashboard: removes delta=variant_name misuse on the CPU/Memory
  metrics (was rendering as a neutral "— success"/"— stable" badge),
  pins the app to max-w-md so width is stable across ticks, and makes
  Uptime/Requests/p99 Latency actually react to tick.
Slide-producing helpers (fleet_performance, cost_overview) now accept
a css_class argument so the slideshow can apply a shared min-height,
preventing layout jumps when switching slides. Adds a brief README
for examples/mini/ and examples/presentation/.
@jlowin jlowin changed the title Add presentation slideshow with keyboard nav, mini examples Add presentation slideshow, expand docs examples Apr 9, 2026
@jlowin jlowin merged commit 10d353d into main Apr 9, 2026
1 check passed
@jlowin jlowin deleted the examples-and-slideshow branch April 9, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Updates to docs, examples, or guides. Primary change is documentation-related. python Related to the Python SDK: components, actions, serialization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant