Skip to content

feat: draw remotely rendered apps with platform components - #633

Merged
RentnerKev merged 3 commits into
mainfrom
rentner/feat/remote-ui-host
Nov 29, 2026
Merged

RentnerKev merged 3 commits into
mainfrom
rentner/feat/remote-ui-host

Conversation

@RentnerKev

@RentnerKev RentnerKev commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Second slice of #626: the platform can now draw an app with its own components from the UI kit tree the app sends over UI bridge 1.3.0 (@rentnerproxy/app-contracts 1.7.0, app-sdk#15). The app's code keeps running in its sandboxed iframe, which stays hidden; only elements and properties the UI kit catalog accepts reach the page.

Checked remote tree (web/src/lib/AppUi/remote-tree.ts)

  • Every remote:mutate batch is checked record by record against the contract schema (remoteMutationRecord), the UI kit catalog and the tree limits, and applied as a whole. A rejected batch leaves the drawn tree untouched and retires the frame.
  • Checks per insert: known parent, index in range, uiKitAccepts for the parent, child and slot, listeners only for events the element sends, depth ≤ 32 and at most 5,000 nodes. Comments are kept so Remote DOM's child indexes stay aligned.
  • Updates: property updates are merged and checked again (null clears a property unless the element accepts null for it), the only attribute is slot (checked against the parent again, and the parent changes with it), listener flags are true or null.
  • Entries are immutable and copied on write per batch. Each drawn node subscribes to its own entry (useSyncExternalStore), so an update renders only the nodes it changed.
  • Deliberate difference from the feat(apps): add a versioned extension target catalog and declarative host table extensions #625 prototype: a small checked store of our own instead of Remote DOM's RemoteReceiver, because the receiver applies records without the catalog checks and cannot roll back a batch.

Bridge session

  • connected.rendering is honoured only for apps whose negotiated UI bridge is 1.3.0 or newer; older apps always render in their frame.
  • Batches get their own budget (600 per 10 s, 20,000 records) apart from the 64 other messages, because remote rendering sends a batch per update. Batches are bounded to 4 MiB of plain JSON before they are parsed.
  • toast messages from 1.3.0 apps show a platform toast titled with the app's name, at most three per 10 s.
  • The host sends remote:event for the events a node listens to.

Renderer (features/AppUi/Components/RemoteAppView)

  • Drawn with platform components in this slice: stack, grid, card, page header (with its actions slot, reusing PageHeader), nav, text, time, measure, description list and item, badge, alert, state (reusing ContentState), button (with the platform ConfirmDialog when the app asks for confirmation) and action menu (reusing ActionMenu).
  • Dialog, tabs, form and field elements, the data table, the chart and the status strip come in the next slices; until then they draw a neutral placeholder.
  • Grids and description lists follow the width the app has (container queries), so they also fit dialog tabs.
  • Tone colours and measure formats moved to features/AppUi/appUiPresentation.ts and are shared with the host table cells.
  • PageHeader and ContentState accept an absent eyebrow or description; existing callers are unchanged.

Dependency

Not in this PR

  • The platform still offers UI bridge 1.2.0. It will offer 1.3.0 in the slice that completes the UI kit, so no platform release accepts apps it can only draw in part.

Checks

  • bun run typecheck, bun run lint (including the type-aware pass)
  • New tests: remote-tree.test.ts (30), remote cases in bridge.test.ts, remote-app-view.test.tsx, a remote case in app-ui-frame.test.tsx
  • bun run test:ts: 1,653 pass, 2 fail in unrelated files (catalog-install-ui, oidc-connections-ui); both pass three times in a row on their own, so they are timing under full load
  • App UI, app runtime UI and proxy host tests isolated: 312 pass

🤖 Generated with Claude Code

Accept UI bridge 1.3.0 remote rendering on the platform side: a checked
remote tree applies each remote:mutate batch atomically against the UI kit
catalog and limits of @rentnerproxy/app-contracts 1.7.0, the bridge session
gives batches their own budget, shows bounded app toasts and sends
remote:event, and AppUiFrame keeps the app's iframe hidden while it draws
the tree with platform components (layout, content, button with confirm,
action menu). Later UI kit elements draw a placeholder until their slice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d493d34 and d294eaa.

Files ignored due to path filters: 1

  • bun.lock is excluded by !**/*.lock, !**/*.lock
Files selected for processing: 37

  • bunfig.toml
  • package.json
  • web/src/features/AppUi/AppUiFrame.tsx
  • web/src/features/AppUi/Components/AppHostTableCell.tsx
  • web/src/features/AppUi/Components/RemoteAppView/Components/RemoteActionElements.tsx
  • web/src/features/AppUi/Components/RemoteAppView/Components/RemoteContentElements.tsx
  • web/src/features/AppUi/Components/RemoteAppView/Components/RemoteLayoutElements.tsx
  • web/src/features/AppUi/Components/RemoteAppView/Components/RemoteNode.tsx
  • web/src/features/AppUi/Components/RemoteAppView/Components/RemoteUiIcon.tsx
  • web/src/features/AppUi/Components/RemoteAppView/Components/RemoteUnsupportedElement.tsx
  • web/src/features/AppUi/Components/RemoteAppView/Hooks/useRemoteButtonLogic.ts
  • web/src/features/AppUi/Components/RemoteAppView/Hooks/useRemoteProperties.ts
  • web/src/features/AppUi/Components/RemoteAppView/Hooks/useRemoteUiEntry.ts
  • web/src/features/AppUi/Components/RemoteAppView/Types/remote-app-view.types.ts
  • web/src/features/AppUi/Components/RemoteAppView/index.tsx
  • web/src/features/AppUi/Components/RemoteAppView/remoteAppViewContext.ts
  • web/src/features/AppUi/Hooks/useAppHostTable.ts
  • web/src/features/AppUi/appUiPresentation.ts
  • web/src/lib/AppUi/bridge.ts
  • web/src/lib/AppUi/remote-tree.ts
  • web/src/lib/AppUi/session.ts
  • web/src/lib/Language/Locales/de.json
  • web/src/lib/Language/Locales/en.json
  • web/src/lib/Language/Locales/es.json
  • web/src/lib/Language/Locales/fr.json
  • web/src/lib/Language/Locales/it.json
  • web/src/lib/Language/Locales/nl.json
  • web/src/lib/Language/Locales/pl.json
  • web/src/lib/Language/Locales/pt.json
  • web/src/shared/Management/ContentState.tsx
  • web/src/shared/Management/PageHeader.tsx
  • web/src/shared/Management/Types/management-component-props.types.ts
  • web/src/tests/features/AppUi/app-ui-frame.test.tsx
  • web/src/tests/features/AppUi/remote-app-view.test.tsx
  • web/src/tests/fixtures/app-runtime-reference/greeting-host.ts
  • web/src/tests/lib/AppUi/bridge.test.ts
  • web/src/tests/lib/AppUi/remote-tree.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…i-host

# Conflicts:
#	web/src/features/AppUi/Components/AppHostTableCell.tsx
@socket-security

socket-security Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​rentnerproxy/​app-contracts@​1.7.0801008693100

View full report

@RentnerKev
RentnerKev merged commit d62cbd7 into main Nov 29, 2026
48 checks passed
@RentnerKev
RentnerKev deleted the rentner/feat/remote-ui-host branch November 29, 2026 20:48
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