Skip to content

feat(studio): design an object's public forms in Studio's Form tab - #36784

Closed
objectstack-fleet[bot] wants to merge 4 commits into
mainfrom
claude/project-thread-d8t1hm
Closed

objectstack-fleet[bot] wants to merge 4 commits into
mainfrom
claude/project-thread-d8t1hm

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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 the engine.studio.publicForms.* block) in en and zh; @objectstack/spec ships a corrected docblock for anonymousFormIntakeWithdrawnIn (prose only, no export or behaviour changes)
Metadata-protocol: none

维护者速读

  • Studio › 数据 › 对象 › 表单 新增「对外表单」:在对象下直接新建、删除对外表单,挑选字段(只列可填写的字段)、拖动排序、设必填、分组,设置标题、说明、提交后提示语和地址,右侧实时预览。
  • 对象必填的字段不能从表单移除,并说明原因;地址被其他表单占用时(包括已关闭的表单)拒绝保存并提示。
  • 保存走草稿 → 发布;已安装应用自带的表单存为本环境的定制,不改应用本身;应用自带的表单不能删除,需关闭请到 设置 › 对外表单。
  • 应用发布时就关闭的表单,设计器列表里显示「已关闭(应用自带关闭)」,不会显示为开启。

What changes

  • Studio → Data → an object → Form now switches between the Record form (the New and Edit dialogs' layout, as before) and the object's Public forms (formSurfaceControl in the Form tab's toolbar, data-form-surface). No new tab: the Data pillar keeps its seven (objectui#12450).
  • The designer (ui/packages/app-shell/src/views/studio-design/publicForm/PublicFormsDesigner.tsx) lists the object's public forms, published and only drafted, and:
    • creates one from a title and an address; a new form starts with one section holding the fields the object requires, and is saved as <object>.<address>; a name any other view item of the environment already has (a list view such as crm_lead.all, the record form, a draft) is refused like a used address;
    • deletes one;
    • picks fields from the object's fillable ones only: never a hidden, read-only, system, formula, roll-up or auto-number field;
    • reorders fields by dragging or with the move buttons, marks them required, and groups them into named sections;
    • sets the title, description, after-submit heading and message (submitBehavior: { kind: 'thank-you' }, removed when cleared) and the address;
    • shows the form live as it is edited, rendered by the runtime ObjectForm from the sections being edited.
  • The rules (publicFormDesign.ts, pure, unit-tested):
    • A field the object requires cannot be removed and stays required on the form. "Requires" means required: true with no defaultValue and no default option, so a field the write path fills in (app-crm's lead status, default new) is not held.
    • An address must be 2–64 characters of lowercase letters, digits and single hyphens, and must not be used by another form, switched-off forms included. A clash is refused with a message and nothing is saved.
    • A saved design keeps every key it did not edit (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 a name is 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.
  • Saves follow draft → publish, as Studio's other designers do:
    • a form of a writable package is saved in that package;
    • on an installed app, a form the app ships is saved as a declared override in the app's customization package (ADR-0146 D2/D3, overrideDraftBody), never in the app; a new form goes into the customization package (customization.ensure());
    • a form the app ships cannot be deleted; the designer says to switch it off in Setup → Public forms instead;
    • a draft written meanwhile is never overwritten (ifNoneMatch: '*' on a form with no draft).
  • Switching a form on or off stays Setup's: the save no longer writes the form's on/off switch from a stale read. The stored shape is the form view item it always was (viewKind: 'form', config.sharing); no key is added. Access restrictions (password, expiry, domains) are not offered, per the ruling.
  • Setup → Public forms now names a form by the designer's rule (publicFormShownName): its label, else its title, else its first section's label, else its key.
  • feat(setup): Setup → Configuration → Public forms lists and switches every public form #36697 follow-ups:
    • The designer's list reads an installed app's forms the way Setup does (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).
    • N12: on Setup → Public forms, an Unknown row offers no switch; Refresh reads it again.
    • N9: anonymousFormIntakeWithdrawnIn's docblock in packages/spec/src/ui/anonymous-form-intake.ts names 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.
    • N10: docs/qa/platform-checklist/areas/access-security.json points anonymousFormIntakeWithdrawnIn and anonymousFormExplicitWithdrawals at their new source, packages/spec/src/ui/anonymous-form-intake.ts.

Boundaries

  • Developer → Public Forms (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.
  • A designer draft holds Setup's switch. Setup's on/off switch refuses over a pending draft (feat(setup): Setup → Configuration → Public forms lists and switches every public form #36697's pending-draft rule), so a public form left saved-but-unpublished in Studio cannot be switched in Setup → Public forms until that draft is published or discarded. Setup says so when it refuses.
  • Known limits (review N4–N6, not changed here):
    • Opening a form that has a pending draft loads that draft, shows "Draft saved" and offers Publish, whoever saved it: Studio's ordinary draft → publish. The chip does not say the draft may be another person's (N5).
    • The address check sees the published list and this object's draft-only forms, not another object's draft-only form or a pending draft that moves a published form's address, so two drafts can claim one address until one is published (N4).
    • Delete is withheld only for a form the open object's own app ships; a form of the object shipped by another read-only package relies on the server's refusal (N6).

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; fields as 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).
  • Ablations: removing markShippedOff from 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.crm is installed read-only, so this exercised the customization path. This was run before the rebase onto main at 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.

Step Result
Studio → Data → Lead → Form → Public forms "Contact us" listed, On; the editor and live preview open
Remove the required "Lead Name" refused, with the reason on screen
Make Phone required, remove Title, change the title to "Talk to sales", save, publish saved as an override in com.example.crm.custom; GET /api/v1/forms/contact-us serves the new title and fields
Create "Demo signup" at contact-us refused: the address is used by another form
Create "Demo signup" at demo-signup with name, company, email, and phone in an "About you" section, with a thank-you message published; GET /api/v1/forms/demo-signup → 200; /f/demo-signup renders anonymously
Setup → Public forms both forms listed

Screenshots (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 commit 90ed3338c3, the fix commit 80ebf09091 and the review-fix commit 5e8aaa4bc0 (S1–S3 and N3 of contract review 7117275850), on main d59d875114 (which includes #36697 as c45dd80ff9).

  • 5e8aaa4bc0:
    • the public form designer suites: 35 passed (24 rule cases, 11 rendered); of the seven new cases, the six that pin S1–S3 and N3 fail on 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-shell type-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 at 80ebf09091, and this commit touches only the four designer files;
    • CI: all 70 check-runs completed — 60 success, 10 skipped (opt-in, queue and schedule gates), 0 failure.
  • Earlier, on 90ed3338c3/80ebf09091: the derived gate union (dispatch-gates --commands, 90 commands) ran 88 exit 0 on 90ed3338c3; 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-form mock not spreading importOriginal()) were fixed in 80ebf09091. CI on 80ebf09091: 60 success, 10 skipped, 0 failure. peopleAssignments.navContribution.test.tsx ("Position holders" heading) fails locally on main too and is green in CI; not touched here.
  • os-dev report (at 80ebf09091): 设置里新增「对外表单」:列出全部对外表单,能开关、复制地址、改字段和标题、新建(现在只能写在应用定义里) #36444 (comment)

Generated by Claude Code

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>
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation protocol:ui tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️ 1 changed file(s) yielded no anchor (packages/spec/src/ui/anonymous-form-intake.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/spec/src/ui/anonymous-form-intake.ts) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 175 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 844218f564fb73746c880284a31b5871b3f40592 → packageMentionDocs.

… 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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 80ebf09091f6f799c0168d56a7213a06238591e8
Local-runs: probe — node scripts/check-platform-checklist.mjs on an archive of the head, to test whether the platform-checklist anchors resolve; it stopped at its own self-test (generated spec module not built), so the anchors were read against the tree instead
Scope: packages/spec/src/ui/anonymous-form-intake.ts + ui/packages/app-shell/src/views/setup/publicForms.ts, ui/packages/app-shell/src/views/setup/PublicFormsSetupPage.tsx, ui/packages/app-shell/src/views/setup/PublicFormsSetupPage.test.tsx, ui/packages/app-shell/src/views/studio-design/publicForm/publicFormDesign.ts, ui/packages/app-shell/src/views/studio-design/publicForm/PublicFormsDesigner.tsx, ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx, ui/packages/i18n/src/namespaces/studio/en.ts, ui/packages/i18n/src/namespaces/studio/zh.ts, docs/qa/platform-checklist/areas/access-security.json
Security-touching: yes
Rule-change-verified: none

PR #36784 (card #36444, part 2: the Studio designer), reviewed against merge-base d59d8751149d33eb21de31c090a907e7a6d824f0. Two commits, 13 files, +2145 −45. Read with git diff / git show and the REST API; nothing was checked out or built. Inputs: the PR body, the card and ruling comment 7100386248, PR #36697's body and its round-3 record 7113373743 (N9, N10, N12). Code outside the diff was read but not reviewed: form-routes.ts, organization-ownership-apply.ts, runtime-metadata-persistence.ts, StudioCustomizeControls.tsx, view.zod.ts, i18n.zod.ts, protocol.ts.

  • S1 (should-fix): open. A new form's name is checked only against the object's public forms, not against the object's other views. newPublicFormName gives <object>.<address with underscores>, and nameTaken (PublicFormsDesigner.tsx:353-357) looks in listed, which holds public forms only. A list view or the record form uses the same name space (crm_lead.all, crm_lead.pipeline, crm_lead.form; the designer test's own fixture lists crm_lead.all). A form created at address all is saved as a draft of crm_lead.all with base: null, so the body replaces the whole item, and Publish puts a form where the list view was. ifNoneMatch: '*' guards a pending draft, not the published item. In a writable package nothing refuses it. The fix is small: test the name against every item of the view list the effect already holds (items), and add a case.
  • S2 (should-fix): open. "A saved design keeps every key it did not edit" does not hold for two shapes the spec accepts. (a) A section with no name (FormSectionSchema.name is optional). publicFormModelOf gives it the key section_<n> (publicFormDesign.ts:172), but publicFormItemOf looks the stored section up by its stored name (:225-228, :235), finds nothing, and writes the section from scratch. Its description, columns, collapse and visibility keys are lost, and so is every key of its field entries other than field and required (sectionBody, :199-213). (b) A label written as an inline locale map (I18nLabelSchema is a string or a map). text() reads it as empty, and the save then deletes it: a section label (:210-211) and config.title (:231-232). Any save of such a form, with nothing edited in those places, drops them. Neither shape has a test case.
  • S3 (should-fix): open. The saved body carries the form's switch as the designer read it when the form was opened (publicFormDesign.ts:191, :236-239), so the claim "switching a form on or off stays Setup's" is not held by the write. Detail is with the seat, outside this record.
  • N1: The corrected docblock names Setup's page as the console caller. The designer's list now reaches the function through the same markShippedOff; the module named is still the one caller, so the text is accurate. Its closing sentence ("a form published only in an organization stays open there") predates this PR and reads oddly beside ADR-0131; it was not touched.
  • N2: The PR body says Setup "now names a form by the designer's rule". shownName moved into publicFormDesign.ts as publicFormShownName with the same five steps in the same order. No name on Setup's page changes.
  • N3: publicFormItemOf writes a few keys nobody edited: columns: 1 on a section that had none, label set to the title, type: 'simple', data, and an explicit enabled: false where the switch was omitted. Each is the value the form already had in effect, except columns, where an absent key and 1 may not render alike. A title cannot be cleared while the item has a label, because the model falls back to it on the next read.
  • N4: takenAddresses reads the published list and this object's draft-only forms. It does not see another object's draft-only form, nor a published form's pending draft that changes its address, so two drafts can claim one address until one is published.
  • N5: Opening a form that has a pending draft loads that draft, shows "Draft saved" and enables Publish, whoever saved it. That is Studio's ordinary draft → publish and an explicit act; it differs from Setup's rule by design. The chip does not say the draft may be another person's.
  • N6: shippedByApp covers the open object's own app only. A form of the object shipped by a different read-only package is offered Delete and a plain save, and relies on the server's refusal.
  • N7: The PR body's Verification section still names head 90ed3338c3. The head is 80ebf09091.

① Derived judgments

The spec change is prose only. git diff on packages/spec shows one file, +15 −12, and every changed line is a * comment line inside the docblock of anonymousFormIntakeWithdrawnIn. No signature, export, schema or statement moved. packages/spec/api-surface/** and export-origins/** are not in the diff.

The prose is accurate. Callers of the function at the head, outside tests:

Docblock claim Source at head Holds
the anonymous form doors pass the environment's view list packages/rest/src/form-routes.ts:201, findPublicFormView(views, withdrawalLayer, slug) yes
the v18 organization-ownership migration passes the organization rows it carries packages/cli/src/utils/organization-ownership-apply.ts:1664 and :1912; layer is built from the organization's view rows yes
the command is os migrate organization-ownership --apply packages/cli/src/commands/migrate/apply.ts:642-643 yes
Setup's page passes an installed app's own document ui/packages/app-shell/src/views/setup/publicForms.ts:226, [named] yes
no organization-scoped write door calls it no call in packages/metadata-protocol/src yes

N9, N10, N12 of record 7113373743.

  • N9 is closed: the docblock names the three callers and no longer names the write door. The two paragraphs that described what that door passed are removed with it.
  • N10 is closed: lines 1876 and 1877 of access-security.json now give packages/spec/src/ui/anonymous-form-intake.ts, and the second commit moves the two verify strings at lines 1826 and 1838 as well. Read against the tree: anonymousFormIntakeWithdrawnIn is at line 219 of that file and anonymousFormExplicitWithdrawals at line 156. The one anchor left on packages/metadata-core/src/anonymous-form-intake.ts (line 1806) names anonymousFormIntakeUnavailability, which is still declared there (line 154). The test-file reference at line 1873 is a real file.
  • N12 is closed: the switch is disabled when row.unknown (PublicFormsSetupPage.tsx:280), and the rendered Unknown case asserts toBeDisabled(). An Unknown row already read off, so the only action removed is a switch-on.

The designer's list. markShippedOff is now generic over the row shape and its body is unchanged. The designer passes its rows through it, so a form its app ships withdrawn is listed "Off (its app ships it off)" and a row whose layers cannot be read "Unknown". The render order (!published, on, shippedOff, unknown, off) cannot show On for either, because markShippedOff sets on: false for both. The designer test covers the override-switches-it-on case.

Writes on an installed app, against part 1's rules.

  • A form the app ships is saved in the customization package with the override declared (writeTarget, overrideDraftBody); a declaration the stored document already carries is kept. The effective list serves an override under its base's package id (protocol.ts, ADR-0146 D8 item 2), so shippedByApp stays true once an override exists, and Delete stays refused.
  • A new form goes to the pair from customization.ensure().
  • An app-shipped-off form stays closed whatever the designer publishes: the routes judge the app's own document, which the designer never writes.
  • The gate is the server's: every write is a save / publish / reset on the metadata doors, and the ensure door judges the caller as before. The designer adds no door.
  • A pending draft: see N5.

Locale keys. The designer and the surface control use 61 keys; all 61 are present in both en.ts and zh.ts, and the studio catalogue has only those two locales.

② Semver level

  • @objectstack/spec: patch is right: published declaration bytes change (a docblock), nothing an author or importer can observe.
  • @object-ui/app-shell: patch and @object-ui/i18n: patch are right. The designer modules are not named in ui/packages/app-shell/src/index.ts or the package manifest, so no export is added. markShippedOff's signature is widened by a type parameter and accepts every earlier call.
  • Clause-②: yes (widening) holds, for the new locale keys. The PR body's line also names the spec docblock; the changeset's line names the keys and states the docblock in its body. Both carry the same value.
  • Metadata-protocol: none holds: the stored shape is the form view item with config.sharing and submitBehavior, all existing keys. No route, error code, Setup nav id or component id is added; the Form tab gains a control and two test ids.

③ Boundary flags

  • Ruling item 1 says Studio's Developer → Public Forms page is upgraded into the designer and placed under the object. This PR builds the designer under the object and leaves the Developer page (nav_public_forms) as it is. The PR body does not say what becomes of that page; the seat should state it on the card.
  • With the designer, a pending draft on a public form becomes ordinary. Setup's switch refuses over a pending draft (part 1's rule, 'pending-draft'), so a draft left unpublished in Studio stops an administrator from switching that form off in Setup until it is published or discarded. This is part 1's accepted rule meeting a new source of drafts; it is a product question for the seat, not a defect of this diff.
  • Behaviour for an existing user: the Form tab opens on the record form as before; Setup's page changes only in the disabled Unknown switch.
  • SQL push-down: no record query in the diff. The list makes one layered read per installed-app form, as Setup's does.
  • Author: objectstack-fleet[bot]; no separate login to name. The PR is a draft with auto-merge not armed.
  • The PR touches no .claude/** path and declares no Rule-change: line.
  • Check-runs at the head: 60 success, 10 skipped, none failed, none pending.

④ Design judgment

packages/spec/src/ui/anonymous-form-intake.ts (hits): the docblock now describes the function as its callers use it. The identity paragraph keeps the one caller whose identity rule matters to a reader (the doors, by served item name, with the known limit). The removed text described a caller that does not exist, so a reader of the shipped declarations is no longer told a write door enforces this. Nothing a consumer could rely on changed.

ui/packages/app-shell/src/views/setup/**: the Unknown switch and the generic markShippedOff agree with the module header, which already says an unreadable row is never shown on.

publicFormDesign.ts and PublicFormsDesigner.tsx: the design is sound where the PR tests it. The fillable-field rule, the required-field rule (a default value or default option is not held, which matches the write path), the address rule over switched-off forms, the override path and the refusal to delete an app's form all hold against the code they rest on. It does not hold in three places: the name a new form takes (S1), the keys a save promises to keep (S2) and the switch value a save writes (S3). Each is a write that changes something the person did not edit.

Implemented-by: claude/project-thread-d8t1hm
Reviewed-by: session_01JQwxbZeHNsF3RWcWpj7rGj

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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 5e8aaa4bc0751a4cd4071af088edbd759443261a
Local-runs: none
Scope: the delta 80ebf09091..5e8aaa4bc0 (one commit, 4 files, +299 −38): ui/packages/app-shell/src/views/studio-design/publicForm/publicFormDesign.ts, ui/packages/app-shell/src/views/studio-design/publicForm/PublicFormsDesigner.tsx, ui/packages/app-shell/src/views/studio-design/publicForm/publicFormDesign.test.ts, ui/packages/app-shell/src/views/studio-design/publicForm/PublicFormsDesigner.test.tsx; and the PR body (v3)
Security-touching: yes
Rule-change-verified: none

PR #36784 (card #36444, part 2: the Studio designer), second round. The first round is record 7117275850 at head 80ebf09091 (FAIL: S1, S2, S3). This round reads the one commit since, with git diff / git show and the REST API; nothing was checked out, built or run. packages/spec is not in the delta, so the first round's judgment of the docblock (prose only, accurate, patch) stands as written. Code outside the delta was read but not reviewed: publicForms.ts, runtime-metadata-persistence.ts, StudioDesignSurface.tsx, metadata-client.ts (getDraft), protocol-meta-layered-reads.ts, meta-item-read-routes.ts, meta-item-read-gate.ts.

  • S1: closed. The list effect now keeps every view item name of the environment: the published list's (items, every object and every view kind) and each pending view draft's (viewNames, PublicFormsDesigner.tsx:188-193). nameTaken tests the new form's name against that set (:395); it disables Create and create() returns early. The rendered case types the title "All" (name crm_lead.all, the fixture's list view) and then the address form (crm_lead.form, the record form): both leave Create disabled, all-leads enables it, and nothing is saved. The message shown is the used-address one; the PR body says so ("refused like a used address").
  • S2: closed. (a) sectionKeysOf is the one rule for a stored section's key, and both publicFormModelOf and publicFormItemOf call it over the same storedSections, so an unnamed section is matched with what it stored. A positional key skips any key a named section holds: [<unnamed>, section_1] gives section_2, section_1, pinned. Field entries are looked up across all stored sections (fieldsWas, first occurrence), so a field moved to another section keeps its keys, pinned. (b) publicFormItemOf reads the base back through publicFormModelOf and writes a text only when the model's value differs from that read: config.title and the item label, config.description, each of the two thank-you texts, and a section's label. A locale map is therefore left as stored, and an edited text replaces it; both pinned.
  • S3: closed. The save no longer writes the form's on/off switch from a stale read. Detail is with the seat, outside this record, together with one note on the publish step.
  • N3: closed. sectionBody no longer writes columns; a new form's sections carry no columns key and a stored columns: 1 is kept, pinned.
  • N7: closed. Verification names head 5e8aaa4bc0 and the three commits.
  • Boundary flags: stated. The PR body has a "Boundaries" section that says nav_public_forms stays as it is and its retirement is a follow-up for the card, and that a designer draft holds Setup's switch until it is published or discarded. N4, N5 and N6 are listed there as known limits.

New in this round, none blocking:

  • N8: Publish may save the draft once more before it publishes. The body it saves is the ?state=draft read's item (client.getDraft, PublicFormsDesigner.tsx:320-326) with its top-level _ keys removed. That read is the decorated one, and the server translates it for the request's locale (createMetaItemAnswer step 5; metadata-client.ts says not to hand .item to a write and names extractDraftBody as its reader). The editor itself builds from the layered read's draft layer for this reason. On that path a title or label can be written back in the publisher's language over a stored key or locale map, which S2 (b) otherwise prevents. The path is taken rarely. The layered read made two lines earlier already carries the draft as stored.
  • N9: A thank-you title stored as a locale map shows empty. Clearing the message then leaves both texts empty in the model, and the save removes submitBehavior whole, the unedited map with it (publicFormItemOf, the else if (was) branch).
  • N10: A section stored without a name is written back with name: section_<n>, and the second of two sections stored under one name is written under a positional key. Both are keys nobody edited; neither changes what the form serves.
  • N11: The rendered cases pin a fresh switch at save and the extra save before publish. Not pinned: a failed read refusing the write, the read at the app's package when the customization package holds nothing, and the publish case in the off direction (the code is the same for both directions).
  • N12: The PR body counts 70 check-runs at the head (60 success, 10 skipped). The REST API lists 74 completed: 62 success, 12 skipped, none failed, none pending.

① Derived judgments

The spec is untouched by the delta. git diff 80ebf09091 5e8aaa4bc0 -- packages/spec is empty. The four files changed are the designer's two modules and their two tests.

Each closing claim against the code.

Item Claim in the PR body Source at head Holds
S1 a name any other view item of the environment has is refused PublicFormsDesigner.tsx:188-193, :395, :398, :574 yes
S2 (a) an unnamed section is matched by the same positional key, never one another section uses publicFormDesign.ts sectionKeysOf, called in publicFormModelOf and publicFormItemOf yes
S2 (a) a field moved to another section keeps its own entry keys fieldsWas built over every stored section yes
S2 (b) a text the person did not change is kept as stored, a map included read comparison in publicFormItemOf; sectionBody early return yes, except N9
N3 no column count is written onto a section that had none the columns line is removed from sectionBody yes
S3 the save no longer writes the switch from a stale read currentSwitch, called in save and publish yes

The new cases test what they name. The unnamed-section case asserts the whole written section with toEqual, so a dropped key fails it. The clash case asserts the keys and that each label stays with its own columns. The locale-map case asserts the four stored maps after an unrelated edit, then that an edited title and section label replace them. The rendered name case and the two switch cases drive the component over a client double that now holds state (the served item and the saved drafts), so a second read sees what Setup or the designer wrote. The PR body reports that six of the seven new cases fail on the previous head's code; that was not re-run here.

Writes on an installed app. Unchanged from round one: writeTarget and overrideDraftBody are not in the delta apart from the model handed to them. The extra save before publish keeps the draft's own keys, the overrides declaration included, and goes to the package the draft is in.

② Semver level

Unchanged 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; @object-ui/app-shell: patch, @object-ui/i18n: patch and @objectstack/spec: patch still fit, and Clause-②: yes (widening) and Metadata-protocol: none still hold.

③ Boundary flags

  • Both flags of round one are now written in the PR body (above). They remain questions for the card, not defects of this diff.
  • Behaviour for an existing user: none beyond round one. The designer is new in this PR.
  • SQL push-down: no record query in the delta. A save makes one or two layered reads more than before, and a publish one layered read and one draft read more.
  • Author: objectstack-fleet[bot]. The PR is a draft; mergeable state clean.
  • The delta touches no .claude/** path and the PR declares no Rule-change: line.
  • Check-runs at the head: 62 success, 12 skipped, none failed, none pending (N12).

④ Design judgment

publicFormDesign.ts: the write-back now has one rule for "edited", which is "differs from what the designer read from the same base", and one rule for a section's key. Both are stated in the docblocks and both are what the tests assert. The rule fails only where the model cannot tell two stored states apart (N9: a map and an empty text both read as empty), which is a limit of showing a locale map as an empty box, not of the write.

PublicFormsDesigner.tsx: the name check uses the list the effect already reads, as round one suggested. The switch is read where it is written, and a read that cannot answer refuses the write. The extra save before publish should take its body from the layered read, as the editor does (N8).

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: claude/project-thread-d8t1hm
Reviewed-by: session_01JQwxbZeHNsF3RWcWpj7rGj

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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufziBCAytAzzCu3iPBFR

Note: StudioDesignSurface.tsx has been split; rebase your edits onto the new files (#36893, PR #36956 merged as 6902acb)

The three pillars have moved out of ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx unchanged. Each now has its own module:

  • DataPillar.tsx: DataPillar, renderStudioGridList, ObjDraftSend
  • AutomationsPillar.tsx: AutomationsPillar, readPublishedFlowNames
  • AccessPillar.tsx: AccessPillar, StudioNameLabel, NewSimilarStrip, readNewSimilarArrival

SDS (now 1,715 lines) re-exports the three pillars and renderStudioGridList, so import paths are unchanged. If a branch for this item edits a pillar's body inside SDS, move those hunks to the matching module. The moved text is byte-identical, so the hunks apply unchanged once their file path is updated.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbWoxCrkYwcqxxENvmn

Closing this draft without merging, at the maintainer's direction. ADR-0159 (#36957) makes forms their own form metadata type, and public forms are form items. The work this PR started continues in card #37087 (blocked by #37086):

Two small fixes exist only on this branch and are not on main yet; #37087 should carry them:

  • Setup → Public forms: a row whose state cannot be read (Unknown) offers no on/off switch (PublicFormsSetupPage.tsx, the switch's disabled condition, with its render test).
  • packages/spec/src/ui/anonymous-form-intake.ts: the anonymousFormIntakeWithdrawnIn docblock names its real callers (prose only).

The branch claude/project-thread-d8t1hm is kept, at head 1f9f234303, for reuse.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:ui size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant