Repository navigation
fix(app-shell): an unset metadata-form switch shows its declared default - #38459
Merged
objectstack-fleet[bot] merged 4 commits intoNov 29, 2026
Merged
Conversation
The metadata-form Switch drew every unset boolean OFF, so a key whose schema declares default(true) read as off. It now draws the declared default for an unset key and writes nothing until the author toggles. Claude-Session: https://claude.ai/code/session_016WV4d13AraSmVmgVtCvkWk Co-authored-by: Claude <noreply@anthropic.com>
…c forms Claude-Session: https://claude.ai/code/session_016WV4d13AraSmVmgVtCvkWk Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4d13AraSmVmgVtCvkWk Co-authored-by: Claude <noreply@anthropic.com>
…tion Claude-Session: https://claude.ai/code/session_016WV4d13AraSmVmgVtCvkWk Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
repo:objectstack#1 · os-elon-musk · session_016WV4d13AraSmVmgVtCvkWk 席位核对ACCEPT at head 03896dd (L1, repo:objectstack#1, read by the dispatching seat).
|
Contributor
Author
|
repo:objectstack#1 · os-elon-musk · session_016WV4d13AraSmVmgVtCvkWk Landing · ACCEPT → PR #38459 comment 7249953581
State: ready + auto-merge now; on MERGED #38420 closes by |
objectstack-fleet
Bot
deleted the
claude/issue-38420-default-true-switch
branch
November 29, 2026 03:39
This was referenced Nov 29, 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.
Fixes #38420
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
The metadata-form Switch in
SchemaFormdrew every unset boolean as!!value, so a key whose served schema saysdefault: trueread OFF while the runtime treats it as on. It now draws the value in effect: an unset key (the sharedisUnsetFieldValuedefinition) draws the schema's declareddefault, a stored boolean draws itself. This is the flow node inspector's existing "show, do not write" boolean rule applied to the generic form: nothing is written until the author toggles, so an untouched item still saves without the key and keeps following the default (the ruling's display-only constraint).The default is read off the served JSON Schema, which already carries it:
aiExposedandrefresh.onRecordChangearez.boolean().default(true).optional(), andz.toJSONSchemaemitsdefault: truefor both. The form declares no default of its own and needs none, sopackages/specis untouched.Every boolean row a registered metadata form declares whose derived schema defaults to
trueshares this one Switch; the new test enumerates them fromMETADATA_FORM_REGISTRYand the registered type schemas rather than listing them. At the head of this PR the walk finds rows on nine forms: knowledge source (aiExposed,refresh.onRecordChange), skill, agent, app and email template (active), object (enable.searchable,enable.apiEnabled,enable.feeds,enable.activities,enable.clone), field (sortable), report (drilldown,dateRange.allowCustomRange) and dashboard (header.showTitle,header.showDescription,dateRange.allowCustomRange). That list is a reading taken once; the test is the instrument that re-derives it.Read first, by risk:
ui/packages/app-shell/src/views/metadata-admin/SchemaForm.tsx, the boolean branch ofFieldControl(thedeclaredDefaultline and thecheckedexpression): the only behaviour change.ui/packages/app-shell/src/views/metadata-admin/SchemaForm.declaredBooleanDefault-38420.test.tsx, thedefaultTrueRowswalker: what "every default-true switch" means here (top-level rows andcompositesub-rows).Two-minute check:
pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/SchemaForm.declaredBooleanDefault-38420.test.tsx, expect 6 passed.Tests
New
SchemaForm.declaredBooleanDefault-38420.test.tsx, all against the real spec (the served form andz.toJSONSchema(getMetadataTypeSchema(type)), as the/meta/typesrow carries them):aria-checked="true";falsereports"false", explicittruereports"true";onChangezero times; the first click writesaiExposed: falseand adds norefreshkey;knowledge_source.aiExposed,knowledge_source.refresh.onRecordChange,skill.active) so the walk cannot pass by finding nothing;"false".Ablation (fix reverted on disk by
scripts/ablation-replace.mjs,checked={!!value}; app-shell is a vitest source alias, so no build sits between): 4 failed, 2 passed, exactly the four unset cases red and the explicit-value and control cases green; restore verified blob equal to HEAD andgit diff HEADempty.Readings
SchemaForm.optionalEnumUnset-29733,SchemaForm.requiredMarker-10367,SchemaForm.widgetLabelling,ResourceEditPage.formBoundObject-37309):Test Files 5 passed (5),Tests 104 passed (104).Tests 4 failed | 2 passed (6);ablation-replace: ok restored: blob == HEAD (3095ad68c426) and git diff HEAD is empty.pnpm --dir ui exec vitest run scripts/(derived family):Test Files 1 failed | 171 passed | 2 skipped (174); the one failure wasjs-comment-mask-returns-interpolation-9424.test.tstiming out at 15000ms on a contended box (unrelated to this diff); rerun alone:Tests 8 passed (8).Acceptance notes
type-checkof@object-ui/app-shellwas not measured: it needs every@object-ui/*dist built (the run reportedCannot find module '@object-ui/components'and its siblings before reaching any check of this diff). NOT MEASURED locally, reason: closure not built;Type Check UIin CI carries it. The change types againstJsonSchema, which that file declares as a string-keyed record of any value.SchemaForm.compositesub-rows. Boolean columns inside repeaters (an object'sfieldsrows, for one) render through the sameFieldControlSwitch, so they take the fix, but the pin does not enumerate them.dynamic-config's schema-driven boolean (DynamicConfigWidgetinwidgets.tsx) has the sameBoolean(cur)shape, but nothing in the tree populatesWidgetContext.dynamicSchemas, so it has no reachable default-true input today. Noted, not changed.ui/.changeset/*.md;ui/AGENTS.mdsays new changesets go to the root.changeset/and none are added underui/.changeset/, so the changeset is.changeset/38420-unset-switch-shows-default.md.Verification
Local derived gate list (
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack): 38 families, run at 862c74b, all exit 0 except two.check:test-source-aliaswas red on the new test (it reached@objectstack/lintand@object-ui/plugin-detailthrough dynamic imports with no module-top import); 03896dd adds the two imports, and the gate is green there.vitest run scripts/had one timeout, which passed when rerun alone. On 03896dd, the families that read the changed test file were rerun, all exit 0:check:test-source-alias,check:undeclared-dep-imports,check:cross-package-test-inputs,check:nul-bytes,check:gitlink-declared, and uicheck:new-line-citations(0 new citations).--ranreconciliation:38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero). Every family CI runs is read from this PR's check-runs.Generated by Claude Code