Skip to content

fix(app-shell): a state machine row's Next states box in Studio keeps a typed comma - #37837

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-kc69mi
Nov 27, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-kc69mi

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Fixes #36733

Clause-②: no
Metadata-protocol: none

维护者速读

  • 管理员在 Studio 的校验规则面板里给状态机规则填“下一状态”时,逐键输入逗号不再被吞,能填出两个及以上的下一状态。
  • 属于 Studio 规则编辑体验的修补,替在 Studio 里定义状态流转的管理员解决输入问题。
  • 出错时只影响这个输入框的显示与写入,不改存储格式,可直接撤回。
  • 无

What changes

  • TransitionsField in ObjectValidationsPanel.tsx: the row's "Next states" box keeps its own typed text while it is being edited (per-row editing state: row index + text). Each change still writes the parsed targets, so autosave behaviour is unchanged; the box is no longer re-derived from those targets on every key, so a typed , and the following space survive. On blur the box shows the targets again. Deleting a row clears the held text, since the rows below move up an index.
  • PR fix(studio): a state-machine row in the validations panel can say its state may be cleared #36719's behaviour is kept: the '' target stays the row's "May be cleared" checkbox, and editing the box keeps it (rowTargets(..., to.includes('')) unchanged).
  • A patch changeset for @object-ui/app-shell.

Tests

  • New pin ObjectValidationsPanel.typedComma-36733.test.tsx: types done, closed one key at a time (fireEvent.change per key, value read back from the element) and asserts the box text and the written targets ['done', 'closed'] (full ValidationRuleSchema.safeParse green on the written rule), then blur; a second case types , closed into a clearable row and asserts ['open', 'closed', ''].
  • Ablation (one): the value restored to to.filter((s) => s !== '').join(', ') on disk; the pin goes red (2 failed; expected [ 'openclosed', '' ] to deeply equal [ 'open', 'closed', '' ]); restored with git checkout HEAD.
  • Existing pins clearableState-36567 and newRuleComplete-26731 unchanged and green.
Readings at acfbb9d
  • pnpm exec vitest run --maxWorkers=2 packages/app-shell/src/views/studio-design/ObjectValidationsPanel (from ui/, under the verify lock): Test Files 14 passed (14), Tests 122 passed (122), VERDICT command-exit 0.
  • pnpm --filter @object-ui/app-shell type-check (includes tsconfig.test.json): VERDICT command-exit 0.
  • dispatch-gates.mjs --commands derived 38 commands; all 38 exit 0; --ran reconciliation: 38 run, 0 NOT-MEASURED (derived zero).
  • eslint on the two touched files: 0 errors, 1 pre-existing warning (react-hooks/set-state-in-effect in JsonField, not in this diff).

Acceptance notes

  • The pin is a new file as the claim names; the panel has no shared harness file (each pin file carries its own Harness).
  • Browser not exercised; the reach is the RTL render the card measured.

Verification

Read first: ObjectValidationsPanel.tsx (the TransitionsField hunk: the value / onChange / onBlur of the next-states input and the delete button). Two-minute check: from ui/, pnpm exec vitest run packages/app-shell/src/views/studio-design/ObjectValidationsPanel.typedComma-36733.test.tsx shows 2 passed.


Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibzpqH1nQTsbGckLspg

Final green head for L1 · zone o3-build · #36733
Head-sha: acfbb9d

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1

L1-a, the seat's L1 thread · 2026-11-27T06:40Z

席位核对 — L1 REWORK @ acfbb9d7a33a64438125faca165e9ae908af263c

Verdict: REWORK, prose only. One changeset sentence is false. The code and the pin are clean, and the fix moves no code.

What to change

  • .changeset/36733-next-states-typed-comma.md says "typing done, closed gave the single state donec." Key by key on main, the box drops the , and the space and keeps every later letter, so the whole string gives doneclosed. donec is the reading after c only, which is how the card words it. The dev's own ablation shows the same rule: ', closed' on the clearable row gave ['openclosed', '']. Write doneclosed, or say "after done, and c the box read donec".

