Skip to content

feat: draw app dialogs, tabs and forms with platform components - #634

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

RentnerKev merged 2 commits into
mainfrom
rentner/feat/remote-ui-forms

Conversation

@RentnerKev

Copy link
Copy Markdown
Member

Summary

Third slice of #626: remotely rendered apps can now draw dialogs, tabs and forms with the platform's own components. This is what the Monitoring pilot (RentnerProxy/app-monitoring#12) needs to look and work like the built-in monitoring dialog: tabs in the dialog navigation, a settings form, and Save, Discard and Close in the footer.

Dialog and tabs

  • ui-dialog opens a platform Modal. The app controls it with open; closing sends close, and a dialog without a close listener cannot be closed by the user.
  • Host row actions: if the app's root is a single ui-dialog, it no longer opens a second dialog. Instead it fills the platform dialog it was opened in (AppHostActionDialog): its heading becomes the title, the navigation slot goes into the navigation band, the footer slot into the footer, and open: false closes the platform dialog. The host's domains stay as the description unless the app sets one. This works through a small AppDialogSurfaceContext and portals, so the dialog never flickers between two modals.
  • ui-tabs uses the shared Tabs from refactor(ui): share accessible tabs and add a warning background token #632. Selection stays in the platform: a click switches at once and sends change, and a new value from the app selects that tab. In a dialog's navigation slot the tab list sits in the navigation band (plain variant) and the panels are drawn in the dialog body, matching the built-in monitoring dialog.
  • Tabs gains per-tab disabled; arrow keys skip disabled tabs.

Forms (web/src/lib/AppUi/remote-forms.ts)

  • The platform holds the draft. A new version resets it; the same version with new values keeps the fields the user changed.
  • Dirty and valid state come from the field properties: required, length, email and web URL format, number range and step, and select options.
  • Save is enabled only while the form is dirty, valid, not read-only, pending or in conflict, and listens to submit. After a submit, saving stays blocked until the app updates the form, or 10 s at most.
  • Close guard, like the built-in dialogs: while a form in a dialog is dirty or pending, its Close button and the dialog's close control are disabled.
  • ui-form-actions draws the platform footer pattern: dirty label and Discard while dirty, Close in a dialog, Save. A ui-button with type: "submit" saves the form it names or sits in.
  • conflict: true shows a platform notice (new appUi.remote.form.conflict text in all eight languages).
  • The form is a div, not a <form>, so it never nests inside a platform form such as the proxy host form. Enter in a single-line field saves.

Fields

ui-text-field (text, email, url, multiline), ui-number-field (with the unit in the label), ui-toggle and ui-select (searchable, clearable, option badges) draw the platform inputs from @rentnerkev/inputs, OptionToggle and CustomSelect. help shows as a tooltip next to the label. Outside a form a field keeps its own value, reset by a new value from the app.

Event details

These become the typed details of the SDK runtime in slice 5:

Element Event Detail
ui-dialog close {}
ui-tabs change { value }
ui-form change { values, dirty, valid }
ui-form submit { values, version }
fields change, blur { value }
ui-form-actions close {}

Not in this PR

  • The data table, chart and status strip (slice 4) still draw the placeholder, so the platform keeps offering UI bridge 1.2.0.

Checks

  • bun run typecheck, bun run lint (including the type-aware pass)
  • New tests: remote-forms.test.ts (draft, rules, submit, close guard), remote-app-dialogs.test.tsx (standalone dialog with tabs, form and footer, and the host action dialog filled by the app's root dialog)
  • App UI, shared, proxy host and host monitoring tests isolated: 572 pass (before the last close-handler fix); app UI and form tests after it: 41 pass
  • bun run test:ts: running, result follows in a comment

🤖 Generated with Claude Code

RentnerKev and others added 2 commits November 29, 2026 22:07
Remotely rendered apps can now use ui-dialog, ui-tabs, ui-tab-panel,
ui-form, ui-form-actions and the text, number, toggle and select fields.
The platform holds form drafts with dirty and valid state from the field
properties, guards dialog close like its own dialogs, and keeps the tab
selection. An app whose root is a single ui-dialog fills the host row
action dialog's title, navigation and footer instead of opening a second
dialog. Shared Tabs gain per-tab disabling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • 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

@RentnerKev
RentnerKev merged commit 0e97ec2 into main Nov 29, 2026
32 checks passed
@RentnerKev
RentnerKev deleted the rentner/feat/remote-ui-forms branch November 29, 2026 21: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.

1 participant