Repository navigation
feat(setup): Setup → Configuration → Public forms lists and switches every public form - #36697
Conversation
…every public form Clause-②: no Metadata-protocol: none A system administrator's page for the operations half of public forms: every public form of the environment with its object and address, a switch to turn it on or off, copy its address, open it in a new tab. An installed app's form is switched as this environment's customization (an override in the app's .custom package, ADR-0146), never in the app. Claude-Session: https://claude.ai/code/session_01JQwxbWoxCrkYwcqxxENvmn Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 11 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 7 release-owned page(s) also name something this change touched. These are read-only:
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): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 17e1d7cc75c28cc41621f270c5afa3b77a76058e && git checkout 17e1d7cc75c28cc41621f270c5afa3b77a76058e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 53257a55db953086db16e756f70b649b41debd4a 2a859fb0a4c5fb680932c8a16e8d7f47d3e23b07 && git checkout -B drift-repro 53257a55db953086db16e756f70b649b41debd4a && git merge --no-ff 2a859fb0a4c5fb680932c8a16e8d7f47d3e23b07
node scripts/docs-audit/affected-docs.mjs --json 53257a55db953086db16e756f70b649b41debd4a
|
…om the spec's, and classify its object-list read The Type Check UI job's spec-symbol guard refuses a local `Doc` because `@objectstack/spec/system` exports one; the page module's type is now `FormDoc`. The census of `useMetadata().objects` readers lists the new Setup page as `off` (not mounted on an app's object-list open). Claude-Session: https://claude.ai/code/session_01JQwxbWoxCrkYwcqxxENvmn Co-authored-by: Claude <noreply@anthropic.com>
… forms page The zh-Hant locale is generated from zh; the publicFormsSetup block added to zh had not been carried over, so zh-hant-generated.test.ts flagged the file as stale. Claude-Session: https://claude.ai/code/session_01JQwxbWoxCrkYwcqxxENvmn Co-authored-by: Claude <noreply@anthropic.com>
…e keys as a widening The page adds a Setup navigation id, a component id and new language-pack keys, which this lane counts as Clause-② yes (widening). 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: Face: declaration only. The PR body and the changeset both carry ① Derived judgmentsThe new public surface is the Setup nav entry The ruled points:
Findings:
② Semver level
③ Boundary flagsThe dev report has Tests: the stubs are realistic. The served item shape carries
There is no case for a base shipped off (M1) or an upgraded base (S1). Check-runs on Implemented-by: VERDICT: FAIL |
…r switched on; say when a form stays on an earlier app version An installed app's form shipped with its switch off is withdrawn by the app's own document, which the anonymous routes never let an override re-open. The page now lists it as switched off by its app, with its switch disabled even when an override already switches it on, and a switch-on writes nothing and says why. Switching back on an override taken from an earlier app version still restores the app's own form when nothing else differs; otherwise the override is kept, switched on, and the page says the form stays on that earlier version. The switches need manage_metadata, the capability the server checks on every write they make: without it they are disabled with a sentence saying why, and a refused switch is told in business words, not the server's message. 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: This is the round 2 delta review for round 1 (7110340811, FAIL at ① Derived judgmentsClosed items:
Findings:
② Semver levelUnchanged: ③ Boundary flagsThere are no new open questions in the delta. SQL push-down: still no record queries. The new reads are per-form metadata layer reads (N5), not a data join. Check-runs on S2 is open on this head and earns a delta review of its fix. It does not block the verdict. Implemented-by: VERDICT: PASS |
…wn withdrawal rule The page judged only an app's own switch, so an app that ships a form with allowAnonymous false and an override that opens it read On while the routes kept it closed. anonymousFormIntakeWithdrawnIn is a pure judgement of the bodies it is handed, so it moves into @objectstack/spec/ui beside the rest of the intake rule; metadata-core re-exports the same binding (pinned by its identity test) and the page calls it. A form whose app's document cannot be read is shown as status unknown, never as on, and a failed list read is told in business words. 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: This is round 3. Round 2 (7112039531) was PASS at I read the one commit ① Derived judgments
Answers on the spec-face scope:
The rest of the delta, read in full:
New findings, all nits:
No must-fix, no should-fix. ② Semver level
③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj 维护者速读设置 › 配置 新增「对外表单」页:列出本环境所有对外表单,可以一键开关、复制地址、在新标签打开。关掉后表单地址立即打不开,表单仍留在列表里可以随时重开。已安装应用的表单,开关存为本环境的定制,不改应用本身。应用本身就关着的表单会标「已被应用关闭」,开关不可用。没有编辑元数据权限的管理员只能看,不能开关。表单设计(第二部分)在 Studio 里做,下一个 PR。 席位核对 — ACCEPT (L1) · repo:objectstack#1 · head
|
Requested by Warren · project thread
Part of #36444. This PR is the card's Settings = operations half (ruling items 6–10 of #36444 (comment)). The Studio = design half (items 1–5: the designer under the object, create/delete, fields, sections, address, live preview) stays open on the card for a second PR on this branch.
Clause-②: yes (widening) — a new
@objectstack/spec/uiexportanonymousFormIntakeWithdrawnIn(moved verbatim from@objectstack/metadata-core, which re-exports it), a new Setup navigation idnav_public_forms, a new component idforms:public-forms, and new language-pack keys (thepublicFormsSetupblock and the nav label) in every shipped localeMetadata-protocol: none
维护者速读
What changes
forms:public-forms(Setup → Configuration → Public Forms,nav_public_forms,requiredPermissions: ['manage_platform_settings']; the page asks the same capability). One row per public form: name, the object a submission creates a record of, its address, an on/off switch, copy address, open in a new tab. No field editing, create or delete here (ruling item 7).ui/packages/app-shell/src/views/setup/publicForms.ts): read from the effective view list (GET /meta/view), judged by the server's own ruleanonymousFormIntakeCandidates(@objectstack/spec/ui), never a second reading ofsharing:allowAnonymous: true+ apublicLink), so a switched-off form stays listed (item 8);sharing.enabled, saved and published at once..custompackage (ADR-0146 D2/D3), via the same seams the in-page dashboard editor uses (resolveDashboardEditTarget,ensureDashboardSaveTarget,overrideDraftBody,saveAndPublishInPackage). The app's own package is never written, so upgrades still flow in.basedOn), which Studio's "Restore package original" undoes. The app's earlier document cannot be read, so a switch-only override at an old version cannot be told from a design one (review S1).enabled: falseorallowAnonymous: false, orenabledomitted, which the stack schema parses asfalse) is withdrawn by the app's own document, and the routes never let an override re-open it (pinned inpackages/rest/src/public-form-withdrawal-effective-read.test.ts). The page judges the app's document with the routes' own function,anonymousFormIntakeWithdrawnIn, against the served form switched on (slot or slug match), plus an omittedenabled(review M1, S2). The page reads each installed app's form's layers (markShippedOff, one package-list read per page load) and lists such a form as "Off (switched off by its app)" with its switch disabled, even when an override already switches it on; a switch-on writes nothing and refuses with that sentence. A form whose app's document cannot be read shows "Unknown", never On (N5).anonymousFormIntakeWithdrawnInmoves into@objectstack/spec/ui(anonymous-form-intake.ts, beside the candidates half), verbatim: it is a pure judgement of the bodies it is handed.@objectstack/metadata-corere-exports the same binding, so the routes' import is unchanged, and its identity test now pins this name with the others (one copy, not a twin). Specapi-surfaceandexport-originsregenerated (1 added).manage_platform_settings(its Setup entry's); the switches also askmanage_metadata, the capability the server checks on every write they make. Without it the forms are listed, the switches are disabled, and a sentence says why. A refused switch is told in business words (403 → no permission; anything else → the server refused, try again), and so is a failed list read; the server's own message goes to the console log only (review N1, N3, N6).404 FORM_NOT_FOUND. The routes already honour an override that withdraws a base's form (anonymousFormIntakeWithdrawnIn), so no route, spec key, error code or stored-key change was needed: Metadata-protocol staysnone. The new spec export (the moved withdrawal judgement), the new navigation id, component id and language keys are the widening the Clause-② line declares.publicFormsSetupblock in all 11 console locales; nav label in all 11 platform-object locales (zh-CN 「对外表单」).Tests
ui/packages/app-shell/src/views/setup/publicForms.test.ts(26 cases): the listing rule (on, off-but-listed, internal forms, non-form views, naming); writable-package save; installed app off → override in.customwith itsoverridesdeclaration and nothing in the app; reading the base when the listed pair does not hold the form; on with a switch-only override → restore (reset at the pair, no save); on with a design override → kept, switch on,basedOnunchanged; pending draft → nothing written (both the client-side check and the server's409 METADATA_CONFLICT); refusals (package not listed, unreadable form, no version to declare); a base shipped off, bothenabled: falseand absentenabled, refused with nothing written, with and without an override already on, and listed as not on (markShippedOff); an app that shipsallowAnonymous: falseunder an override that opens it, refused and listed as not on; an unreadable app document →unknown, not on; an override switch-only atbasedOn: 2.0.0against a changed 3.0.0 base →{ kind: 'earlier-version', basedOn: '2.0.0' }, kept; the same against an unchanged base → restored. Ablations: dropping the refusal, the listing mark, the earlier-version answer, the routes' withdrawal rule, or the unknown mark, or reading an absent switch as on, each turns cases red.PublicFormsSetupPage.test.tsx(8 cases, rendered): the Setup capability gate; withoutmanage_metadatathe switches are disabled with the sentence; a shipped-off form shows "switched off by its app" with a disabled switch (both spellings); the pending-draft toast leaves the row as it was; a 403 and a 500 are told by key, with no server text; a failed list read shows the business sentence without the server text; an unreadable app document shows "Unknown", not On. Ablations of the metadata gate, the shipped-off mark and the business-word refusal each turn a case red.PublicFormsSetupPage.navContribution.test.tsx(3 cases): the ref is registered by the production registration, addressescomponent/forms/public-forms, and mounts through the component route.packages/metadata-core/src/anonymous-form-intake.test.ts: the identity case now includesanonymousFormIntakeWithdrawnIn(metadata-core's export is the spec binding); the package's 1,057 tests pass, and so doespackages/rest/src/public-form-withdrawal-effective-read.test.ts.packages/cli/test/connect-agent-both-halves-wire.pin.test.ts: Setup nav count 34 → 35, plusnav_public_formsis served to amanage_platform_settingsholder. Red without the fix: against a platform-objects build without the nav entry it failsexpected [...] to have a length of 35 but got 34.ui/packages/i18n/src/__tests__/zh-hant-generated.test.ts: passes withsrc/locales/zh-Hant.tsregenerated from zh (pnpm --filter @object-ui/i18n gen:zh-hant).ui/packages/app-shell/src/console/__tests__/openPathObjectReaders-12811.test.ts: the new page'suseMetadata().objectsread is classifiedoff(Setup, not an app object-list open).Acceptance notes
Live run on
examples/app-crm(objectstack dev --seed-admin --fresh) + console dev server, as the seeded admin.com.example.crmlists as not writable, so this exercised the installed-app (customization) path:…/f/contact-us, OnGET /api/v1/forms/contact-us→404 FORM_NOT_FOUND;/f/contact-usshows "Page not found"GET /api/v1/forms/contact-us→ 200; the form renders and takes input againeffective._packageId = com.example.crm, no override left incom.example.crm.custom(restored to the app original)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:01-public-forms-on.png: the page with the Setup sidebar entry, form On.02-public-forms-off.png: after switching off (toast, Off).03-anon-form-off.png: the anonymous address while off.04-public-forms-back-on.png,05-anon-form-on.png: switched back on, the form takes input again.The Studio designer screenshot comes with the second PR.
Premise finding for the Studio half: the existing Developer → Public Forms entry (
nav_public_formsinstudio.app.ts,developer:public-forms) is served only where a host loads@objectstack/studio; no example and no CLI default loads it, so the console's own Studio has no public-forms entry today. The second PR places the designer under the object in the console's Studio, within the seven-tab Data pillar (objectui#12450).Overlap: merges cleanly with
main, #36629 and #36525. #34223 (draft since 11-19) also bumps the same Setup nav count line in the CLI pin test; whichever lands second takes the other's count.Verification
Head
2a859fb0a4(review round 2: S2, N5, N6; round 1 atd91c73bcad;mainmerged in earlier as33a41ea1b0, no rebase).dispatch-gates --commands, now 94 commands with the spec and metadata-core paths): 94/94 exit 0 on2a859fb0a4.2a859fb0a4: all workflows completed (Spec Liveness Check included), 59 checks success, 10 skipped (opt-in, queue and schedule gates), 0 failure.@object-ui/app-shelltype-check (src + tests): exit 0. eslint on the changed files: 0 errors.gen:zh-hant).a502b8c57had two reds, fixed ind3b3b09d3(check:spec-symbolsrefused a local typeDoc, renamedFormDoc; theopenPathObjectReaders-12811census, classified).d3b3b09d3had one red, Test UI (10/16), the stale zh-Hant locale, fixed in5c7d009426.8902d697eeandd91c73bcadwere all green.peopleAssignments.navContribution.test.tsx("Position holders" heading) fails onmainas well; CI runs it green. Not touched here.Generated by Claude Code