Repository navigation
docs(playground): Show fixtures in row playgrounds from the live preview's header - #4386
Conversation
Row playgrounds hid their fixtures entirely. A "ƒ Fixtures" toggle now sits at the end of the code's file tab bar and unfolds the fixture rows above the code, so row stays compact (no added height while closed). Narrow, it shows just the ƒ. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
|
Docs preview: https://docs-site-pr-4386-data-client.vercel.app Built from a9d1a05 merged into |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4386 +/- ##
=======================================
Coverage 98.37% 98.37%
=======================================
Files 161 161
Lines 3072 3072
Branches 604 604
=======================================
Hits 3022 3022
Misses 10 10
Partials 40 40 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Only multi-file row playgrounds fold fixtures behind the toggle; a single-file row shows them as stacked does, so no lone tab or empty tablist appears. Reuse clean-btn and the ƒ mark, transition the hover background, and map useIsomorphicLayoutEffect to a Jest stand-in. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
…n open The row layout wraps the files in the Store's cover, which never got the folded fixtures, so the toggle opened nothing. The open toggle also set the selected tab's light text on the light bar; it now keeps the bar's hover colors in both themes. The test renders row with a cover, as Playground does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
|
Staff engineer (Cursor agent): LGTM at 855f77e, with one small follow-up you can fold in here or skip. Follow-up (not blocking): What I validated, and how:
Not checked: I didn't open the page in a browser or look at it, and I didn't run the Jest tests locally. CI at d6e84fa was green except |
Nathaniel's review: the labeled toggle crowded the tab bar, and fixtures pushed in below didn't read as the open control. The tab bar now holds just a ƒ (labeled for screen readers). Hovering it previews the fixtures in a layer floating over the code; a click or tap pins them open, which is also the touch path. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
--pg-bar-edge is transparent outside EndpointPlayground. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
|
Folded in the separator follow-up: I confirmed that Generated by Claude Code |
Nathaniel: it blended into the code. It's now an inset card, lighter than the code, bordered and shadowed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
Nathaniel: the lighter card clashed and looked detached from the ƒ. The ƒ now opens like a selected tab (code color, accent top edge) and the card is its panel in the same color, hung from the bar's end, lifted off the code by an edge and shadow. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
The popover's z-index escaped .editorDocs, painting over the Store layer and its badge; isolating .editorDocs keeps it with the code it covers. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
Nathaniel: fixtures stand in for network calls, so a network icon says what they are better than the ƒ. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
One fragment instead of two values rendered in both cover branches, the duplication that once dropped the popover from one of them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
Readers inspect fixtures when they look at what the demo did, as with the Store, so the network toggle sits beside the Store's in the preview header and the fixtures float over the result. The code tab bar is back to plain file tabs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
|
Staff engineer (Cursor agent): FOLLOW_UP only — no change requested on this PR. Tip Validated
Follow-ups after merge (design trade-offs, not blockers)
Inferred, not checked: commonality of 1280px reader width; real devices; that pin-only grow is the simplest fix. |
… loads A short row result clipped an unfolded response to a ~90px scroll box, so the result grows while the fixtures are pinned. The loading (SSR and crawler) preview now carries the fixtures toggle too, instead of it appearing only once the live preview loads. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
|
Both follow-ups are folded into this PR in 39dbe74, since each was small and made the change better:
Checked in a production build: the toggle's class is in the useSuspense and useDLE HTML, there are no hydration warnings, and the preview tests pass. Generated by Claude Code |
Side by side, the preview column was too thin for a response, so the fixtures panel now spans the code too. The preview is no longer their containing block there, so its clip doesn't cut them off. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit de4bd47. Configure here.
Side by side, pinned fixtures painted over an opened Store; the Store's layers now sit above them, and the code's own (Monaco's) stay below. Stacked, a pinned panel taller than the room it gets was clipped with no way to scroll, so it now caps at that same height. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
With a demo's back/home controls in a header under 36rem, the label keeps only its dot (still named for screen readers), so the path gets the room instead of truncating. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
Side by side, the panel spanned the whole playground, which on wide playgrounds ran far past what a response line needs. It now hangs from the preview's right edge at up to 36rem. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
Name the toggle with aria-label/title like the Store's, share its lit state rule, and fade the panel with the site's motion token (instant under reduced motion) and the Store's line color. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
The Fixtures header above the code now carries the same icon as row playgrounds' preview toggle, so readers learn it in both layouts. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA

Before: row playgrounds (code beside the preview, e.g. /docs/api/useDLE) hid their fixtures entirely, so readers couldn't see what the demo's mocked endpoints return. In a narrow preview, a navigating demo's path was truncated to "/pos…" next to the Live Preview label.
After: the Live Preview header gets a small network icon (up/down arrows, like the devtools Network tab) beside the Store toggle. Hovering it previews the fixtures (the same collapsed rows as #4379) in a floating panel. Clicking or tapping pins the panel open, and that is also how it works on touch screens. The panel hangs from the preview's right edge and is up to 36rem wide. When code and preview sit side by side, it extends left over the code so a response has room. When they're stacked, it covers the result, and the result grows while the panel is pinned. Neither the code nor the preview moves. Stacked playgrounds' "Fixtures" header above the code shows the same icon, so readers learn it in both layouts. When a demo navigates and the header is narrow, "Live Preview" shrinks to its red dot, so the path shows in full.
Readers want the fixtures when they inspect what the demo did, the same moment they reach for the Store, so the toggle sits with the Store's in the preview rather than in the code's tab bar.
How:
PreviewWrappertakes an optionalfixturesnode. When it's set, it renders aheaderButtontoggle (withNetworkIcon, named byaria-label/titlelike the Store toggle,aria-expanded/aria-controls), plus an absolutely positioned popover in a zero-height anchor under the header.index.tsxbuilds theFixturePreviewonce. For row playgrounds it goes toLivePreviewand toPreviewLoading, so the toggle is in the SSR HTML too.[data-open](the click/tap pin) or, under@media (hover: hover), while the pointer is on the toggle or the popover (:has()). It fades with--motion-smooth, andvisibilitytransitions with it so the pointer can cross into it.width: min(100%, 36rem). Side by side, the preview isn't positioned, so its containing block is the playground and the preview's clip doesn't cut it off. The Store layers (z 2/3) stay above it, and.editorDocsis isolated so Monaco's layers stay below it..previewHeaderwhen it holds router controls.EditorSurface's Fixtures header gets theNetworkIcon.Checked in production builds on /docs/api/useDLE, /docs/api/useSuspense, /docs/getting-started/data-dependency, /docs/concepts/error-policy and the homepage demo, at 1600, 1280, 375 and 360px, in light and dark, with hover, click and tap. No sideways scroll and no hydration warnings at any width.
Adds
PreviewWrapper.test.tsx.Website-only, so no changeset.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LmaSKAuPn9J3ULHbYcxKmA
Note
Low Risk
Website-only playground UI and CSS; no API or data-path changes, covered by a focused component test.
Overview
Row-layout playgrounds no longer hide mocked API fixtures: they move from the code column into the Live Preview header via a new network icon toggle (with matching icon on the stacked editor fixtures header for visual consistency).
PreviewWrapperaccepts optionalfixturesand renders an accessible header button plus a right-anchored popover that previews on hover (pointer devices) and pins on click/tap.PlaygroundbuildsFixturePreviewonce and passes it toLivePreviewandPreviewLoadingin row mode so fixtures work during SSR/loading too. CSS positions the panel over the result (and over the code when side-by-side), adjusts z-index vs the Store drawer, and visually hides the "Live Preview" label text on narrow headers when router path controls need space.Adds
NetworkIcon,PreviewWrappertests, and smallDemoLabelmarkup tweaks for the label text wrapper.Reviewed by Cursor Bugbot for commit a9d1a05. Bugbot is set up for automated code reviews on this repo. Configure here.