Repository navigation
feat(console): the console reads and edits forms as form items - #38484
Conversation
Setup's public forms page lists and switches form items, Studio's public form designer becomes the form type's editor (no switch: every save and publish writes the sharing stored at that moment), the form list gets its columns, and the console's own form page reads /meta/form. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxQiu6MyZ2ngLJtA5Y
…reads it Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxQiu6MyZ2ngLJtA5Y
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5nBh856nLqWBYMy29u
|
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5kjJ6Qm1z2mRox4ZbB 席位核对 — REWORK · L1-b · area o5-ux · Head-sha
|
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5nBh856nLqWBYMy29u Contract reviewServed-tier: Inputs read: card #37087 (body and all 12 comments: claim 7248756424, amendment 7248849494, dev report 7251244605, release 7251253363 and addendum 7251555985, seat-5 claim 7251649959), PR #38484 body, the net diff against ① Derived judgmentsPublished packages the diff reaches:
No published export is removed or renamed, no translation key is removed, and no ② Semver level
③ Boundary flagsDev report 7251244605 has
SQL push-down: no new id materialisation or in-app join over records. The designer's early address and name checks scan the effective Findings:
Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5nBh856nLqWBYMy29u The brief the card thread handed its isolated TIER_DEFAULT reviewer for record 7251744213 (filled from Contract review brief — PR #38484 @
|
…e address clash A 409 FORM_ADDRESS_TAKEN the editor's own check missed was shown as a pending draft. Branch on the refusal's code: FORM_ADDRESS_TAKEN shows the address sentence, any other 409 still shows the pending-draft one. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nBh856nLqWBYMy29u
… read The real ActionRunner produces the Log Time URL; FormPage at that route reads GET /api/v1/meta/form/NAME, never /meta/view, renders the record and submits it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nBh856nLqWBYMy29u
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nBh856nLqWBYMy29u
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5nBh856nLqWBYMy29u
|
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5kjJ6Qm1z2mRox4ZbB 席位核对 — ACCEPT · L1-b · area o5-ux · Head-sha
|
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5nBh856nLqWBYMy29u Contract reviewServed-tier: Delta round over round-1 record 7251744213 (head ① Derived judgmentsRound 1's judgments stand. What the delta changes:
No published export or key is removed. Nothing published is narrowed. ② Semver level
③ Boundary flags
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5mzSTSPADAvwapnhxr 维护者速读
席位意见:同意合并。第 2 个 PR(收窄、契约档 L2)在本 PR 合并后开工,和本 PR 进同一个 next 版本。 席位核对 — ACCEPT · repo:objectstack#5 · Head-sha
|
|
repo:objectstack#5 · os-project-manager · session_01FEkQ5mzSTSPADAvwapnhxr Approval requested (Tier H by size: 3,561 lines changed, over 3,000;
|
Part of #37087
Clause-②: yes
Metadata-protocol: none
Skills-docs: none — no metadata an author writes changes; the console reads and writes the
formtype card ② added.维护者速读
…/metadata/form/表单名)就是表单设计器,能改字段、必填、分组、标题、地址和提交后的提示,存草稿再发布;控制台自己的表单页改读表单类型。表单类型暂不进 Studio 菜单(下一张 PR)。form元数据,控制台要改读改写它,后面才能退役开发者页的公开表单页。What changes
ADR-0159 D9 for the console, card ③ PR 1 of 2 (the seat's claim 7248756424, amendment 7248849494). Every console surface here reads and writes the
formtype; the server's projection (ADR-0159 D5, completed by #38453) serves an old-shape form there too.ui/packages/app-shell/src/views/setup/): the list read isGET /meta/form; the row reader takes theformitem itself (noviewKindfilter, noconfighop). The two layered reads, the save paths, the reset and the override save nameform. A switch savesauthorableForm(effective)withsharing.enabledset: the read's_keys and the old shape'sdataare left out, sinceFormSchemarefusesdata. The shipped-off judgement reads the app's own document from theformlayered read'scodewith the spec'sformExplicitlyWithdraws(ADR-0159 D6 rule 6). A row whose app document cannot be read (code: null) is shown as status unknown and offers no switch.formeditor (studio-design/publicForm/):publicFormDesign.tsreads and writes the top-level body.PublicFormsDesigner.tsxnow holdsFormItemEditor, which edits one form, andFormItemPage, registered as theformtype'sEditPageandCreatePage. It has no switch:storedNowreadssharing.enabledandsharing.allowAnonymousagain at every save and publish, and a draft whose sharing differs is saved again before it is published. A form an installed app ships is saved as a declared override in the app's.custompair. A form with no public link (one an action opens) is edited without an address. The new-name and address checks read the effectiveformlist plusformdrafts. The designer's own list and the Form-tab switch from feat(studio): design an object's public forms in Studio's Form tab #36784 are not carried over.formListColumns.tsx; theformresource is registered inservices/builtinComponents.tsxbeside the other lazy editor pages, sometadata-admin/registry.tsstays free of side effects): name (showstitlewhen there is nolabel), label, object, public address and status./meta/typesserves no list layout forform, so these are the client's ownlistColumns.formstays out of Studio's menu.FormPage(ui/apps/console/src/components/FormPage.tsx): the internal route readsGET /api/v1/meta/form/NAME. The anonymous route is unchanged.engine.studio.publicForms.*andengine.list.col.publicAddress/publicStatekeys in./namespaces/studio(en, zh). This PR removes no key.Outside the claimed file surface (reported to the seat):
ui/packages/app-shell/src/views/studio-design/StudioMetadataArea.tsx: one branch, so that aformitem in a package's Studio area opensFormItemPagewith the area'scustomization,publishNonceandonDraftSaved. Only the area's surface holds a read-only base's customization. Without it, an installed app's form could not be saved as its override.ui/packages/app-shell/src/services/builtinComponents.tsx: theformresource's registration (listColumns, lazyEditPage/CreatePage). The claim namedmetadata-admin/registry.ts, but a registration there makes that module side-effectful andcheck-side-effects-arrayrefuses it; every other editor page registers here.ui/packages/app-shell/src/views/runtime-metadata-persistence.ts:RuntimeArtifactTypegains'form', and aformsave invalidates the view caches the way aviewsave does, because Setup's switch goes throughsaveAndPublishInPackage('form', …).Read first (by risk):
studio-design/publicForm/PublicFormsDesigner.tsx,storedNow,saveandpublish: the no-switch rule.setup/publicForms.ts,switchPublicForm/authorableForm/markShippedOff: the body a switch writes over an old-shape form.studio-design/publicForm/publicFormDesign.ts,publicFormItemOf: what is kept, and what is dropped (data,viewKind,config,_keys).Tests
publicFormDesign.test.ts(29): the top-level body both ways; a new form passesFormSchema.safeParse; an old-shape projected item is written back withoutdataor_formDefinedIn; sharing is written as read (off stays off, an unchanged address keeps the storedpublicLink, a changed one becomes/forms/SLUG); a form with no public link;isPublicFormItem.PublicFormsDesigner.test.tsx(14, the feat(studio): design an object's public forms in Studio's Form tab #36784 tests re-pointed to theformshape): create, taken address and name, delete, the no-switch rule at save and at publish, the publish re-save of a draft whose sharing differs, reads that fail, a form with no public link, an old-shape save withoutdata. Every write is asserted as typeformwith a bodyFormSchemaaccepts.setup/publicForms.test.ts,PublicFormsSetupPage.test.tsx: the list read and both layered reads areform; the shipped-off judgement from theformlayeredcode; a row whose app document cannot be read is status unknown with no switch; a switch over an old-shape row writes nodata.FormPage.*(about 30 files): the internal route reads/meta/form/NAME; the fixtures moved to the top-level body.PublicFormsDesigner.test.tsx(+2, head48a01c7ff7, L2 S2): "shows the server's address refusal its own check missed (409 FORM_ADDRESS_TAKEN) as the address clash, at save and at publish" and "CONTROL: shows any other 409 as a pending draft". Ablation (theFORM_ADDRESS_TAKENbranch deleted): 1 failed, 15 passed, the failure is the address case (received the pending-draft sentence), the CONTROL stayed green; restored to the HEAD blob.FormPage.recordObject.test.tsx(+1, L2 S3): "Log Time on a task: /meta/form/NAME is read, the form renders the record, and the submit writes it". The realActionRunnerruns{type:'form', target:'showcase_task.edit'}with record 42; FormPage reads exactly one/api/v1/meta/form/showcase_task.editand no/meta/view, renders the record and PATCHes/data/showcase_task/42.Acceptance notes
409 FORM_ADDRESS_TAKEN) still shows one sentence that does not name the form holding the address: naming it needs a new key in all 11 locale files, outside this surface. Carrier: PR 2 of Console reads and editsformitems: Setup public forms re-pointed, the PR #36784 designer becomes theformeditor in Studio (ADR-0159, card ③) #37087, under claim amendment 7251711074 (card item 1, "shows the refusal with both names"; L2 S1, L1 R2).48a01c7ff7and pinned by a test (see Verification, L2 S3).Remaining
formViews/viewKind: 'form'hits underui/Docblocks only in
FormPage.tsx,recordFormNavigation.ts,SchemaForm.tsx,clientValidation.ts,registry.ts,view-item-normalize.ts,freeze-schema.tsandimported-defaults.ts; the view editor's own form arm (anchors.ts,ViewPreview.tsx,view-item-normalize.ts), which still edits aview;MetadataProvider.tsx, kept on purpose for packages that still ship forms inviews:; and the developerPublicFormsPage, which PR 2 retires.Verification
ConditionWidget.conditionScope,studio-design/publicForm,StudioMetadataArea.*,views/setupandruntime-metadata-persistence.*: 35 files, 458 passed. An earlier run of all ofviews/metadata-admin,views/studio-designandviews/setupwas red only on the conditionScope exhaustiveness check, whileformwas registered inregistry.ts; moving the registration fixed it (the targeted run above). Alsopackages/i18nplus the console'ssrc/componentsand the two form-page tests insrc/__tests__: 173 files, 2618 passed, 13 skipped.@object-ui/consoletype-checkexit 0 (after building its dependencies).dispatch-gates --commandsderived 28 families, each run and recorded;--ranreconciles 28 derived, 28 run, 0 NOT-MEASURED.pnpm --dir ui exec vitest run scripts/was killed by memory (SIGKILL, exit 1) while a build ran beside it; run again alone it exits 0, recorded as an extra line.examples/app-showcase,objectstack dev, console dev server, signed in as the seeded admin):formitems, both on. Switching Contact off makesGET /forms/contact-usand its submit answer 404; switching it on again answers 200.showcase_inquiry.contactat/studio/com.example.showcase/metadata/form/showcase_inquiry.contact. Removingmessageis refused (the object requires it). Addingsourceas required, removingcompanyand retitling, then save and publish: the anonymous form serves the new title and fields, a submit withoutsourceanswers400 VALIDATION_FAILED, with it201..custompair, published, and opens and accepts a submit (201).formlist shows the label/title, name, object, address and status columns./mnt/project-files/card-37087/pr1-dogfood/(seat 3's project files).48a01c7ff7(L2 S2 and S3; the designer's 409 mapping, two tests, one changeset sentence):PublicFormsDesigner.test.tsx,publicFormDesign.test.tsandFormPage.recordObject.test.tsx3 files, 55 passed;@object-ui/app-shelland@object-ui/consoletype-checkexit 0;pnpm --dir ui exec vitest run scripts/172 passed, 2 skipped. The server's refusal (formAddressClashRefusal,packages/metadata-protocol/src/protocol-form-writes.ts) carries status 409 and codeFORM_ADDRESS_TAKENand names the holder only in its prose, so the editor maps the code to the shippedaddressTakenkey (no structured holder foraddressTakenBy; no key added).48a01c7ff7,examples/app-showcase): on task "Build homepage", the header action Log Time (showcase_log_time, typeform, targetshowcase_task.form) navigates to/apps/com.example.showcase/forms/showcase_task.form?recordId=…&recordObject=showcase_task;GET /api/v1/meta/form/showcase_task.formanswers 200 and no/meta/view/NAMEis read; the form renders prefilled; Submit sendsPATCH /api/v1/data/showcase_task/…200 and the record reads the new title. Screenshots and the network log:/mnt/project-files/card-37087/pr1-dogfood/s3-*.png,s3-network.json; the live 409 envelope:s2-envelope-probe.txt(project files of the seat 5 project).pnpm --filter @objectstack/dogfood testunder os-verify-lock, closure built as CI does, no shard, no path): headd5581291b6· VERDICT exit 0 · Test Files 495 passed, 3 skipped (498) · Tests 4183 passed, 68 skipped (4251) · failures: none. The head moved since by the patch round's fourui/files and the changeset only; none is in the dogfood closure.Ablation of the no-switch rule (L1-b R1, card Done-when "ablate: build the designer's save from the base's body")
Measured at head
d5581291b6, in a throwaway detached worktree, throughscripts/ablation-replace.mjs(HEAD-blob restore with hash check), from theui/root under os-verify-lock:pnpm exec vitest run --maxWorkers=2 --reporter=verbose packages/app-shell/src/views/studio-design/publicForm/PublicFormsDesigner.test.tsx packages/app-shell/src/views/studio-design/publicForm/publicFormDesign.test.ts.PublicFormsDesigner.tsx, the single point where bothsaveandpublishread the sharing throughstoredNow): the sharing is taken from the body as it was opened,form.base.sharing, before the effective, draft and code layers.PublicFormsDesigner.test.tsx:376,expected true to be falseonsharing.enabled; the save leg);PublicFormsDesigner.test.tsx:425, the publish-time re-save carrying the switched-off sharing never happened; the publish leg).publicFormDesign.test.tsstayed 29/29, as expected (publicFormItemOfwrites whatever sharing it is handed).0e7cb3887bequals HEAD,git diff HEADempty, 43/43 green again.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibxQiu6MyZ2ngLJtA5Y