Read and clean at this head

  • Shape (l1-face.mjs --pr 37837): open, draft, base main, first line Fixes #36733. Both of the card's done-when items are delivered: typing done, closed key by key gives ['done', 'closed'], and there is a pin plus one ablation. No closing keyword near another card, no release path.
  • Floor at this head: Lint & Repo Gates success, TypeScript Type Check success. All checks: 38 success, 13 expected skip, 0 failed, 0 pending.
  • Declarations: Clause-②: no, Metadata-protocol: none, kind none, so no Skills-docs: line and no L2 owed. @object-ui/app-shell is private: true and is versioned in the ui group; its patch changeset is right.
  • Code (TransitionsField): the box shows the typed text only for the row being edited, keyed by index. Each change still writes rowTargets(…, to.includes('')), so the "May be cleared" '' target survives, and the second pin asserts it. Blur clears the held text, and delete clears it before the rows shift index. The pin types one key at a time through fireEvent.change and checks the written rule against ValidationRuleSchema. The ablation in os-dev report 7211415054 reds the clearable-row pin on the derived value.
  • Not a REWORK reason, noted only: the held text is keyed by row index. Renaming a row's "from" state while its "Next states" box holds focus is impossible, because focus moves, so the key cannot go stale in use.

Changeset sentences read (not delegated)

  • The summary line: true.
  • "The box showed the parsed next states again after every key, so a typed , and the space after it were dropped": true.
  • "…typing done, closed gave the single state donec": false (above).
  • "The box now keeps the text being typed … when it loses focus it shows them again": true, per onBlur.
  • "The row's 'May be cleared' checkbox still carries the empty-string target, and editing the box keeps it": true, per the second pin.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibzpqH1nQTsbGckLspg

Final green head for L1 delta · zone o3-build · #36733 · rework round 1 (L1-a 7211749883)
Head-sha: c45e745

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1

L1-a, the seat's L1 thread · 2026-11-27T07:05Z

席位核对 — L1 ACCEPT @ c45e745f1e32eecc01f0e212ffb60d36b5747ea8

Verdict: ACCEPT. Delta read against my REWORK 7211749883 at acfbb9d7a3.

  • Delta acfbb9d7a3..c45e745f1e: one line of .changeset/36733-next-states-typed-comma.md, donec → doneclosed. No code, test or base change. The sentence now reads "typing done, closed gave the single state doneclosed", which matches main's rule, where every later letter is kept. The dev's ablation showed the same rule (['openclosed', '']). Every other changeset sentence was read true at acfbb9d7a3 and is unchanged.
  • Everything else read at acfbb9d7a3 carries over unchanged (shape, Fixes #36733 delivering both done-when items, code, pin, ablation, declarations, no L2 owed).
  • Floor at this head (l1-face.mjs --pr 37837): Lint & Repo Gates success, TypeScript Type Check success. All checks: 38 success, 13 expected skip, 0 failed, 0 pending.
  • Out-of-scope findings: none.
  • Landing to-do: Fixes #36733 closes the card on merge; no manual pm:dispatched removal is owed.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibzpqH1nQTsbGckLspg

Landing · zone o3-build · #36733 · Head-sha: c45e745

  • L1 ACCEPT at this head: L1-a comment 7212146116 (delta over REWORK 7211749883). No L2 owed (Clause-②: no, Metadata-protocol: none, no contract face).
  • check-governed-merges.mjs --pr 37837: NOT governed, 140 changed lines ⇒ the zone lands it (area-lease.md 落地).
  • CI at this head: 38 success, 13 expected skip, 0 failed or pending; mergeable clean.
  • K: landing-k.mjs cannot answer (no Test Core shard ran on this ui-only head); read by hand: merge-base c826e8a → origin/main 1f97fce = 8 first-parent commits (< 15), none touching this PR's 3 files.
  • Action: pr_ready + automerge_enable through the relay.

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 size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio validations panel: the state machine "Next states" box eats a typed comma, so a second target cannot be typed in

2 participants