Repository navigation
Conversation
A `demo` Playground prop (through HooksPlayground and FrameworkPlayground) puts the preview first at the playground's full width, with room for a realistic app, and keeps the code behind a Code toggle in the preview's header: pressed, the code (row's file tabs) takes the result's place and the label reads Editor; never both at once. The result stays mounted, so the app's state and the Store survive, and the code is in the HTML as always; Monaco mounts when the code is first shown. The result and the code share one minimum height so pages and code trade places without moving the page. The Store opens beside the result as when stacked, and over the code its header toggle brings the preview back. DesignSystem/design-system.css grows into a kit for demo content, scoped to the preview in both themes: tokens (text, muted, surface, border, accent, radii, spacing, type scale), element styles (headings, text, links, plain buttons with a `primary` variant, inputs) and classes for an app header, cards, lists with dividers (`listItem`, restyled), bylines and meta text. The demo styles from styles.module.css move there. Avatar takes a `size`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018FerSYMdRyzxaKQdv64mGf
- Code toggle and Store toggle share one HeaderToggle; the Code control (CodeControl: shown + toggle) reaches PreviewWrapper from index.tsx, so it is in the header before the live preview loads, and the header's label trades for "Editor" (editorLabel, shared with EditorSurface) - Store toggle over the code brings the preview back with whatever it says (toggleStoreInPreview) - demo layout: code panel squares its top corners under the header (data-code), preview and code share --pg-demo-min, first Code press keeps the page in place - design system: tokens scoped to .playground-preview (--ds-*), dark surfaces step from --pg-preview-bg, h1 sizing over theme-classic's first-child rule, generic link rules dropped (alerts keep theirs) - tests: PreviewWrapper label swap via the code control; demoLayoutLive mocks the lazy LivePreview (its chunk's ESM deps can't load in jest) - translations finalized for playground.code.show/hide Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018FerSYMdRyzxaKQdv64mGf
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Staff engineer (Cursor agent): LGTM at 615c1e4, with one follow-up trigger and no changes requested for this PR. What holds up architecturally:
Follow-up trigger (not for this PR): layout is now two booleans, and What I validated: I read the full diff through the GitHub API. I checked in |
Codecov Report✅ All modified and coverable lines are covered by tests. Please upload reports for the commit dd99d2f to get more accurate results. Additional details and impacted files@@ Coverage Diff @@
## master #4423 +/- ##
==========================================
- Coverage 98.37% 98.37% -0.01%
==========================================
Files 161 161
Lines 3073 3072 -1
Branches 604 604
==========================================
- Hits 3023 3022 -1
Misses 10 10
Partials 40 40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks. Agreed on the follow-up trigger: three layouts don't justify changing the public prop yet. If a fourth layout shows up, or a page needs both Generated by Claude Code |
|
Docs preview: https://docs-site-pr-4423-data-client.vercel.app Built from dd99d2f merged into |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 615c1e4. Configure here.
On a wide demo the Store's side strip hides with the preview while the code shows, so the header's Store toggle stands in for it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018FerSYMdRyzxaKQdv64mGf
Demo apps and the preview frame follow the site redesign's "live store console": flat panels ruled by 1px lines, its light and dark palette, small mono uppercase section labels, one blue for links, primary buttons and focus, and a 44px mono preview header with a green live dot. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018FerSYMdRyzxaKQdv64mGf
|
Staff engineer (Cursor agent): Still LGTM at d3ac8a1 (the Control Room console look). This is the delta since a16b2c0: The direction is good. The design system now reads the palette from one place, the frame's FOLLOW_UP (no change needed here): the palette is copied as hex from the site redesign, and that redesign isn't in this repo yet. Today it's split between two files: the panel, well, line and text are in Optional nit: What I validated: I read the full a16b2c0...d3ac8a1 compare. I grepped the head tree to confirm that What I didn't do: I didn't look at the rendered site visually, and |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018FerSYMdRyzxaKQdv64mGf
|
Thanks. I took both points. Nit, fixed in c968df1: I confirmed the numbers. The 11px faint label measured 4.22:1 on the well in light and 4.26:1 in dark. FOLLOW_UP, queued as its own item: it's in the project's work queue as item 95, "point the demo palette at the site redesign's tokens". It starts only after this merges and the redesign's palette is in the site CSS. It covers both halves: the Generated by Claude Code |
…-end meta in the demo design system Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C8xTb3f4ys9x7gfbwPacsx
|
Moved here from #4444 (f9c63f3) so the design system can be iterated on in one place:
Tests: Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018FerSYMdRyzxaKQdv64mGf

Motivation
Before: every playground shows its code and its preview at the same time, so a live demo gets a small box under or beside the code. What it renders is mostly bare
h3/p/divmarkup, so demos look like markup rather than an app, and anything realistic doesn't fit.After: a playground can be a demo, with the app shown first. The preview takes the playground's full width, with a minimum height that keeps the page still while the app moves between pages. The code is hidden by default. A Code button in the preview header swaps the preview for the code and back, so the two are never on screen together. Demo apps also get a design system: they look like a real app in both themes, without importing anything.
Solution
demoprop: a newdemoprop onPlayground, passed throughHooksPlaygroundandFrameworkPlayground.aria-pressed) swaps the preview for the editor. The header label reads "Editor" while the code shows.DesignSystem/design-system.cssnow holds all the styling for demo content.--ds-*for text, muted text, surface, border, accent, radii, spacing, type scale and control padding, in light and dark. Dark surfaces are derived from the preview's background.small, buttons (primary), inputs,navandfieldset.appHeader/appTitle,card,listItem(restyled with dividers),bylineandmeta.Avatar: takes asize.styles.module.cssmove here.Checked in a browser at 1280px (light and dark) and 375px with touch: the Code toggle, Store from the code view, and the code panel with one or several files. Existing
listItem, board, form, vote and alert demos look the same or tidier. The first user is the async boundary demo in #4381, which is stacked on this PR.Open questions
None.
Generated by Claude Code
Note
Medium Risk
Touches core Playground layout, lazy Monaco loading, and broad preview CSS; risk is mostly visual/regression on existing playgrounds rather than auth or data paths.
Overview
Adds a
demoplayground layout: the live preview is full-width and shown first, with source code behind a Code toggle in the preview header (preview and editor never appear together). The preview stays mounted when code is visible so app state is preserved; Monaco loads only after the code is first opened; SSR still includes static code. Store behavior matches stacked layout, and using Store from the code view returns to the preview.Introduces a playground design system for demo UIs: large
design-system.css(tokens, layout classes likeappHeader/card/list, console styling), preview frame tokens (--pg-*), and moves demo styling out ofstyles.module.css. AddsToaster/ globaltoast, optionalAvatarsize, and wires these through Monaco type libs, doc example checking (checkExamples.mjs), and framework-docs README.i18n for show/hide code strings; Jest mocks for
useIsomorphicLayoutEffectand expanded theme-common stubs; tests for demo layout SSR/toggles and Toaster.Reviewed by Cursor Bugbot for commit dd99d2f. Bugbot is set up for automated code reviews on this repo. Configure here.