Repository navigation
Add PlayNodeViewer: a play's rules as a read-only workflow, with its on/off switch - #3537
Conversation
Pragmatic Code Review — PR #3537Review Type: Initial review (no prior reviews on this PR) Code Review SummaryThe change is a clear net improvement and follows ADR-090 §2 closely. The viewer is a pure projection of the store's node (one What I ran: Requirements Check (issue #3518)
Code Review FindingsCritical IssuesNone. ImportantNone. Areas examined and found sound
Suggested Improvements
Nitpicks
RecommendationAPPROVE — all functional acceptance criteria are met, the store change is safe against the existing sequence guard and remote-update policy, and the remaining items are optional polish. |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Review addressedAll four suggestions are implemented; none skipped.
Nits left as they are: the invariant marker's tooltip repeats what the rule description already says, and a play that loses its invariant rule while the warning is open still turns off, which is what the user asked for. Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: The review was an APPROVE with suggestions only. The changes are markup moves, an attribute, an each-block key and two tests, with no logic change. The touched test files and |
…3518) PlayNode carries a derived, read-only isSeeded. The viewer reads the play from SharedNodeStore, shows its state and one lane per rule, writes enabled through the typed play update and warns before a seeded play with an invariant rule is switched off. A typed update's response now applies the type's read-only fields, so switching a suspended play on clears its suspension locally. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…guards Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…y lanes by position - The seeded-play warning's rules and consequence are inside the dialog description, so they are announced. - The switch's accessible name no longer flips with its state. - Rule lanes are keyed by position, so a play stored with a repeated rule name still renders. - The store's read-only-field apply is tested for a query as well as a play. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
61c72f6 to
197157a
Compare
Closes #3518. Implements ADR-090 §2.
What changed
A play now opens in
PlayNodeViewerinstead of the generic viewer.description, state (On, Off, or Suspended withsuspendedMessageand the time) and the on/off switch.on/select/property_key, orcron/select); each condition and action shows its authored description, with thefor_eachcollection named; invariant rules carry a marker. Raw CEL, params and the trigger JSON sit behind a closed disclosure.enabledthrough the typed play update (sharedNodeStore.updatePlayNode). Switching on a suspended play sendsenabled: true, which is what clears the suspension.isSeededand an invariant rule first opens a dialog that lists each invariant rule's description. Cancel writes nothing.$derivedfromSharedNodeStore. The only local$stateis whether the warning is open, and there is no$effect.Edit is not rendered. It needs the bound-chat creation from #3520, which adds the button with it.
Node type change
playis a structured core type (category: automation). One wire-only field is added; the schema, registry, stored shape and typed update are unchanged.PlayNode.isSeeded: derived, read-only, true when the stored properties carry_seed. The marker itself still never reaches the wire.PlayNodeUpdaterejectsisSeeded(deny_unknown_fields, now asserted).PlayFields::seeded_in, which core'sis_seeded_playnow calls.storageNodeToApiFields) derives the same field, so browser mode and Tauri hand the frontend the same shape.bun run gen:typesoutput is committed. Theplaysheet innode-types.mdalready documentsisSeededand the viewer, so there is no docs change.Two supporting changes
suspendedAtand the view stayed "Suspended". Read-only fields are the backend's alone, so the response is always current for them. Today onlyplayhas read-only typed fields.Switchwrapper bindscheckedthrough to the primitive, as theCheckboxwrapper already does. Without it a parent could not keep the switch on when the user cancels the warning. The viewer is the first use ofSwitch.Tests
play-node-viewer.test.ts: each state, the switch's write payload (off, and on from suspended), the seeded warning and Cancel, lanes in order, step descriptions, raw content closed by default, nothing editable, and a redraw driven by an out-of-band store update.play-node-model.test.ts: state precedence, a description for every trigger kind and selector kind, the warned rules.update-typed-node.test.ts: a response clears a play's suspension locally.node-normalize.test.ts,convert.rs,play.rs:isSeededon both transports, and its rejection on update.bun run test:changedpasses (frontend, browser, scripts,types:check,node-types:check, Rust).🤖 Generated with Claude Code