Repository navigation
fix(ui): a wizard form view keeps layout horizontal, and the form page draws it as steps - #27267
Merged
Merged
Conversation
…e draws it as steps Claude-Session: https://claude.ai/code/session_01JQwxbZ31aDwuL2615F85BS Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZ31aDwuL2615F85BS Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZ31aDwuL2615F85BS Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对ACCEPT · 席位意见:向导表单不再丢掉横排布局,表单页按节分步,下一步的检查沿用最终提交的规则,被拒的提交会跳到出错那一步;简单表单和标签页表单的行为不变。
|
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.
Requested by Warren · project thread
Fixes #27224
Clause-②: no
Metadata-protocol: none
维护者速读
type: 'wizard')写layout: 'horizontal'时每一步的字段标签都放到输入框左侧;/forms/:name与/f/:slug表单页把分步表单画成逐步填写(步骤条、下一步/上一步、最后一步提交)。ui/apps/console/src/components/FormPage.tsx(renderWizardSteps、handleWizardNext、提交被拒时跳到出错步骤)、ui/packages/plugin-form/src/WizardForm.tsx(layout: schema.layout ?? 'vertical')。pnpm --dir ui exec vitest run apps/console/src/components/FormPage.wizardSteps-27224.test.tsx,预期 11 个测试全绿。What changes
A wizard form keeps
layout: 'horizontal'.ObjectFormhands the authored key toWizardFormin its{...schema}spread, and the step form nodeWizardFormbuilt saidlayout: 'vertical'whatever the form view said. It now passesschema.layout ?? 'vertical', the shapeTabbedFormgot in PR fix(ui): a form view's layout horizontal puts labels beside fields, and the form page draws tabbed views as tabs #27222, and declareslayoutonWizardFormSchemaasObjectFormSchema['layout']. Every field on every step draws its label beside the control fromsmup, through the form renderer's existing horizontal arrangement. The auto-stepper path (mobile.stepper) spreads the same schema, so it keeps the key too.The form page draws
type: 'wizard'as steps./forms/:nameand the public/f/:slugreadtypeonly fortabbed, so a wizard view drew every section stacked on one page. A wizard view with more than one section now draws, with the semantics of the app's wizard form and the spec's FormView wizard contract (D4 step gate, D5 derived progress):wizard.stepFallbacktext), hidden byshowStepIndicator: false;findSubmitRefusalsover that one section) and opens the next step only when none is refused; a refused step is marked in the indicator and the refusal message is the page's existing one;allowSkip(canOpenWizardStep, the ruleWizardForm'scanOpenStepapplies);valuesmap); a submit refused for a missing field, or a faultedvisibleWhen, opens the step holding the first field it names and marks every step a refused field sits on;continuesubmit behaviour starts the wizard over from step one;hiddenattribute), so a control on another step keeps its widget state, an upload in flight included;wizard.emptySteptext, as the app's wizard does;The refusal reporting that
handleSubmitinlined is lifted intoreportRefusalsso Next and the final submit put the same messages on the same channel. Every string the wizard draws is an existing catalogue key (wizard.progressLabel,wizard.stepFallback,wizard.back,wizard.emptyStep,common.next,form.stepOf), so no locale pack changes.FORM_SPEC_TYPESis left as it is; its split/drawer/modal entries belong to #27159.Why
Both keys are authorable and saved, and both drew as if absent: a wizard form view's
layout: 'horizontal'and the form page'stype: 'wizard'. This is the wizard arm of the defect PR #27222 closed for simple and tabbed forms (triage 6468472559: the filer's Expected stands).Tests
ui/packages/plugin-form/src/__tests__/wizardFormLayout-27224.test.tsx(3): horizontal on step one and, after Next, on step two; CONTROLS: nolayout, andvertical, draw vertical.ui/apps/console/src/components/FormPage.wizardSteps-27224.test.tsx(11): steps drawn, only the current one shown, Next and no Back or Submit on step one; Next and Back, completed steps reopen from the indicator and an uncompleted one does not; Next refuses an outstanding required field and writes nothing; Enter is Next; the submit carries every step's fields;allowSkipopens any step and a refused submit opens the step holding the field;showStepIndicator: false; horizontal rows on every step;canOpenWizardStepunit cases. CONTROLS: a single-section wizard draws stacked with Submit and no indicator; asimpleview draws every section stacked with Submit and no steps.Ablations, each through
scripts/ablation-replace.mjson the committed head15589ba4, restored to the HEAD blob withgit diff HEADempty:WizardForm.tsxback tolayout: 'vertical': the horizontal test reds (1 failed, 2 passed: both controls stay green).FormPage.tsxwithwizardViewforced tofalse: all 8 wizard tests red, the 3 controls (single section, simple view,canOpenWizardStep) stay green.Acceptance notes
required,requiredWhen,readonlyWhenand a faultedvisibleWhen, through the rules its final submit already applies. Like the app's wizard, it is a UI admission rule, never authorization; the server re-validates the record on submit.nextText/prevTextare not FormView keys (they live on theobject-formcomponent props), so the page draws the catalogue's Next and Back.Verification
Measured on
objectstack-ai/objectstackat15589ba4(merge base295699d5).origin/mainhas since moved to3beb2240; none of its commits touchui/packages/plugin-form,FormPage.tsxor the form renderer, so the branch is not merged with it.Builds, suites and type-checks
pnpm --workspace-concurrency=2 --filter '@object-ui/console^...' buildunder the lock: VERDICT command-exit 0 (11m36s).pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-form/ apps/console/src/components/FormPage: Test Files 243 passed (243), Tests 2792 passed, 1 skipped; VERDICT command-exit 0.pnpm --filter @object-ui/plugin-form run type-check && pnpm --filter @object-ui/console run type-check: VERDICT command-exit 0.pnpm check:new-line-citations(fromui/): 0 new citations.Derived gates: 34 derived, 34 run, all exit 0 (dispatch-gates --ran: 0 NOT-MEASURED)
node scripts/check-adr-0087-registration.mjs --base origin/main:: exit 0node scripts/check-adr-0087-registration.mjs --self-test:: exit 0node scripts/check-changeset-no-major.mjs --base origin/main:: exit 0node scripts/check-closing-keyword-parity.mjs:: exit 0node scripts/check-closing-keyword-parity.mjs --self-test:: exit 0node scripts/check-comment-mask-corpus.mjs:: exit 0node scripts/check-empty-changeset.mjs --base origin/main:: exit 0node scripts/check-empty-changeset.mjs --self-test:: exit 0node scripts/check-sdui-manifest.mjs:: exit 0node scripts/check-sdui-manifest.mjs --self-test:: exit 0node scripts/pm/release-rehearsal-clone.mjs --self-test:: exit 0node scripts/release-pending-publish.mjs --self-test:: exit 0pnpm --filter @objectstack/spec run check:duration-unit-keys:: exit 0pnpm check:changeset-gate-self-tests:: exit 0pnpm check:closed-ceremony-text:: exit 0pnpm check:cross-package-test-inputs:: exit 0pnpm check:dispatcher-error-vocabulary:: exit 0pnpm check:driver-memory-census:: exit 0pnpm check:engine-double-contract:: exit 0pnpm check:gitlink-declared:: exit 0pnpm check:nul-bytes:: exit 0pnpm check:pm-changeset-deadline-census:: exit 0pnpm check:published-files:: exit 0pnpm check:query-options-erasure:: exit 0pnpm check:refd-timer-probe:: exit 0pnpm check:skill-identifier-liveness:: exit 0pnpm check:test-source-alias:: exit 0pnpm check:tier-file-adoption:: exit 0pnpm check:type-check-coverage:: exit 0pnpm check:type-check-debt:: exit 0pnpm check:undeclared-dep-imports:: exit 0pnpm check:watch-hint-literal:: exit 0pnpm check:where-matcher:: exit 0pnpm --dir ui exec vitest run scripts/:: exit 0Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintis CI's run.main, one pull request.packages/spectouched: not touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbZ31aDwuL2615F85BS