Repository navigation
feat: draw app dialogs, tabs and forms with platform components - #634
Merged
Merged
Conversation
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>
Contributor
Finishing Touches
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-dialogopens a platformModal. The app controls it withopen; closing sendsclose, and a dialog without a close listener cannot be closed by the user.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, thenavigationslot goes into the navigation band, thefooterslot into the footer, andopen: falsecloses the platform dialog. The host's domains stay as the description unless the app sets one. This works through a smallAppDialogSurfaceContextand portals, so the dialog never flickers between two modals.ui-tabsuses the sharedTabsfrom refactor(ui): share accessible tabs and add a warning background token #632. Selection stays in the platform: a click switches at once and sendschange, and a newvaluefrom the app selects that tab. In a dialog'snavigationslot 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.Tabsgains per-tabdisabled; arrow keys skip disabled tabs.Forms (
web/src/lib/AppUi/remote-forms.ts)versionresets it; the same version with new values keeps the fields the user changed.submit. After a submit, saving stays blocked until the app updates the form, or 10 s at most.ui-form-actionsdraws the platform footer pattern: dirty label and Discard while dirty, Close in a dialog, Save. Aui-buttonwithtype: "submit"saves the form it names or sits in.conflict: trueshows a platform notice (newappUi.remote.form.conflicttext in all eight languages).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-toggleandui-select(searchable, clearable, option badges) draw the platform inputs from@rentnerkev/inputs,OptionToggleandCustomSelect.helpshows as a tooltip next to the label. Outside a form a field keeps its own value, reset by a newvaluefrom the app.Event details
These become the typed details of the SDK runtime in slice 5:
ui-dialogclose{}ui-tabschange{ value }ui-formchange{ values, dirty, valid }ui-formsubmit{ values, version }change,blur{ value }ui-form-actionsclose{}Not in this PR
Checks
bun run typecheck,bun run lint(including the type-aware pass)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)bun run test:ts: running, result follows in a comment🤖 Generated with Claude Code