Repository navigation
chore(playground): prototype TSX drafts in an AppKit playground - #706
MarioCadenas wants to merge 3 commits into
Conversation
Adds apps/tsx-drafts: a plain AppKit app plus a script that writes a shared mock.ts and 3 appkit-ui TSX design pages in parallel, type-checks them with up to 2 fix rounds, renders each at /design/<name> behind its own error boundary, and prints per-draft timings. 'pnpm try' runs it end to end. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
|
Review 1 · Pass · 2 minor, 1 trivial Does the change do what the task asked? Yes. Gate: major and worse must be fixed. The prototype does what was asked. I ran it live on a fresh Tetris prompt: the mock contract streamed first, all 3 drafts type-checked on the first try and rendered in light and dark, and everything was ready in 31.4s against the ~94s baseline. The only problems I found are small: one clipped layout in a generated draft, and a failed mock.ts takes down the whole run instead of failing cleanly. Not required (below the gate)
|
🤖 AppKit PR bot🔬 Run evalsStart an eval for this PR from the evals-monitor app: Go to Evals Monitor → 📦 Try this PR's app templateScaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh run download 41922071930 -R databricks/appkit -n appkit-template-0.90.0-pr.9d3c840-work-37-prototype-tsx-drafts-in-an-app-706 -D appkit-pr-706 \
&& unzip -o "appkit-pr-706/appkit-template-0.90.0-pr.9d3c840-work-37-prototype-tsx-drafts-in-an-app-706.zip" -d "appkit-pr-706" \
&& databricks apps init --template "appkit-pr-706"The template pins |
The playground home page now takes a prompt and refinement answers, runs the 3 draft writers through POST /api/drafts, shows live progress per draft, and previews each option in an A/B/C selector (with a dark-mode toggle) as soon as it compiles. pnpm try now stops the whole dev server process group. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
|
Review 2 · Fail · 1 major, 1 minor, 1 trivial Does the change do what the task asked? Yes. Gate: major and worse must be fixed. The playground builds what the task asked for: a shared mock.ts written in parallel with 3 tool-less cached writers, tsc with 2 fix rounds, a per-draft error boundary, compile-gated display, a one-command try script, a browser builder, and timings for all 3 app types that come in well under the 94s baseline. The live server works: the builder and drafts render with no browser errors and no color literals. The remaining gaps are an untidy failure path when the mock writer fails, and a visual-quality criterion that has screenshots but no side-by-side comparison with the HTML drafts. Required
Not required (below the gate)
|
A failed mock.ts used to reject inside every page writer, so Promise.all threw, the browser and status ticker leaked, and status.json was never marked done. Each draft now catches its own failure, the contract always resolves, and the run ends with done: true and the reason on each failed draft. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
|
Review 3 · Pass · 1 minor Does the change do what the task asked? Yes. Gate: major and worse must be fixed. F4 is fixed: the mock writer's promise no longer rejects into Promise.all, each draft catches its own failure, and cleanup plus saveStatus(true) always run. F6 is addressed with a second run per prompt. F5 is still open as a minor gap, because there are still no HTML-draft screenshots to compare against. Not required (below the gate)
|
The prototype answers yes: drafts written directly as appkit-ui TSX pages worked for all three app types. All 9 drafts compiled and rendered with no runtime errors, and all 3 drafts for an app were ready in 25–59s, against today's ~94s for the HTML drafts. It's on branch
work/37-prototype-tsx-drafts-in-an-app(commitd63d0e1ca, new app inapps/tsx-drafts), andpnpm checkpasses.Try it yourself
pnpm install && pnpm build. The build is needed because the playground uses appkit-ui's built output.ug-oauth-dbc-a5d4177a-49dc…; the plaindbc-a5d4177a-49dcprofile's login has expired.databricks auth profilesshows which ones are valid.apps/tsx-drafts:DATABRICKS_CONFIG_PROFILE=<profile> pnpm try --name myapp --prompt "..." --answers "..."Optional:
--shots <dir>saves light and dark screenshots, and--effort/--modelchange the model settings.http://localhost:8000/design/myapp-a,-band-c. Add?theme=darkfor dark mode. It starts the dev server (or reuses one already on port 8000) and keeps it running until you press Ctrl+C.Timings
Seconds from the start of the run (prompt and answers in). Sonnet 5.5, low effort, one run per prompt.
Two changes made the difference. Run fully in parallel, every draft guessed the mock data's export names wrong and needed a fix round (95s). Now the mock writer sends its list of exports first, and the drafts start from that about 5s in. The other change was low effort: by default Sonnet 5.5 spends 10–25s thinking before it writes anything. The gateway rejects turning thinking off directly, so low effort was the only way I found to skip it. Code quality held up at low effort.
Success criteria
What differs from the brief
components.schema.jsonin this repo, so I wrote a stand-in from appkit-ui's real props.The full report and 21 screenshots (light, dark, and Tetris mid-game) are in
~/.herdr-projects/reports/app-kit/37/(report.mdandshots/). The closing note is written.Also noticed
packages/appkit-ui/src/react/charts/normalize.ts: any x field nameddatebecomes a time axis, so display labels like "Jun 3" quietly produce blank charts. The drafts avoid it with a prompt rule.@tailwindcss/vitedoesn't generate classes for newly added files until the stylesheet changes. The script works around it by touchingindex.css.Task: KIT-37 (app-kit/37)