Skip to content

feat(appkit): design pages report render failures and success - #745

Merged
MarioCadenas merged 7 commits into
mainfrom
work/12-design-pages-report-render-fai
Nov 23, 2026
Merged

MarioCadenas merged 7 commits into
mainfrom
work/12-design-pages-report-render-fai

Conversation

@MarioCadenas

Copy link
Copy Markdown
Collaborator

App Builder's design flow shows streamed drafts through the design plugin. Today a draft that fails to render can't be told apart from one that rendered, so the preview shows a blank frame instead of an error. This makes design pages say what happened, with explicit markers on the page shell.

Changes

  • DesignPage sets data-design-rendered once the page has rendered without an error, an empty page included. The marker isn't set while the page suspends: DesignPage now owns the Suspense boundary through a new pendingFallback prop, and the plugin passes its readiness-holding Pending component there.
  • An error before the first good render shows its message inside [data-design-error]. A fallback that renders no text (null, false, "") is replaced by the message, and a custom errorFallback still works.
  • The stream page no longer passes errorFallback: () => null. A failed first import now shows right away, and the page stays pending until a version is published (data-published on #root).
  • One design state at a time: pending, rendered, last-good or error. The states and their markers are documented in the JSDoc and in docs/docs/plugins/design.md.

Tests

  • New tests for each state and transition in design-page.test.tsx and for the stream page. Each new test fails on the old code.
  • Headless Chrome with the real page wrapper:
    • a page that stays suspended shows the shell with no marker;
    • one that resolves is marked rendered;
    • errorFallback={() => false} shows the message.

Not checked

  • A run inside a real App Builder frame with live Vite streaming.
  • A draft that suspends now shows an unmarked shell where it used to show nothing.
  • A custom errorFallback that shows only an icon (no text) gets replaced by the message.

This pull request and its description were written by Isaac.

MarioCadenas and others added 4 commits November 23, 2026 13:43
…ures

DesignPage now sets data-design-rendered on its shell once the page
commits a render without an error (an empty page counts), and removes it
when an error replaces the page. A render error before any good render
always shows its message inside [data-design-error]: the errorFallback
option, used only by the stream page to blank it, is gone.

The stream page shows a published version that fails to load or
evaluate as [data-design-error] right away; the next good publish
replaces it. Before any version is published it stays pending: the
server marks the page's root data-published once one is out.

Documents the pending, rendered, last-good and error states next to
DesignPage and in the design plugin docs.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: mario.cadenas <mario.cadenas@databricks.com>
The board checks each commit once; the check of the previous commit
failed before running anything (pnpm wasn't installed in its shell).
No code change.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: mario.cadenas <mario.cadenas@databricks.com>
From review of the rendered marker:
- data-design-rendered is removed in the commit an error replaces the
  page (a layout effect cleanup), so a MutationObserver never sees it
  beside [data-design-last-good] or [data-design-error].
- A thrown non-Error (a string, null) shows as its text, instead of an
  empty reason or a blank root.
- errorFallback is back, for compatibility; a fallback that renders
  nothing falls back to the message, so the error node is never empty.
- Tests: the observer contract outside act(), non-Error throws,
  errorFallback, and on the stream page, rendered then a broken hot
  update (last good frame) then a fixed one rendering again.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: mario.cadenas <mario.cadenas@databricks.com>
DesignPage now owns the page's Suspense boundary (pendingFallback), with
the rendered marker inside it, so a page showing a Suspense fallback isn't
marked rendered; the marker comes back when the page shows again. The
design plugin passes its readiness-holding Pending as pendingFallback.

An errorFallback that shows no text (null, false, "") gives way to the
message before the paint, so [data-design-error] is never empty.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: mario.cadenas <mario.cadenas@databricks.com>
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

📦 Bundle size report

Compared against bundle-size-baseline.json (main).

@databricks/appkit

npm tarball (packed): 1.3 MB (+987 B) — gzipped download (dist + bin; excludes release-only docs/NOTICE).

dist raw gzip
JS (runtime) 1.4 MB (+1.2 KB) 500 KB (+461 B)
Type declarations 483 KB 174 KB
Source maps 2.7 MB (+1.5 KB) 929 KB (+552 B)
Other 11 KB 3.7 KB
Total 4.6 MB (+2.7 KB) 1.6 MB (+1013 B)
Per-entry composition (own code — deps external (as shipped))
Entry Initial (gz) Lazy (gz) Total (gz) node_modules (min) Own code (min)
. 118 KB 2.4 KB 121 KB external 378 KB
./beta 115 KB (+452 B) 484 B 116 KB (+452 B) external 342 KB (+1.1 KB)
./testing 47 KB 38 KB 85 KB external 246 KB
./tsdown 520 B 0 B 520 B external 813 B
./type-generator 31 KB 0 B 31 KB external 90 KB

Chunks:

Entry Chunk Load Size (gz)
. index.js initial 114 KB
. utils.js initial 4.6 KB
. remote-tunnel-manager.js lazy 2.4 KB
./beta beta.js initial 95 KB
./beta modular.js initial 6.1 KB
./beta stream-manager.js initial 5.9 KB
./beta service-context.js initial 4.3 KB
./beta databricks.js initial 3.3 KB
./beta client.js initial 647 B
./beta index.js initial 20 B
./beta supervisor-api.js lazy 192 B
./beta databricks.js lazy 177 B
./beta index.js lazy 115 B
./testing manifest.js initial 33 KB
./testing index.js initial 10 KB
./testing wide-event-emitter.js initial 2.9 KB
./testing index.js lazy 34 KB
./testing remote-tunnel-manager.js lazy 2.4 KB
./testing utils.js lazy 1.8 KB
./tsdown index.js initial 520 B
./type-generator index.js initial 31 KB

@databricks/appkit-ui

npm tarball (packed): 431 KB (+3.0 KB) — gzipped download (dist + bin; excludes release-only docs/NOTICE).

dist raw gzip
JS (runtime) 459 KB (+2.7 KB) 158 KB (+927 B)
Type declarations 283 KB (+1.3 KB) 105 KB (+492 B)
Source maps 912 KB (+5.2 KB) 308 KB (+1.7 KB)
CSS 16 KB 3.2 KB
Total 1.6 MB (+9.2 KB) 574 KB (+3.0 KB)
Per-entry composition (consumer bundle — deps bundled, peerDeps external)
Entry Initial (gz) Lazy (gz) Total (gz) node_modules (min) Own code (min)
./js 5.3 KB 49 KB 55 KB 208 KB 14 KB
./js/beta 3.5 KB 0 B 3.5 KB 0 B 9.4 KB
./react 441 KB 49 KB 489 KB 1.4 MB 179 KB
./react/beta 16 KB (+289 B) 0 B 16 KB (+289 B) 25 KB 23 KB (+857 B)

Chunks:

Entry Chunk Load Size (gz)
./js index.js initial 5.2 KB
./js chunk initial 120 B
./js apache-arrow lazy 49 KB
./js/beta beta.js initial 3.5 KB
./react index.js initial 439 KB
./react tslib initial 2.1 KB
./react apache-arrow lazy 49 KB
./react/beta beta.js initial 16 KB

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AppKit PR bot

🔬 Run evals

Start an eval for this PR from the evals-monitor app: Go to Evals Monitor →

📦 Try this PR's app template

Scaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh auth login — and the Databricks CLI):

gh run download 45213925690 -R databricks/appkit -n appkit-template-0.102.0-pr.d128908-work-12-design-pages-report-render-fai-745 -D appkit-pr-745 \
  && unzip -o "appkit-pr-745/appkit-template-0.102.0-pr.d128908-work-12-design-pages-report-render-fai-745.zip" -d "appkit-pr-745" \
  && databricks apps init --template "appkit-pr-745"

The template pins @databricks/appkit and @databricks/appkit-ui to tarballs built from this branch, so the scaffolded app runs against this PR's code.

MarioCadenas and others added 3 commits November 23, 2026 15:31
…lish

DesignPage now copies the last good frame only while the shell is marked
rendered, so a visible Suspense fallback is never restored in place of an
error before the page has rendered. The page's first frame is copied as
soon as the marker goes on, without waiting for an animation frame (a
hidden frame gets none).

The stream host trusted the data-published flag from when its HTML was
served, so a first publish whose event came before its listener left a
failed import pending forever. A failed import with no known version now
asks the server again (the page's HTML, served afresh).

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: mario.cadenas <mario.cadenas@databricks.com>
Each publish starts a new import of the streamed page, and imports can
finish out of order, so an older failed (or successful) import could
replace the error of a newer published draft. Each mount now takes a
number, and only the latest one renders its outcome.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: mario.cadenas <mario.cadenas@databricks.com>
The last good frame was copied from a passive effect or an animation
frame, so a failure in the task the page committed in (its first commit,
an update or a retry) lost that frame, and a hidden frame (no animation
frames) kept only the first one.

DesignPage now tracks whether the page itself is on screen (layout
effects, so never the error, a copy or a Suspense fallback), and copies it
just before an error replaces it (getSnapshotBeforeUpdate), and after each
DOM change while it shows, for a fallback that hides it before an error.

Every transition between pending, rendered, last-good and error, on a
design page and on a stream page (first and later renders, failures in the
same task and later, suspends, retries, out-of-order imports and
publishes), is now one table-driven test, run outside act() and in a
hidden frame too, checking what a builder must never see on the way. It
replaces the one-off transition tests, and the transitions are documented.

Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: mario.cadenas <mario.cadenas@databricks.com>
@MarioCadenas
MarioCadenas marked this pull request as ready for review November 23, 2026 16:12
@MarioCadenas
MarioCadenas requested a review from a team as a code owner November 23, 2026 16:12
@MarioCadenas
MarioCadenas merged commit fda3830 into main Nov 23, 2026
12 checks passed
@MarioCadenas
MarioCadenas deleted the work/12-design-pages-report-render-fai branch November 23, 2026 17:09
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.

2 participants