Skip to content

feat(designs): drop react-ui.json from the Design Studio preview path (#3859) - #4104

Open
kevinthelago wants to merge 2 commits into
developfrom
design-studio
Open

feat(designs): drop react-ui.json from the Design Studio preview path (#3859)#4104
kevinthelago wants to merge 2 commits into
developfrom
design-studio

Conversation

@kevinthelago

Copy link
Copy Markdown
Owner

Summary

  • App-graph records (kitId === base-studio-code, the app's own pages/panels migrated by epic Epic: load the app's UI from the graph at runtime #3604) now preview live through the runtime loader (GraphComponent) instead of the sandboxed esbuild-in-iframe path -- the same ISOLATES-vs-CONNECTS split componentLoader.ts already draws, and the same path Fleet/Settings/Skills/Security/MCP/GitHub/Automations already mount their pages with.
  • Third-party / harvested / user-authored components are unaffected -- same sandboxed build, unchanged behavior.
  • useComponentScan/scannableComponents skip app-graph records entirely -- no more esbuild-build+run in a hidden iframe on every Studio visit for records that no longer preview that way.
  • graphHealth.ts's no-implementation check for an app-graph record now gates on previewBuildFailures (registry + kit-siblings resolution -- the same resolution its live host actually uses), not the retired packaged artifact.
  • No @data/components/react-ui.json import remains under src/features/designs/.

Closes #3859.

Test plan

  • npm run typecheck -- clean
  • npm run lint -- 0 errors (pre-existing warning baseline unchanged)
  • npx vitest run (full repo) -- 6033 passed, 2 pre-existing failures in reactUiKit.gen.test.ts (verified via git stash against the unmodified baseline -- the committed react-ui.json artifact is already stale vs. current source, unrelated to this PR; that's the artifact-rot Epic: retire react-ui.json from the app's own UI path — the platform registry already replaced it #3856's epic describes, left for Re-home react-ui.json as the emit-only distribution kit (and stop calling it a seed) #3861's re-home)
  • New tests: ComponentPreviewFrame.test.tsx (routing), componentScan.test.ts (app-graph records excluded from the scan), graphHealth.test.ts (registry+siblings resolution for app-graph records, both the clean and genuinely-unresolvable cases)
  • Verify in the running app (per the issue's acceptance): open the Design Studio, confirm an app page previews and a third-party component still previews -- not verifiable from this headless session; flagging for the reviewer/director to confirm live

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01DPwsgtzLe9WfKAQPWvr4iu

kevinthelago and others added 2 commits July 31, 2026 16:06
…#3859)

App-graph records (kitId === base-studio-code, the app's own pages/panels
migrated by epic #3604) now preview LIVE through the runtime loader
(GraphComponent) instead of the sandboxed esbuild-in-iframe path -- the
same "preview ISOLATES vs runtime loader CONNECTS" split componentLoader.ts
already draws, and the same path Fleet/Settings/Skills/Security/MCP/GitHub/
Automations already mount their pages with.

- ComponentPreviewFrame.tsx: routes by comp.kitId. Third-party / harvested /
  user-authored components are unaffected -- same sandboxed build, now with
  a reusable EMPTY_ARTIFACT (componentPreview.ts) instead of the raw
  react-ui.json import.
- useComponentScan/componentScan.ts: scannableComponents skips app-graph
  records entirely -- they no longer esbuild-build+run in a hidden iframe
  on every Studio visit.
- graphHealth.ts: the no-implementation check for an app-graph record now
  gates on previewBuildFailures (the registry + kit-siblings resolution its
  live host actually uses), not the retired artifact. Every other record's
  buildability check is unchanged except EMPTY_ARTIFACT.
- No @data/components/react-ui.json import remains under src/features/designs/.

Closes #3859.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPwsgtzLe9WfKAQPWvr4iu
…l store (#3910)

emit_component_writes_a_stamped_alias_free_closure asserted the emitted
Card.tsx is stamped "// vendored from bsc/react-ui@..." -- true only when
emit_kit() (#3720) falls back to the packaged artifact. Since #3720, that
function prefers the LIVE component store (BSC_COMPONENT_DIR, default
~/.base-studio-code/components/) whenever it's reachable and non-empty, in
which case the stamp is "bsc/studio@..." (EmitKit::from_store's merged-view
id) instead -- so the test was asserting on the developer's local library
contents, not the code, and failed on develop for exactly that reason.

Fixed by pointing BSC_COMPONENT_DIR at an empty scratch dir for the
duration of the test, under a shared COMPONENT_DIR_ENV_LOCK (promoted from
release_add_from_store_assembles_a_non_empty_artifact's previously-local
FROM_STORE_ENV_LOCK, since both tests mutate the same process-global env
var and must serialize against each other, not just against themselves).
An empty store makes load_store_components() return [], so emit_kit()
takes its documented packaged-artifact fallback deterministically.

The other pre-existing failure the issue named
(harvest_is_in_the_help_catalog's <repo-dir> needle) was already fixed on
this branch via #3907.

cargo test -p bsc-ui: 137/137 green. cargo clippy -p bsc-ui --all-targets: clean.

Closes #3910.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPwsgtzLe9WfKAQPWvr4iu
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