Repository navigation
feat(studio): design an object's public forms in Studio's Form tab - #36784
objectstack-fleet[bot] wants to merge 4 commits into
Conversation
Studio → Data → an object → Form switches between the record form and the object's public forms. The designer lists them (published and drafted), creates and deletes one, picks fillable fields only, reorders them, marks them required and groups them into named sections, and sets the title, description, after-submit message and address, with a live preview. A field the object requires cannot be removed, and an address another form uses is refused. Saves follow draft and publish; an installed app's form is saved as a declared override in its customization package. The designer's list, like Setup → Public forms, never shows On for a form its app ships switched off; an unknown row in Setup offers no switch; the withdrawal rule's docblock names its real callers, and the checklist item points at its new source. Claude-Session: https://claude.ai/code/session_01JQwxbWoxCrkYwcqxxENvmn Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check
What this run could not see
Coarse fallback — 175 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
… module; re-point the last checklist anchors at the spec check-vi-mock-inherit refuses a factory that never obtains the real module. The platform checklist's verify steps still anchored anonymousFormIntakeWithdrawnIn and anonymousFormExplicitWithdrawals in metadata-core, where the second no longer exists. Claude-Session: https://claude.ai/code/session_01JQwxbWoxCrkYwcqxxENvmn Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Contract reviewServed-tier: PR #36784 (card #36444, part 2: the Studio designer), reviewed against merge-base
① Derived judgmentsThe spec change is prose only. The prose is accurate. Callers of the function at the head, outside tests:
N9, N10, N12 of record 7113373743.
The designer's list. Writes on an installed app, against part 1's rules.
Locale keys. The designer and the surface control use 61 keys; all 61 are present in both ② Semver level
③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: FAIL |
- A new form's name may be no other view item's: the name is checked against every view item of the environment (published or drafted), not only the listed public forms. - Writing a form back keeps every key it did not edit for more stored shapes: a section stored without a name is matched by the same key the designer gave it, a field moved across sections keeps its own entry keys, and a title, description, after-submit text or section label the person did not change is kept as stored (including one stored as a map of translations). - The save no longer writes the form's on/off switch from a stale read. - No column count is written onto a section that had none. Claude-Session: https://claude.ai/code/session_01JQwxbWoxCrkYwcqxxENvmn Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj Contract reviewServed-tier: PR #36784 (card #36444, part 2: the Studio designer), second round. The first round is record 7117275850 at head
New in this round, none blocking:
① Derived judgmentsThe spec is untouched by the delta. Each closing claim against the code.
The new cases test what they name. The unnamed-section case asserts the whole written section with Writes on an installed app. Unchanged from round one: ② Semver levelUnchanged from round one. The delta adds no export, no locale key, no route, no stored key and no component or test id that a consumer reads; ③ Boundary flags
④ Design judgment
The three places where round one found a write changing something the person did not edit are closed. What is left (N8 to N12) is narrow and can follow on the card. Implemented-by: VERDICT: PASS |
…d draft - Publish takes the draft from the layered read it already makes (the stored, untranslated draft) instead of the draft read meant for display, and publishes nothing when that draft or the form's switch cannot be read. - An unedited after-submit title stored as translations is kept when the message is cleared. - Tests: publishing an installed app's form after it was switched off, read at the package that ships it; nothing saved when the switch cannot be read; nothing published when the draft cannot be read. Claude-Session: https://claude.ai/code/session_01JQwxbWoxCrkYwcqxxENvmn Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR Note: The three pillars have moved out of
SDS (now 1,715 lines) re-exports the three pillars and |
|
repo:objectstack#1 · os-warren · session_01JQwxbWoxCrkYwcqxxENvmn Closing this draft without merging, at the maintainer's direction. ADR-0159 (#36957) makes forms their own
Two small fixes exist only on this branch and are not on
The branch Generated by Claude Code |
Requested by Warren · project thread
Fixes #36444. This PR is the card's Studio = design half (ruling items 1–5 of #36444 (comment)). The Settings = operations half landed in #36697. It also carries #36697's round-3 follow-ups N9, N10 and N12 (record 7113373743).
Clause-②: yes (widening) — new Studio language-pack keys (
engine.studio.data.form.surface*and theengine.studio.publicForms.*block) in en and zh;@objectstack/specships a corrected docblock foranonymousFormIntakeWithdrawnIn(prose only, no export or behaviour changes)Metadata-protocol: none
维护者速读
What changes
formSurfaceControlin the Form tab's toolbar,data-form-surface). No new tab: the Data pillar keeps its seven (objectui#12450).ui/packages/app-shell/src/views/studio-design/publicForm/PublicFormsDesigner.tsx) lists the object's public forms, published and only drafted, and:<object>.<address>; a name any other view item of the environment already has (a list view such ascrm_lead.all, the record form, a draft) is refused like a used address;submitBehavior: { kind: 'thank-you' }, removed when cleared) and the address;ObjectFormfrom the sections being edited.publicFormDesign.ts, pure, unit-tested):required: truewith nodefaultValueand no default option, so a field the write path fills in (app-crm's leadstatus, defaultnew) is not held.publicFormItemOf), so the served rule (anonymousFormIntakeCandidates) still opens it at the same address. That includes the shapes the spec allows besides the plain one: a section stored without anameis matched by the same positional key the designer gave it (section_<n>, never one another section uses), so its description, columns, collapse and visibility keys stay; a field moved to another section keeps its own entry keys; a title, description, after-submit text or section label the person did not change is kept as stored, including one stored as a map of translations. No column count is written onto a section that had none.overrideDraftBody), never in the app; a new form goes into the customization package (customization.ensure());ifNoneMatch: '*'on a form with no draft).viewKind: 'form',config.sharing); no key is added. Access restrictions (password, expiry, domains) are not offered, per the ruling.publicFormShownName): its label, else its title, else its first section's label, else its key.markShippedOff, now generic over the row shape): a form its app ships withdrawn is listed "Off (its app ships it off)", never On; a form whose app document cannot be read is listed "Unknown" (review M1/S2/N5, applied to Studio).anonymousFormIntakeWithdrawnIn's docblock inpackages/spec/src/ui/anonymous-form-intake.tsnames its real callers (the anonymous form doors, the v18 organization-ownership migration, the console's Setup page) and drops the organization-scoped write door that no longer calls it. Prose only.docs/qa/platform-checklist/areas/access-security.jsonpointsanonymousFormIntakeWithdrawnInandanonymousFormExplicitWithdrawalsat their new source,packages/spec/src/ui/anonymous-form-intake.ts.Boundaries
nav_public_forms) stays as it is in this PR. Ruling item 1 says that page is upgraded into the designer; this PR builds the designer under the object (Studio → Data → an object → Form → Public forms) and does not remove, redirect or change the Developer page. Retiring it or pointing it at the designer is a follow-up for the card.Tests
ui/packages/app-shell/src/views/studio-design/publicForm/publicFormDesign.test.ts(24 cases): fillable fields (hidden, read-only, system, formula, summary, autonumber excluded;fieldsas an array); object-required fields, with a default value or default choice not held; reading a stored form (title, address, sections, required marks); writing back only what was edited, keeping every other key, dropping_decorations, the served rule still opening it at the same address; the thank-you panel written and removed; a non-thank-you submit behaviour kept; a new form's name, sections and served candidate; addresses from titles; the address rule (empty, shape, taken including switched-off forms, the form's own address); the field edits (refused removal of a required field, required kept, add once, move within and across sections, sections added, moved and removed keeping their fields); missing required fields; the preview's sections; a section stored without a name keeping every key, its field entries' keys and a moved field's keys; an unnamed section keyed apart from a section named like its place; titles, description, section labels and thank-you texts stored as translation maps kept when not edited and replaced when edited; no column count written onto a section that had none.PublicFormsDesigner.test.tsx(11 cases, rendered over a metadata client double): the list (published and drafted, not internal or another object's forms); the HotCRM edit on an installed app's form (Phone required, Title removed, new title) saved as a draft in the customization package declaring the override, then published there, the app's own package never written; the required-field refusal with its reason; a new form with four fields; a duplicate address refused with nothing saved; a named section; delete refused for the app's form and done for a writable package's; a form its app ships switched off listed as off even under an override that switches it on; a new form named like the object's list view (crm_lead.all) or record form refused, a free name accepted; the save and the publish carrying the on/off switch as stored at that time; a draft that already carries it published without a second save.ui/packages/app-shell/src/views/setup/PublicFormsSetupPage.test.tsx: the Unknown row's switch is disabled (N12).markShippedOfffrom the designer's list, or the Unknown condition from the Setup switch, each turns one case red.Acceptance notes
Live run on
examples/app-crm(objectstack dev --seed-admin --fresh) + console dev server, as the seeded admin.com.example.crmis installed read-only, so this exercised the customization path. This was run before the rebase ontomainat the Part 1 head; the code paths it walked are unchanged by the follow-ups except for the list's shipped-off mark, which is unit- and render-tested.com.example.crm.custom;GET /api/v1/forms/contact-usserves the new title and fieldscontact-usdemo-signupwith name, company, email, and phone in an "About you" section, with a thank-you messageGET /api/v1/forms/demo-signup→ 200;/f/demo-signuprenders anonymouslyScreenshots (live run, 2× scale) are in the project's shared files under
issue-36444/; they cannot be uploaded to GitHub from the cloud seat:11-studio-designer-open.png: the designer on Lead's "Contact us", with the preview.12-studio-required-refused.png: removing a required field refused, with the reason.13-studio-designer-edited.png: Phone required, Title removed, the new title.14-studio-duplicate-address.png: a used address refused.15-studio-new-form.png: "Demo signup" with its two sections.16-studio-list-after.png: the designer's list after both changes.17-anon-demo-signup.png: the new form at its anonymous address.18-setup-after-studio.png: Setup → Public forms listing both.Known: the preview's footer shows the runtime form's own Cancel and Create buttons, not the anonymous page's Submit.
Verification
Head
5e8aaa4bc0: the squashed Part 2 commit90ed3338c3, the fix commit80ebf09091and the review-fix commit5e8aaa4bc0(S1–S3 and N3 of contract review 7117275850), onmaind59d875114(which includes #36697 asc45dd80ff9).5e8aaa4bc0:80ebf09091's code (checked by swapping the two source files back); the seventh, no second save when the draft already carries the switch, guards the publish path;@object-ui/app-shelltype-check (src + tests): exit 0; ESLint on the designer folder: 0 errors;check-vi-mock-inherit,check-vi-mock-override-shape,check-new-cross-file-line-citations,check-control-bytes,check-i18n-call-site-keys,pnpm check:platform-checklist: exit 0. The derived gate list is the same 90 commands as at80ebf09091, and this commit touches only the four designer files;90ed3338c3/80ebf09091: the derived gate union (dispatch-gates --commands, 90 commands) ran 88 exit 0 on90ed3338c3; the two that did not (pnpm check:platform-checklist, stale checklist anchors;pnpm --dir ui exec vitest run scripts/, the designer test's@object-ui/plugin-formmock not spreadingimportOriginal()) were fixed in80ebf09091. CI on80ebf09091: 60 success, 10 skipped, 0 failure.peopleAssignments.navContribution.test.tsx("Position holders" heading) fails locally onmaintoo and is green in CI; not touched here.80ebf09091): 设置里新增「对外表单」:列出全部对外表单,能开关、复制地址、改字段和标题、新建(现在只能写在应用定义里) #36444 (comment)Generated by Claude Code