Skip to content

fix(web): workflow editor checks the server's rules and adds no empty Undo steps (#442) - #508

Open
mblaauw wants to merge 1 commit into
mainfrom
fix/442-workflow-editor-rules
Open

mblaauw wants to merge 1 commit into
mainfrom
fix/442-workflow-editor-rules

Conversation

@mblaauw

@mblaauw mblaauw commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Closes #442 (findings 2, 4 and 5; 1 and 3 were fixed in #494).

Summary

Fixes the rest of #442: findings 2, 4 and 5 (1 and 3 were fixed in #494).

  • "Add an input" / "Add an output" use new nextInput / nextOutput helpers,
    which try every other step and return null when each suggested line
    already exists. The button is then disabled with a short reason, and
    change() ignores a change that returns the same workflow, so no no-op
    Undo entry is pushed.
  • The editor gets archived agents too (flagged) plus the agent list state.
    agentLabel names "Archived agent: ", "Loading agents…" or "Agents
    could not be loaded", and only says "Unavailable agent" when the list
    has loaded and the agent is not in it. The pipeline step select uses it
    as well. Archived agents are still not offered for new choices.
  • workflowIssues now checks the rules it was missing against
    orbit-domain's validate: at most 120 lines, an outcome named on a line
    that does not follow one, instructions over 4000 characters, step ids
    (slug, "start" reserved, unique) and line ids (non-empty, unique).
  • crates/orbit-domain/tests/fixtures/workflow-validation.json holds 28
    valid and invalid workflows. validate must accept the valid ones and
    report the named path for the invalid ones; workflowIssues must accept
    the valid ones and report something for each invalid one.

Testing

  • pnpm --filter @orbit/web typecheck and test (97): passed
  • cargo fmt --check, clippy -p orbit-domain --all-targets -D warnings, cargo test -p orbit-domain (84): passed
  • Shared fixture crates/orbit-domain/tests/fixtures/workflow-validation.json (28 cases) asserted by shared_validation_fixture in Rust and by workflow.test.ts
  • pnpm docs:check: passed

Not checked in a browser. Only an orbit-domain test changed on the Rust side, so the workspace-wide run was not repeated locally.

🤖 Generated with Claude Code

… Undo steps (#442)

Fixes the rest of #442: findings 2, 4 and 5 (1 and 3 were fixed in #494).

- "Add an input" / "Add an output" use new nextInput / nextOutput helpers,
  which try every other step and return null when each suggested line
  already exists. The button is then disabled with a short reason, and
  change() ignores a change that returns the same workflow, so no no-op
  Undo entry is pushed.
- The editor gets archived agents too (flagged) plus the agent list state.
  agentLabel names "Archived agent: <name>", "Loading agents…" or "Agents
  could not be loaded", and only says "Unavailable agent" when the list
  has loaded and the agent is not in it. The pipeline step select uses it
  as well. Archived agents are still not offered for new choices.
- workflowIssues now checks the rules it was missing against
  orbit-domain's validate: at most 120 lines, an outcome named on a line
  that does not follow one, instructions over 4000 characters, step ids
  (slug, "start" reserved, unique) and line ids (non-empty, unique).
- crates/orbit-domain/tests/fixtures/workflow-validation.json holds 28
  valid and invalid workflows. validate must accept the valid ones and
  report the named path for the invalid ones; workflowIssues must accept
  the valid ones and report something for each invalid one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant