fix(app-shell): guard ActionParamDialog submit during file upload + map spec autonumber (ADR-0059 follow-ups)#2707
Merged
Conversation
…ap spec autonumber (ADR-0059 follow-ups) Two follow-ups to the shared field-widget param rendering (#2700 / ADR-0059): - Upload-in-progress guard: file/image params only carry their fileId once the presigned upload settles, so confirming mid-upload sent an empty/stale value. FileField/ImageField now surface upload state via an optional onUploadingChange prop (shared useUploadingSignal hook, ignored by other widgets); the dialog wires it for file/image params, disables Confirm (label -> "Uploading…", new actionDialog.uploading key in all 10 locales) and blocks submit while any upload is in flight. - autonumber spelling: mapFieldTypeToFormType now folds the spec FieldType spelling `autonumber` (alongside the widget-map key `auto_number`) to the AutoNumber widget, so a spec-typed autonumber field/param no longer falls through to the text input — fixes the object form path too. The redundant param-side alias is dropped (the shared map now covers it). Tests: useUploadingSignal unit test (fires-on-change, latest-callback, no-op); ActionParamDialog upload-guard test (Confirm disabled/re-enabled, submit blocked) via a stubbed upload widget; field-type-coverage asserts autonumber -> non-text. Docs: ADR-0059 follow-ups section, enhanced-actions params note; changeset (patch). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rg7oavKSUdb2KzYEEYrCHX
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
July 20, 2026 00:55
This was referenced Jul 20, 2026
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.
Two follow-ups to the shared field-widget param rendering merged in #2704 (#2700 / ADR-0059).
1. Upload-in-progress guard
A
file/imageparam's value only becomes its uploaded fileId once the presigned upload settles, so confirming mid-upload sent an empty/stale value to the action. Now:FileField/ImageFieldsurface their in-progress state via an optionalonUploadingChangeprop (shareduseUploadingSignalhook; ignored by every other widget).ActionParamDialogwires it only forfile/imageparams (so no unknown prop leaks toward the DOM of other widgets), disables Confirm (label → "Uploading…", newactionDialog.uploadingkey across all 10 locales) and blocks submit while any upload is in flight.2.
autonumberspelling@objectstack/specspells the typeautonumber; the widget-map key isauto_number.mapFieldTypeToFormTypenow folds both to the AutoNumber widget, so a spec-typedautonumberfield/param no longer falls through to the plain text input — this fixes the object form path too, not just action params. The redundant param-side alias is dropped (the shared map covers it).Tests
useUploadingSignalunit test (fires-on-change, latest-callback, no-op-without-callback).ActionParamDialog.uploading.test.tsx— Confirm disabled/re-enabled + submit blocked, via a stubbed upload widget (deterministic mid-upload window).field-type-coverageassertsautonumber→ non-text widget.fields+app-shell+i18nsuites green (245 files / 2141 tests).Browser verification (real Chromium)
Drove a throwaway Vite preview of
ActionParamDialog(one param per representative type) with a deliberately slow upload adapter, via the pre-installed Chromium + Playwright:textarea,number, boolean checkbox, Radixcombobox(select), nativedate, nativecolor,file+file[multiple]— none fell back to a text box.Confirm(enabled) → mid-uploadUploading…(disabled, field shows a spinner) → after settleConfirm(enabled).Harness was uncommitted and removed after verification.
Notes
@object-ui/fieldspackage lint is red at baseline onmain(pre-existingreact-hooks/rules-of-hooksinImageField/index.tsxon code this PR doesn't touch — verified by linting the pristineorigin/mainfiles). This PR's changed files add no new lint errors.cloudrepo + needs attach-on-decision browser verification against a live backend),select+multiple→multiselect(would diverge params from the form, which renders it single-select — belongs in the shared widget layer), and the@object-ui/core/fieldsbaseline lint cleanup (touches many unrelated pre-existing-error files).Changeset:
@object-ui/fields/@object-ui/app-shell/@object-ui/i18npatch.🤖 Generated with Claude Code
https://claude.ai/code/session_01Rg7oavKSUdb2KzYEEYrCHX
Generated by Claude Code