In-browser WASM playground + site-wide UX/design polish#35
Merged
Conversation
- Feature-gate cli (clap+reqwest) behind default-on 'cli' feature; extract pure URL policy + spec parsing into src/spec_source.rs so the library compiles on wasm32-unknown-unknown with --no-default-features - Add wasm/ workspace member wrapping the in-memory pipeline for the browser; output is byte-identical to 'openapi-to-rust generate <SOURCE>' (verified by diff) and includes a complete compilable crate file set - Playground page: paste/URL-fetch/example inputs, Web Worker generation, highlighted tabbed output, downloadable runnable crate as .tar.gz - Deploy via artifact pull, no Vercel secrets: playground-wasm.yml publishes the bundle as a public release asset and bumps website/playground-wasm.lock; the website prebuild fetch script stages the pinned asset when no local build exists (bootstrap release playground-wasm-0.7.0-bootstrap is live) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Attach the download anchor to the DOM and defer blob-URL revocation; immediate revoke after click races the browser's blob fetch and stalled downloads outside headless Chromium. Button shows Preparing… while packing. - Downloaded crate now declares edition 2024 (matches the generator repo); verified cargo build passes for simple and Anthropic-spec crates. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two critique->fix rounds (score 25/40 -> 37/40, browser-verified): - Fix P0 mobile clipping: .playground and .doc-shell single-column grids used 1fr (min-content) with overflow:clip, making tabs/Copy/Download and docs body text unreachable at <=900px; now minmax(0,1fr) + pane min-width - Style runtime-created result tabs via is:global (scoped styles can't match JS-created elements); aria-pressed, 40px targets, hover state - Queue generation while WASM loads (was a silent no-op) with a status notice and auto-run on ready - Keep last good result visible (dimmed) when a generate fails; role=alert/ role=status on notices; result scrolls into view in single-column layout - types.rs tab first / REQUIRED_DEPS.toml last; pluralize stats; reset stale example-dropdown label on edit - Remove nested <main> on /playground; add WebApplication JSON-LD - Homepage secondary CTA now sells the playground - compressHTML:false — it stripped newlines before inline <a>/<code>, jamming words together on 6 pages; html-validate config drops the now-noisy trailing-whitespace rule - Type scale: doc-page h1 clamp 5.7->4.2rem (compare h1 was 84px and broke the product name), compact playground hero (Generate above the fold), all microtext >=12px, cap footer/verification-note line length - Docs "Last reviewed" + dateModified now opt-in per page (was a hardcoded fabricated default no page overrode) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The hero sold the 30-second path (cargo install) while the 5-second one sat behind a secondary button. The install card is now a spec->Rust teaser linking to /playground (YAML schema, "about 5 seconds" divider, generated struct), the primary CTA is "Try it in your browser", and the CLI install moved to a secondary button plus a copy-able line in the closing band so the cargo-install intent keyword stays on the page. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The fetch script no-op'd whenever public/playground/pkg/ existed, so a long-lived local checkout kept serving a stale bundle forever after the lock bumped. The staged bundle now carries a .source-tag stamp: "local" (written by build-playground-wasm.sh) always wins, a stamp matching the lock is a no-op, and anything else refetches the pinned release asset. A failed refetch keeps a working staged bundle with a warning instead of blocking dev. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
git push origin main was hardcoded, so a workflow_dispatch off a feature branch would fail at the final step (no local main ref). Push back to GITHUB_REF_NAME instead: identical on main, and pre-merge test runs bump the lock on their own branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adding [workspace] members=["wasm"] for the playground made cargo adopt the spec-compile scratch crates under tmp/, failing every cargo check with "current package believes it's in a workspace when it's not". The generated scratch manifest now carries an empty [workspace] table, and the root workspace excludes tmp/ so ad-hoc generator runs stay out too. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
1.
/playground— the real generator, in the browser (earlier commits on this branch)openapi-to-rustcompiled to WebAssembly, running in a worker; paste/fetch a spec, get the generated files, download a complete crate as.tar.gz(hand-rolled ustar + nativeCompressionStream). Nothing is uploaded.2. Design-critique loop over the whole site (
cb96b6e) — two dual-agent critique→fix rounds, score 25/40 → 37/40, every fix verified in a real browser at 390/768/1440:.doc-shellused1frsingle-column grids (min-content) underoverflow: clip, making tabs/Copy/Download and docs body text unreachable ≤900px →minmax(0, 1fr).is:global,aria-pressed, 40px targets.role=alert/role=statuson notices; result scrolls into view in single-column layout.compressHTMLwas stripping the newline before inline<a>/<code>, jamming words together ("…review theschema notes") in 12+ places across 6 pages →compressHTML: false(+ html-validate config drops the now-conflicting trailing-whitespace rule).<main>removed;types.rstab first; stats pluralization; stale example-dropdown label reset; doc h1 scale 5.7→4.2rem (compare h1 was 84px, breaking the product name); all microtext ≥12px; docs "Last reviewed"/dateModifiednow opt-in instead of a hardcoded fabricated date;/playgroundgainedWebApplicationJSON-LD.3. Homepage hero leads with the playground (
eea9a5d)/playground("about 5 seconds, in your browser"); primary CTA "Try it in your browser";cargo install --locked openapi-to-rustkept on-page in the closing band for the install-intent keyword.Verification
astro check: 0 errors ·html-validateoverdist/: clean · repo SEO audit: 10/10 pages pass.impeccable/critique/🤖 Generated with Claude Code