Repository navigation
fix(app-shell): Studio's action editor keeps a new field-value row, and stores a script action's type - #26877
Conversation
… and stores a script action's type Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVG55iUTTWRd5tR6Di
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVG55iUTTWRd5tR6Di
…s and script type Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVG55iUTTWRd5tR6Di
…eton that holds none Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVG55iUTTWRd5tR6Di
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVG55iUTTWRd5tR6Di
|
Seat note · Test UI (9/16) on Generated by Claude Code |
席位核对ACCEPT · seat
Landing: no contract review is owed (no published schema, no governed text, |
Requested by Steedos · project thread
Fixes #26735
Fixes #26734
Clause-②: no
Metadata-protocol: none
维护者速读
patch;「运行脚本」动作现在在作者切换到运行脚本、编辑脚本体或语言、填字段值时写入type: 'script',「类型」下拉只显示动作真正存有的类型,没有时显示「—」。patch永远是{};「运行脚本」动作存下来没有type,下拉却显示 Script,控制台读到无类型的动作什么都不执行。两种动作在 Studio 里做出来发布后都点了没反应。type的动作写法与以前完全一样。回滚即 revert 本 PR。ActionDefaultInspector.tsx里的withScriptType与commitFieldValueRows;ActionDefaultInspector.scriptBodyLanguage-11921.test.tsx里改成带type的两条期望。status、值done,预期草稿的patch为{ status: 'done' }且带type: 'script'。What changes
ActionDefaultInspector(Studio › Data › an object › Actions), two writes:patchcannot be authored in Studio (the published action is a no-op) #26735). "Add field value" committed['', ''], and the patch writer drops every blank key, so no row appeared and an update action'spatchstayed{}. The rows on screen are now a list held in the inspector: a row is written topatchonce it names a field, and a row that names none (just added, or its field cleared) is held there and never written. The held list is stamped with the action, like the Body Shape Wrap choice, and is read only while its named rows equal the draft'spatch; any other write topatchshows the draft's rows. Rows stay keyed by position, so a held row that gains its field keeps its inputs and the focus.type, so the console treats it as not executable — clicking it sends no request #26734). The Type control showedstr('type') || 'script', so a draft with notyperead Script while nothing committed it. A "Run a script" action made from New (whose skeleton leavestypeto the spec) was stored without one, and the console runs nothing for an action withouttype. The Type control now shows only a storedtype("—" when there is none), andwithScriptTypeaddstype: 'script'to every write that authors a script on a draft that holds notype: the "What it does" switch in both directions (the update direction already wrote it), each body edit, a language change and a field-value write. The Behavior panels still follow the spec's default route (ActionSchema.typedefaults toscript), so the editor for what the action runs stays on screen. A draft that already holds atypeis written exactly as before.No
packages/specchange, no server change, no new string, no runtime fallback for an action withouttype.Tests
ActionDefaultInspector.fieldValueRows-26735.test.tsx(new, 5 cases): from the New skeleton, Add shows a row and writes nothing; Fieldstatuswritespatch: { status: '' }with the same input element; Valuedonewrites{ status: 'done' }and the draft parses withActionSchema. A cleared field keeps the row on screen and takes it out ofpatch; removing a held row writes nothing; another write topatchshows the draft's rows; a typed action is written withpatchalone.ActionDefaultInspector.scriptType-26734.test.tsx(new, 6 cases): New → "Run a script" → a body storestype: 'script'and parses; a stored script with notypeshows none in Type and its first body edit stores it; the first field value from New stores it; the spec gives a draft with notypethescriptroute; controls: a typed script action's body and language writes carry notype, and an api action shows API.ActionDefaultInspector.scriptBodyLanguage-11921.test.tsx: the two pins of the "Run a script" switch from the typeless New skeleton now expecttype: 'script'in the write. They pinned exactly the write Studio Data › Actions: a "Run a script" action is saved withouttype, so the console treats it as not executable — clicking it sends no request #26734 reports.origin/mainblob (commitFieldValueRowscount 1 → 0 on disk) and the two new files ran red, Tests 8 failed, 3 passed (11): every case except the two typed-action controls and the spec reading. Restored withgit checkout HEAD,git diff HEADempty.Acceptance notes
ObjectActionsPanel, outside this card's file surface) leavestypeoff on purpose, and its pinnewActionPinasserts that. Until the author's first edit, the pinned Type control on that skeleton reads "—" beside the "Pinned to script" hint. The first field value or "What it does" switch storestype. Seedingtype: 'script'in the skeleton would close that window; it is a change toObjectActionsPaneland its pin, so it is left as an open question in the report.type. The spec declarestypewith ascriptdefault, and the console reads the stored row, not its parse, so it treats any stored action withouttypeas not executable. This PR stops Studio from writing new ones; it does not change the runtime, by the card's order.Verification
All readings at head
a9ea1105(basee9e344a9), underscripts/pm/os-verify-lock.sh.Touched package: @object-ui/app-shell
pnpm exec turbo run build --filter='@object-ui/app-shell^...'plus formula, sdui-parser, lint and client, 63 tasks successful, VERDICT command-exit 0.pnpm exec turbo run type-check --filter=@object-ui/app-shell --concurrency=2, 64 tasks successful (app-shell's own task a cache miss, executed:tsc --noEmitandtsc -p tsconfig.test.json), VERDICT command-exit 0.ActionDefaultInspectororObjectActionsPanel(26 files). First run: Tests 2 failed, 224 passed (226), the twoscriptBodyLanguage-11921pins of the typeless switch's write, updated above. That file re-run: Tests 13 passed (13). The rest of app-shell is left to CI's Test UI shards.ui/eslint.config.json the four touched files: exit 0, no output.Derived gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 34 commands for the 5 changed paths; all 34 exit 0, each code captured before any pipe, among themcheck:nul-bytes,check:test-source-alias,check:cross-package-test-inputs,check:type-check-coverage,check:type-check-debt,check-sdui-manifest,check-empty-changeset,check-changeset-no-majorandcheck-closing-keyword-parity(with this body as the event).pnpm --dir ui exec vitest run scripts/: Test Files 178 passed, 2 skipped (180), Tests 5065 passed, 2 skipped.--ranreconciled: "34 derived famil(ies) accounted for — 34 run, 0 NOT-MEASURED".pnpm --dir ui run check:new-line-citations: 0 new cross-file line-address citations.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (lint is CI's)main, one pull request. (two cards on one inspector, bundled by the seat's claim)packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jVG55iUTTWRd5tR6Di
Generated by Claude Code