Skip to content

feat(docs): run /play on PlaygroundRender from @vite-hub/ui - #394

Merged
vite-hub[bot] merged 16 commits into
mainfrom
feat/play-on-playground-render
Nov 13, 2026
Merged

vite-hub[bot] merged 16 commits into
mainfrom
feat/play-on-playground-render

Conversation

@onmax

@onmax onmax commented Nov 9, 2026

Copy link
Copy Markdown
Owner

docs/play.ts is a 550-line playground engine that only comark-ui can use: a textarea over Shiki paint, panes, debounce, stale-run drop, the iframe, issues, the preset column, hash sync, and the reset dialog, all wired by hand to markup in play/index.vue.

This moves /play onto PlaygroundRender from @vite-hub/ui/playground-render (vite-hub/vitehub#3750). The component owns the editor, the panes, the presets, the link, Download, Reset, and the preview. comark-ui keeps only what is Comark: render() runs Comark with the comarkUi() plugins and the Config pane, playDocument() adds comark-ui's styles and the theme, the Theme form stays in comark-ui (PlayTheme.vue, in the theme slot, writes theme.json), and the stills go in the #preset slot.

Evidence: https://drop.vitehub.dev/d/kvp7gy2qrs89/comark-ui-play-render

What changes for users:

  • The bar has Download (a zip of content.md, config.json, theme.json) and a Gallery link. The per-pane Copy button and the "Playground" title above the presets are gone. Group headings lose their icons.
  • Presets are templates with the default config and theme, so picking a preset resets the config and theme too. Before, a preset kept the tab's config and theme.
  • A theme change re-renders the preview after 200 ms. Before, it changed the preview in place.
  • The preview is sandboxed (allow-scripts allow-popups), so it has no origin. The Theme form reads its colors from a hidden copy of the preview page, and /play/fonts/* sends access-control-allow-origin: * (Worker middleware and routeRules) so Geist still loads.
  • The page renders the playground after presets.json loads, so there is no server-rendered first paint of the editor. presets.json now holds each preset's files and still (900 KB), and presets.html and play.json are gone.
  • Docs example links carry the default config.json, so the Config pane is not empty when a link has no template (about 440 characters per link).

@vite-hub/ui is pinned to the pkg.pr.new build of vite-hub/vitehub#3750 (af71f9d). Move it to a release once #3750 merges. The lockfile diff is the pin alone, and pnpm install --frozen-lockfile passes.

Stacked on #393.

Checks:

  • pnpm docs:build: passes, links checked on 413 pages.
  • node docs/play-links.ts: opened 472 playground states from 493 links.
  • vp test run test/links.test.ts: 3 files, 45 tests pass.
  • pnpm --filter comark-ui-docs typecheck: passes. vp lint and vp fmt --check on the changed files: clean.
  • Headless Chromium on the built site: the default preset renders, typing in Markdown updates the preview, invalid JSON in Config shows its issue and clears when fixed, Violet and Dark in Theme change the preview and the swatches, Copy link round-trips the Markdown and the dark scheme in a new tab, #code=garbage shows the notice, and a docs example link opens with no issues.

Not checked: the CORS header on the deployed Worker (I checked the generated _headers and injected the header locally), mobile layout on a real device, and the system dark mode switching while the page is open.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-09T09:44:38.365915Z
We couldn’t complete this review. Comment @codex review to try again.
71ed52b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The preview no longer follows a system color-scheme change until another playground edit triggers a render.

Reviewed changes in 71ed52b, covering the migration of /play to PlaygroundRender and the surrounding generated data, theme, sharing, preview, and font-serving integration.

  • Shared playground runtime — delegates editors, presets, URL state, reset, download, issues, and the sandboxed preview to @vite-hub/ui/playground-render.
  • Comark rendering and theme pane — retains Comark parsing/rendering and introduces a Vue Theme pane backed by theme.json and a hidden preview probe.
  • Preset and link data — emits complete template files plus rendered stills in presets.json, and includes default config in standalone docs links.
  • Sandboxed font loading — adds CORS headers for /play/fonts/** in Nuxt development and the Cloudflare asset middleware.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-5.6-sol | 𝕏

Comment thread docs/app/components/PlayTheme.vue Resolved
@pkg-pr-new

pkg-pr-new Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@394

comark-badge

pnpm add https://pkg.pr.new/comark-badge@394

comark-cards

pnpm add https://pkg.pr.new/comark-cards@394

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@394

comark-cast

pnpm add https://pkg.pr.new/comark-cast@394

comark-charts

pnpm add https://pkg.pr.new/comark-charts@394

comark-chat

pnpm add https://pkg.pr.new/comark-chat@394

comark-chips

pnpm add https://pkg.pr.new/comark-chips@394

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@394

comark-code

pnpm add https://pkg.pr.new/comark-code@394

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@394

comark-colors

pnpm add https://pkg.pr.new/comark-colors@394

comark-comments

pnpm add https://pkg.pr.new/comark-comments@394

comark-critic

pnpm add https://pkg.pr.new/comark-critic@394

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@394

comark-details

pnpm add https://pkg.pr.new/comark-details@394

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@394

comark-diff

pnpm add https://pkg.pr.new/comark-diff@394

comark-embed

pnpm add https://pkg.pr.new/comark-embed@394

comark-fields

pnpm add https://pkg.pr.new/comark-fields@394

comark-figure

pnpm add https://pkg.pr.new/comark-figure@394

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@394

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@394

comark-github

pnpm add https://pkg.pr.new/comark-github@394

comark-icon

pnpm add https://pkg.pr.new/comark-icon@394

comark-include

pnpm add https://pkg.pr.new/comark-include@394

comark-keys

pnpm add https://pkg.pr.new/comark-keys@394

comark-links

pnpm add https://pkg.pr.new/comark-links@394

comark-linter

pnpm add https://pkg.pr.new/comark-linter@394

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@394

comark-mark

pnpm add https://pkg.pr.new/comark-mark@394

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@394

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@394

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@394

comark-media

pnpm add https://pkg.pr.new/comark-media@394

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@394

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@394

comark-outline

pnpm add https://pkg.pr.new/comark-outline@394

comark-properties

pnpm add https://pkg.pr.new/comark-properties@394

comark-qr

pnpm add https://pkg.pr.new/comark-qr@394

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@394

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@394

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@394

comark-sources

pnpm add https://pkg.pr.new/comark-sources@394

comark-steps

pnpm add https://pkg.pr.new/comark-steps@394

comark-table

pnpm add https://pkg.pr.new/comark-table@394

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@394

comark-tests

pnpm add https://pkg.pr.new/comark-tests@394

comark-time

pnpm add https://pkg.pr.new/comark-time@394

comark-ui

pnpm add https://pkg.pr.new/comark-ui@394

comark-xref

pnpm add https://pkg.pr.new/comark-xref@394

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@394

commit: b323e79

@vite-hub

vite-hub Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Waiting 2026-11-13T12:58:27.629Z 3m 44s
View session Last seen running 2026-11-13T00:09:47.364Z 2s
View session Completed 2026-11-12T08:46:37.276Z 4m 51s
View session Completed 2026-11-12T08:18:52.557Z 9m 57s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

Session

Waiting for GitHub merge request c47c213e-4e3c-4016-8803-3ea28df864bb.

View session

Ready; no repair needed. Pullfrog: no current findings; historical P1 system-theme synchronization and iframe preference propagation fixes remain intact, with resolved threads. All supplied checks pass. Direct Playwright CLI verification passed all five preview tests after installing Chromium; pnpm exec initially failed because its automatic prepare attempted protected Git metadata. git diff --check passes and the checkout is clean. No commit or push.

Session

Merge on green: bot feedback below P1 and failed pullfrog, pullfrog-approval checks do not start a pass; the PR merges when its required checks pass. A person's comment or review, a failing required check, a merge conflict or a head pushed by someone else resumes it.

Session

Merge on green: bot feedback below P1 and failed pullfrog, pullfrog-approval checks do not start a pass; the PR merges when its required checks pass. A person's comment or review, a failing required check, a merge conflict or a head pushed by someone else resumes it.

Session

Waiting for open parent PR #393 to merge; this child has nothing left to repair.

View session

No repair needed. Pullfrog: none; historical P1 theme findings remain fixed. playwright test e2e/play-preview.e2e.ts --workers=1 passed all five cases; focused vp lint and git diff --check passed. All supplied hosted checks are green, and the working tree is clean. This stacked PR awaits open parent #393.

View session

Resolved three base-merge conflicts in 3a27dd2, preserving font CORS and the renderer alias. Frozen installation, 17 focused tests, five Playwright cases, six Nitro request probes, codec round-trip, focused typechecking, lint and formatting passed. Pullfrog: none; historical P1 theme findings remain fixed. Pushed once; awaiting hosted checks.

@pullfrog

pullfrog Bot commented Nov 9, 2026

Copy link
Copy Markdown

No configured credential can serve this run. Your ChatGPT subscription has hit its usage limit, which resets at 2026-11-13 17:11 UTC. Re-trigger after it resets, or add an API key for this provider, which Pullfrog falls back to automatically.

The providers' responses
CODEX_AUTH_JSON: the ChatGPT plan's usage limit is reached

Pick another model →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using gpt-6.1-sol

@pullfrog

pullfrog Bot commented Nov 9, 2026

Copy link
Copy Markdown

No configured credential can serve this run. Your ChatGPT subscription has hit its usage limit, which resets at 2026-11-13 17:11 UTC. Re-trigger after it resets, or add an API key for this provider, which Pullfrog falls back to automatically.

The providers' responses
CODEX_AUTH_JSON: the ChatGPT plan's usage limit is reached

Pick another model →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using gpt-6.1-sol

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The newly loaded renderer stylesheet forces implicit previews to light, overriding the system scheme.

Reviewed changes since the previous Pullfrog review, covering the system-theme repair, its browser tests, and integration with the updated design-system base.

  • Added in-frame theme following — moved playDocument() into docs/preview.ts and added a media listener and responsive fallback colors without changing shared files.
  • Added browser regression coverage — tested implicit and explicit schemes and custom colors, then corrected the test types.
  • Separated playground dependencies — switched playground imports to @vite-hub/ui-playground, upgraded that alias, and loaded its stylesheet before the current UI styles.

Verification passed: production docs build, workspace and docs typechecks, 44 link tests, five focused preview tests, and built checks covering 413 pages and 472 playground states. An additional browser check using native iframe scheme propagation reproduced the issue inline.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

Comment thread docs/nuxt.config.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found. No P0 or P1 findings remain.

Reviewed changes since c381a60, focused on the native preview color-scheme fix and its regression coverage.

  • Allowed native scheme propagation — scoped the preview iframe override to permit light and dark preferences while preserving explicit preview themes.
  • Strengthened browser regression coverage — loaded the shipped stylesheets and replaced global media emulation with native iframe preference propagation, covering implicit transitions, explicit schemes, and custom colors.

Verification passed: all five focused Chromium tests, lint, formatting, and strict focused typechecking.

Pullfrog  | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found. No P0 or P1 findings remain.

Reviewed changes since 114740c, focused on the playground integration's reconciliation with the updated stacked base.

  • Reconciled asset handling — Preserved sandboxed-font CORS with Nitro's native handler and request URL handling, without consuming downstream POST bodies.
  • Reconciled dependencies — Retained the renderer-capable playground alias alongside the updated shared ViteHub dependencies and refreshed pin documentation.

Verification passed: frozen dependency installation, five asset-routing unit tests, five Chromium preview tests against the updated stylesheets, middleware lint, and Nitro H3 integration checks for font CORS, response preservation, badge bypass, POST-body preservation, and missing-asset fallthrough.

Pullfrog  | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found. No P0 or P1 findings remain.

Reviewed changes since 3a27dd2, focused on dependency reconciliation with the updated stacked base.

  • Preserved the playground renderer — Retained the renderer-capable af71f9d alias and reconciled its lockfile peer graph with the updated shared ViteHub build.
  • Updated shared dependency pins — Incorporated the base's bc43707 build and refreshed the dependency-pin documentation without changing playground application code.

Verification passed: frozen dependency installation, all five Chromium preview tests with both installed stylesheets, renderer and codec imports, shared Vue instance resolution, and standalone/preset share-link round trips across both codec builds.

Pullfrog  | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

@vite-hub
vite-hub Bot changed the base branch from feat/shared-playground-links to main November 13, 2026 12:58
@vite-hub
vite-hub Bot merged commit 704ee3f into main Nov 13, 2026
6 checks passed
@vite-hub
vite-hub Bot deleted the feat/play-on-playground-render branch November 13, 2026 13:04
@github-actions github-actions Bot mentioned this pull request Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant