Repository navigation
fix(studio): the action designer draws refusals and texts from their served rows - #36688
objectstack-fleet[bot] merged 5 commits into
Conversation
…served rows The full-page editor, the Studio Actions view and the bundle item editor hand ActionDefaultInspector the served form; the inspector draws the refusals and texts rows from it (key-only record control, help text) instead of the raw JSON editor. zh-CN overlay gains the action refusals and texts leaves and the hook texts leaves. Claude-Session: https://claude.ai/code/session_011y7As6kDA9BVrMsBR9rmrJ Co-authored-by: Claude <noreply@anthropic.com>
…s per host Claude-Session: https://claude.ai/code/session_011y7As6kDA9BVrMsBR9rmrJ Co-authored-by: Claude <noreply@anthropic.com>
…able panel Claude-Session: https://claude.ai/code/session_011y7As6kDA9BVrMsBR9rmrJ Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As6kDA9BVrMsBR9rmrJ Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · os-alice · session_011y7As6kDA9BVrMsBR9rmrJ Final green head for L1 review: Out-of-scope finding from the dev report (class a, not fixed here): the Studio object Hooks view ( |
|
repo:objectstack#7 · os-alice · session_011y7As88pUDUZHGdwFmizG4 维护者速读
席位核对Verdict: ACCEPT at head
|
|
repo:objectstack#7 · os-alice · session_011y7As88pUDUZHGdwFmizG4 席位核对 — delta readDelta read at head |
|
repo:objectstack#7 · os-alice · session_011y7As6kDA9BVrMsBR9rmrJ Landing at head
L1: ACCEPT 7103758326, delta read 7104419401 at this head. State change: |
…ld's options (objectstack-ai#36772) Fixes objectstack-ai#36216 Clause-②: no Metadata-protocol: none ## 维护者速读 - 在工作室里给视图变体、页面(基础筛选与标签页预设)和页面里的关联列表写筛选条件时,选择"下拉选项"类字段后,值现在是一个列出该字段选项的下拉框,不再是随手输入的文本框;文本字段不变。 - 属于"工作室筛选编辑器字段信息不全"这组修复,补上上一次只修了"多选"标记、没带上选项列表的那几处筛选编辑器。 - 影响在工作室或应用内视图设置里写筛选的管理员;只改界面给出的输入控件,已存的筛选原样不动,可以直接撤回。 - 要你做的一件事:无。 ## What changes A `select` field's declared `options` (the spec's `SelectOption`, `{ value, label }`) reach the shared runtime `FilterBuilder` on every host that builds the `filter-builder` field list, so a picklist row's value is a picker over the field's choices and stores the option's `value`. Before, three builders (and the catalog one of them is fed by) dropped `options`, the builder fell back to a free-text box, and a typed label saved a filter that matches no record. `FilterBuilderField` already forwarded `options` (the list-view inspector's picklist fix); the field lists handed to it did not carry them. Measured at `e343ab7c`, where each list is built: | Host | Field list built by | Change | |---|---|---| | generic metadata editor (a page's `interfaceConfig.filterBy`, tab presets, any `widget: filter-builder` row) | `objectCatalogOf` in `ResourceEditPage.tsx`, from the raw served object | reads `declaredFieldOptions(f)` | | view-variant inspector | `ViewVariantInspector.tsx` widget context, from `useObjectFields` | forwards `f.options` | | in-app view configuration panel (feeds the view-variant inspector an override catalog) | `mapObjectFields` in `ViewConfigPanel.tsx`, from the raw `objectDef` | reads `declaredFieldOptions(f)` | | page block inspector (`record:related_list` filter) | `FilterRulesField` in `PageBlockInspector.tsx`, from `useObjectFields` | forwards `f.options` | `useObjectFields` already normalised a field's options in `declaredFieldOptions` (only string `value` + string `label` entries; absent when none). That function is now exported and is the one reading the two raw-definition builders use, so every host offers the same choices. No consumer-side tolerance is added: entries that are not the spec shape are dropped exactly as the hook already dropped them. `mapObjectFields` (`ViewConfigPanel.tsx`) is outside the card's named three: it is the override catalog the view-variant inspector reads in the in-app panel, so without it that host kept the text box after the inspector's own fix. Fixed here under the bounded in-place exemption (same defect, same mechanical projection, no other claim on the file, same gate family); see Acceptance notes. Read first, by risk: 1. `ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx`: `objectCatalogOf`, the `fieldOf` projection now a block body. Check both the record and array branches still read `name` as before. The edit stays inside `objectCatalogOf` (the sibling objectstack-ai#36688 line is elsewhere). 2. `ui/packages/app-shell/src/views/metadata-admin/previews/useObjectFields.ts`: `declaredFieldOptions` exported, body unchanged. 3. `ui/packages/app-shell/src/views/ViewConfigPanel.tsx`: `mapObjectFields` gains `options`. Two-minute check: `pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/widgets.filterBuilderOptions-36216.test.tsx`. Expect 9 passed. ## Tests New file named for the card, `widgets.filterBuilderOptions-36216.test.tsx` (`FilterBuilderField` has no shared harness file; its other pins are card-named files). One served `ticket` object with a `select` column (`status`, two options) and a `text` CONTROL (`subject`): - catalogs: `objectCatalogOf` (record and array forms) and `mapObjectFields` carry the declared choices on `status`, and nothing extra on `subject`; - the `filter-builder` widget over `objectCatalogOf`'s catalog: Add filter, pick Status, the value is a picker (no `Value` box) listing New Request / Completed, and picking New Request writes `{ field: 'status', operator: 'equals', value: 'new' }`; CONTROL: Subject gets one `Value` box and no picker; - the view-variant inspector, fed by `mapObjectFields` and by its own `useObjectFields` read: Status is a picker over the choices; CONTROL: Subject is a `Value` box; - the page block's related-list filter: Status is a picker over the choices; CONTROL: Subject is a `Value` box. <details><summary>Ablation (one mutation per site, on the committed fix c8a45c6)</summary> Each site's `options` spread was deleted with `scripts/ablation-replace.mjs --delete` (anchor 1 to 0, blob moved), the new file ran under the verify lock, and the tool restored it (blob equals HEAD, `git diff HEAD` empty). The tested modules are imported by relative path from `src`, so no `dist` build sits between the mutation and the run. - `objectCatalogOf`: Tests 2 failed / 7 passed (its catalog pin, the widget picklist case); - `mapObjectFields`: 2 failed / 7 passed (its catalog pin, the view-variant case over the panel catalog); - `ViewVariantInspector`: 2 failed / 7 passed (both view-variant picklist cases); - `PageBlockInspector`: 1 failed / 8 passed (its picklist case). Every text CONTROL stayed green under every mutation, as predicted. </details> <details><summary>Affected suites</summary> At `c8a45c6e5`, `pnpm --dir ui exec vitest run --maxWorkers=2` over the existing suites of every edited component (`metadata-admin/widgets*`, `ResourceEditPage*`, `ViewConfigPanel*`, `PageBlockInspector*`, `ViewVariantInspector*`, `previews/useObjectFields*`, `studio-design/ObjectListViewInspector*`): Test Files 105 passed (105), Tests 552 passed (552). The new file: 9 passed (9). `pnpm --filter @object-ui/app-shell run type-check` (the `src` program and `tsconfig.test.json`), after the `@object-ui/app-shell^...` closure build: exit 0. The full `@object-ui/app-shell` suite is CI's (`Test UI`). </details> ## Acceptance notes - **Reach measured in components, not in a running app:** the pins mount the real `FilterBuilder` (only the Radix popover is rendered inline) over each real host; no backend or Console was booted. - **Bounded in-place fix:** `ui/packages/app-shell/src/views/ViewConfigPanel.tsx` is outside the claim's declared file surface (`ui/packages/app-shell/src/views/metadata-admin/**`). It is the same defect on the catalog the view-variant inspector reads in the in-app panel; the four exemption conditions hold (same defect class; a mechanical one-line projection shaped like the sibling `multiple` line; overlap-check names no other PR on the file; same gate family). Declared here and in the report for the seat to add to the claim's surface. - `ObjectFieldOption.options` already existed (the list-view inspector's picklist fix); no type was widened. The `field-ref` / `field-multi` pickers read name, label and type only, so they are unchanged. - `origin/main` was not merged: overlap-check against `0d727b70` (after objectstack-ai#36688 landed) reports a clean merge. ## Verification <details><summary>Local gates (all at c8a45c6)</summary> All 39 families from `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` exited 0, each exit code captured before any pipe. `--ran` reconciliation: 39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN (a derived zero: all 39 recorded an exit code). `ui/scripts/check-new-cross-file-line-citations.mjs`: 0 new citations, exit 0. `node scripts/pm/overlap-check.mjs`: VERDICT clean exit 0 (origin/main `0d727b70`, 0 PR heads sharing a file). No exported symbol was renamed or removed, so `check-platform-checklist.mjs` is not owed. Every CI family is read from this PR's check-runs, not re-run here. </details> Seat: repo:objectstack#7 · os-alice · session_011y7As6kDA9BVrMsBR9rmrJ --- _Generated by [Claude Code](https://claude.ai/code/session_011y7As6kDA9BVrMsBR9rmrJ)_ --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
Fixes #35650
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
ActionDefaultInspector(the action designer, mounted by the full-page editor and by the Studio object's Actions view) reads a new optionalserverFormprop onMetadataDefaultInspectorPropsand draws therefusalsandtextsrows from their served rows: a one-sectionSchemaFormover the served schema, with the row descriptors taken from the servedactionform (servedFormRows), placed in the Behavior section beside the script body. The rows bring the key-only record control, their entry rows and help text, and their ownvisibleWhen(script actions only). Both keys are then hidden from "More fields"; with no served form (or a form without the row) they stay in "More fields" exactly as before.ResourceEditPage(designer branch,entry?.form) andStudioDesignSurface(atypeFormsindex besidetypeSchemas, handed toObjectActionsPanelasactionForm, then to the inspector asserverForm).useIssuePrefixRegisterunion instead of one form writing the host's callback directly.metadata-form-zh-cn.ts):actiongainsrefusals,refusals.message,refusals.status,refusals.reasons,refusals.reasons.message,refusals.params,texts,texts.message,texts.params;hookgainstexts,texts.message,texts.params. Labels copied from the platform bundlezh-CN.metadata-forms.generated.ts(labels only, as the overlay's header prescribes for these types).packages/specis untouched; the rows onactionFormare read as served.Landing point:
ui/packages/app-shell/src/views/metadata-admin/**and the Studio mount inui/packages/app-shell/src/views/studio-design/**.ResourceEditPage.tsxgains one prop line.Read first (by risk):
inspectors/ActionDefaultInspector.tsx— theservedRowsFormblock and the hidden-fields change on the fallback form; the twouseWholeDraftFormIssueRowssetters.inspectors/servedFormRows.ts— the row lookup (string rows,{ group }sections skipped).studio-design/StudioDesignSurface.tsx—typeFormsand theactionFormhand-off.Tests
ResourceEditPage.actionServedRows-35650.test.tsx(full-page editor, real page with production registrations, type row built fromactionForm+ActionSchemathe way the server builds it): no textarea holds either record as JSON; the served help text of both rows is drawn; the key-only control drawsSIGN_IN_REQUIREDandemail_subjectunder their keys; an entry edited through the served row saves, and the saved action passesActionSchema.safeParse.DataPillar.actionServedRows-35650.test.tsx(Studio design surface: the real Data pillar, Actions tab, with theactiontype row served throughuseMetadataTypes): the same face assertions.Ablation (one, on the inspector)
Fix committed first;
ActionDefaultInspector.tsxrestored toorigin/main(9348f02) in the tree only, both pin files run, thengit checkout HEAD -- PATH, proven by blob hash (16b68477 before and after) and an emptygit diff HEAD.expected [ textarea …, …(1) ] to deeply equal []— the two raw JSON editors holdingrefusalsandtexts, which is the card's premise measured on both hosts. The round-trip test: noaction-served-rowsmount.Create page (premise falsified)
The card lists the create page among the hosts. Measured on this branch with a throwaway render (not committed): the action create page renders the flat
createSchemaform, whose rows areLabel*,Name*,Object,Icon; it mounts no inspector, draws norefusals/textsrow in any face, and holds no textarea. A new action is named there and authored afterwards in the full-page editor, which this PR fixes. No pin is possible that fails on main, so none is added.Acceptance notes
ObjectHooksPanelmountingHookDefaultInspector) draws the hook'srefusalsandtextsas raw JSON too: measured on this branch with a throwaway render of the real panel, two textareas holding{ "CONTRACT_LOCKED": … }and{ "follow_up_subject": … }. The card's "hooks are not affected" holds for the hook's full-page editor only. Same defect class; this PR'sserverFormprop andservedFormRowsmake it a two-file follow-up (the hook inspector readsserverForm, the panel is handedhookForm). Reported to the seat, not fixed here.StudioBundleItemEditoralso mounts registered default inspectors, but no action reaches it (AREA_FORM_EDITOR_TYPESisemail_template,translation;datasetfor customize), so it is left unchanged.Verification
Two-minute check (from the repository root, after building the closure):
pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/ResourceEditPage.actionServedRows-35650.test.tsx packages/app-shell/src/views/studio-design/DataPillar.actionServedRows-35650.test.tsx— expectTests 3 passed (3).Local readings at dd2958b
pnpm turbo run build --filter='@object-ui/app-shell^...' --concurrency=2: lock VERDICT command-exit 0, 68/68 tasks.ActionDefaultInspector.*tests,ActionDesigner.paramVocabulary,ResourceEditPage.defaultInspectorIssues-35628, theObjectActionsPanel.*tests, theDataPillar.action*tests): Test Files 20 passed, Tests 135 passed.pnpm --filter @object-ui/app-shell type-check(bothtsc --noEmitandtsconfig.test.json, whose include reaches the new test files): VERDICT command-exit 0.ResourceEditPage.tsx/StudioDesignSurface.tsx, none on changed lines).node scripts/pm/dispatch-gates.mjs --commandsderived 39 families; 37 exit 0 in the first pass on this head, and the other two exit 0 on re-run:check:type-check-debt(first exit 3 inside its own closure-build lock wait, then exit 0) and the ui scripts suite below.pnpm --dir ui exec vitest run scripts/: the first run was killed by the box's memory limit (SIGKILL, no verdict); re-run with--maxWorkers=2: Test Files 172 passed, 2 skipped; Tests 5127 passed, 2 skipped (lock VERDICT command-exit 0).--ranreconciliation: 39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN.node scripts/pm/overlap-check.mjs: merges cleanly with origin/main, 0 open PR heads share a file.pnpm test(2444 test files) and every other CI family: declared to CI (Test UI, Type Check UI, Lint UI).Generated by Claude Code