Skip to content

Add PlayNodeViewer: a play's rules as a read-only workflow, with its on/off switch and Edit #3518

Closed

Description

@malibio

Overview

A play opens in the generic node viewer, which shows its title and none of its rules. ADR-090 gives play its own viewer: the play's rules as a read-only workflow (trigger → conditions → actions) with their authored descriptions, the play's state, its on/off switch, and an Edit button that opens a chat bound to the play.

Proposed Solution

A registered PlayNodeViewer for play, laid out as ADR-090 §2 specifies:

  • Header: title, description, state, the switch, and Edit.
  • Body: one lane per rule, in order.
  • Data: read reactively from SharedNodeStore, with no local copy and no model calls.

The switch writes enabled through the typed play update, and shows the ADR-060 §8 warning for seeded plays with an invariant rule.

The derived isSeeded field is added to the PlayNode wire type, because the warning needs it. Today _seed is stripped from the wire (nodespace-types/src/convert.rs asserts it).

Edit calls the bound-chat creation from #3520. Until that lands, it is hidden.

Documentation

Architecture Impact

Implements ADR-090 §2. No decision change.

Acceptance Criteria

  • PlayNode carries isSeeded (derived from _seed, read-only, never accepted by PlayNodeUpdate); bun run gen:types output committed; node-types:check passes
  • PlayNodeViewer is registered for play in the plugin registry and opens for any play node
  • Header shows title, description, and state:
    • on: enabled, not suspended;
    • off: enabled = false;
    • suspended: suspendedAt set; shows suspendedMessage and the time
  • The switch writes enabled through the typed play update (updatePlayNode), never lifecycleStatus or generic properties; switching on a suspended play sends enabled: true (the backend clears the suspension)
  • Switching off a play with isSeeded and an invariant rule shows the ADR-060 §8 warning naming the rule's effect, and Cancel writes nothing
  • One lane per rule, in order:
    • the trigger described from on/select/property_key or cron/select;
    • each condition's and each action's description, with the for_each collection named;
    • an invariant marker on invariant rules;
    • raw CEL and params shown on demand
  • Nothing in the body is editable
  • A node:updated for the play (from the CLI, a chat, a sync, or an engine suspension) redraws the view with no reload (test drives an out-of-band update)
  • The viewer keeps no local $state copy of the play and writes no reactive state from $effect (ADR-049)
  • Tests: each state, the switch write payload, the seeded warning and cancel, trigger descriptions for each trigger kind, live redraw
  • bun run quality:fix clean; bun run test:changed passes

Technical Specifications

Reference Files

  • Wire conversion: packages/nodespace-types/src/convert.rs (play_node_to_value; the _seed stripping assertion near the wire-contract tests)
  • Seeded detection: packages/core/src/playbook/seeded.rs (is_seeded_play)
  • Typed update client: packages/desktop-app/src/lib/services/shared-node-store.svelte.ts (TYPED_UPDATERS.play), backend-adapter.ts (updatePlayNode)
  • Viewer patterns: packages/desktop-app/src/lib/components/viewers/query-node-viewer.svelte, task-node-viewer.svelte; registration in packages/desktop-app/src/lib/plugins/core-plugins.ts
  • Generated types: packages/desktop-app/src/lib/types/generated/play-node.ts, rule-definition.ts, trigger.ts, action.ts

Dependencies

Related Issues

Activity

  1. added
    enhancement
    on Oct 3, 2026
  2. malibio commented on Oct 4, 2026

    @malibio
    CollaboratorAuthor

    Baseline — Frontend: 312 test files, 5635 tests passed

  3. self-assigned this
    on Oct 4, 2026
  4. added a commit that references this issue on Oct 4, 2026
    a8738f3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementfrontendui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions