Repository navigation
fix(app-shell): an authored FormView.modalSize sizes the console create/edit modal - #12832
Merged
Merged
Conversation
…te/edit modal resolveFormViewLayout now copies the default form view's modalSize when the spec's FormView.modalSize enum accepts it. resolveRecordFormModalLayout states the precedence against the derived flow surface instead of leaving it to spread order: a derived 'full' (the phone posture) stays full, otherwise the authored size wins on desktop, otherwise no modalSize key, as before. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gB
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
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.
Fixes #12803
Clause-②: no
Landing record: an authored
FormView.modalSizenow wins on the console create/edit modal on desktop; mobile stays full-screen.What changed
resolveFormViewLayout(packages/app-shell/src/utils/recordFormNavigation.ts) copies the default form view'smodalSizewhen the spec'sFormView.modalSizeenum accepts it. The enum is read fromFormViewSchemaitself (FormViewSchema.shape.modalSize), so no second copy of it lives here. The copy is independent ofsections: a form view can size the dialog without curating its fields.resolveRecordFormModalLayout(objectDef, derivedSize)in the same file states the precedence instead of leaving it to spread order: (1) a derivedsize: 'full'(the phone posture ofderiveRecordFlowSurface) stays'full'; (2) otherwise the authoredmodalSizewins; (3) otherwise nomodalSizekey at all, soModalFormsizes the dialog itself as before.AppContent.tsx, create/editModalFormschema build only: the two spreads (derived'full', then...resolveFormViewLayout(...)) become one...resolveRecordFormModalLayout(formObjectDef, deriveRecordFlowSurface(...).size). Before, a naively copiedmodalSizewould have overridden a derived'full', because the layout spread came second.ModalForm.tsxand the spec docblock are untouched, as ruled..changeset/12803-form-modal-size.md(@object-ui/app-shell: patch).resolveFormViewLayout/FormViewModalLayoutare not on the package root entry (src/index.ts), so no published export gains a member, and Clause-② stays no.Tests
packages/app-shell/src/utils/__tests__/recordFormModalSize-12803.test.ts(unit): every spec enum value is copied; an off-enum value (md,auto, a number) is not; the precedence holds on desktop (authored wins) and mobile (derivedfullstays); CONTROL desktop and mobile with nothing authored give the same result as before, compared withtoStrictEqual.packages/app-shell/src/console/__tests__/AppContent.formViewModalSize-12803.test.tsx(dom, realAppContentmount, the harness ofAppContent.recordDialogInterimBound-12521): (a) authoredlgreaches theModalFormschema for create, edit and child-create, and the real dialog opens atsm:max-w-2xl, not the derivedsm:max-w-5xl; (b) CONTROL, nothing authored: nomodalSizekey on the schema, and the real dialog keepssm:max-w-5xl; (c) phone: belowsmthe authored-lgdialog carries exactly the classes of the unsized one (the full-screen sheet), with nomax-w-cap.layout.modalSize = authoredSize;line throughablation-replace.mjs(anchor 1 to 0, blobcec1174494aetoccf88599d3df) turned 11 of 22 tests red, every (a) pin; the CONTROL and phone pins stayed green. The restore was proven by blob hash (cec1174494aeequals the HEAD blob) and an emptygit diff HEAD.Gates (at
4f106100c)pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' run build: exit 0.pnpm --filter @object-ui/app-shell run type-check(bothtsc --noEmitandtsc -p tsconfig.test.json, which includes the new tests): exit 0.packages/app-shell,apps/consolethat importrecordFormNavigation,AppContentoruseActionModal: 560 passed. NOT MEASURED: the wholepackages/app-shell/directory. Reason: with--maxWorkers=1it printed nothing for 30 minutes under the lock, so I stopped it and left the full package run to CI.eslint --no-inline-config --format jsongave 4 files, 0 errors (warnings only, existingno-explicit-anystyle). The population is the changed files. The repo'seslint.config.jssets noparserOptions.project, so linting is not type-aware and this diff cannot change the verdict on any untouched file.check:phantom-deps,check:self-import,check:unreferenced-sources,check:doc-example-readers,check:handler-key-reads,check:side-effects-array,check:element-data-source-declaration,check:spec-symbols,check:action-forward-parity,check:designer-field-key-parity,check:icon-record-names,check:i18n-keys,check:i18n-drift,check:i18n-designer-parity,check:control-bytes,scripts/check-hand-rolled-comment-mask.mjs,scripts/check-changeset-fixed.mjs,scripts/check-changeset-presence.mjs.Acceptance notes
navigation.sizeversusFormView.modalSize(measured): the installed@objectstack/specderiveRecordFlowSurfacereads only the authorable field count and theviewportoption. It never readsnavigation.size, andAppContentreads nonavigationfor this modal either. So an authorednavigation.sizehas no effect on the create/edit modal, before or after this change. When it disagrees withFormView.modalSize, the form view's ownmodalSizeapplies. No new precedence key and no fallback were added.Mobile: this host calls
deriveRecordFlowSurfacewith noviewport, so in the console the derived size is alwaysauto. The phone's full-screen modal isModalForm's unprefixed sheet classes, and everymodalSizeClassesentry issm:-prefixed. An authored size therefore cannot reach a phone (pin (c)). The explicit derived-fullrule inresolveRecordFormModalLayoutcovers a future caller that passesviewport: 'mobile'.A1, the other reader of
resolveFormViewLayout:packages/app-shell/src/hooks/useActionModal.tsx(an action-opened object form) spreads...viewLayoutand then writesmodalSize: d.size. The explicit key, even whenundefined, overrides the copied value, so the action modal's size is still the action's ownsize, unchanged. Letting an action modal with nosizefall back to the form view'smodalSizewould be a one-line change in that file. That file is outside this card's file surface, so I did not make the change and left it for the seat to decide.For the objectstack
domain:specseat:FormView.modalSizenow reaches the console create/edit modal on desktop. ThederiveRecordFlowSurfacedocblock may listmodalSizeagain among the config that wins.Adds no product-specific widget, dialog, hook or string (see AGENTS.md › Product-neutral renderer)
Generated by Claude Code