Skip to content

feat(workflows): make trigger and step setup explicit - #6470

Draft
tellaho wants to merge 12 commits into
mainfrom
tho/workflow-step-inputs-trigger-filters
Draft

feat(workflows): make trigger and step setup explicit#6470
tellaho wants to merge 12 commits into
mainfrom
tho/workflow-step-inputs-trigger-filters

Conversation

@tellaho

@tellaho tellaho commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Category: new-feature
User Impact: Workflow authors can build filtered, runtime-aware automations, understand them at a glance, and get a clear warning before turning on workflows likely to run often.
Problem: Workflow setup exposed raw configuration without enough help composing message templates, filtering triggers, or understanding saved behavior; activation could also make a broadly triggered workflow live without explaining its likely frequency.
Solution: Batch 3 adds local, deterministic template variables, trigger filters, and semantic summaries, then refines cards and activation around configured behavior and a risk-aware warning boundary. Scheduling remains the already-shipped implementation, advanced expressions remain lossless, and network-backed identity/message enrichment stays in Batch 4.

Message inputs Trigger filters
Caret-aware, keyboard-accessible suggestions expose trigger-local values and safe prior-step outputs in send_message.text. Structured conditions and validated manual IDs block invalid submission while preserving advanced expressions.
Message variable autocomplete Structured trigger filters
Workflow cards Risk-aware activation
Semantic labels, channel-first hierarchy, configured reaction/action visuals, real step stacks, and compact status controls make behavior scannable. Broad message and frequent schedule triggers explain the risk before Turn on; narrowly scoped triggers proceed without unnecessary ceremony.
Semantic workflow card Activation confirmation

Changes

File changes

desktop/src/features/workflows/ui/WorkflowActionsMenu.tsx
Separates direct card status controls from secondary actions while retaining modal status actions.

desktop/src/features/workflows/ui/WorkflowCard.tsx
Adds semantic behavior, channel-first hierarchy, configured reaction/action visuals, real subsequent-step stacks, status controls, and reduced-motion-aware trigger feedback.

desktop/src/features/workflows/ui/WorkflowDialog.tsx
Warns before activating broadly triggered workflows while allowing narrowly scoped workflows to proceed directly.

desktop/src/features/workflows/ui/WorkflowFormBuilder.tsx
Connects structured trigger filters and template-aware step inputs while preserving schedules, trigger transitions, and selected YAML authority.

desktop/src/features/workflows/ui/WorkflowStepCard.tsx
Replaces generic labels with deterministic configured-step descriptions.

desktop/src/features/workflows/ui/WorkflowTemplateTextarea.tsx
Adds caret-aware variable suggestions with keyboard navigation and focus restoration.

desktop/src/features/workflows/ui/WorkflowTriggerConditions.tsx
Adds structured local filters, validated author/message IDs, and a lossless advanced-expression fallback.

desktop/src/features/workflows/ui/workflowActivationWarning.ts and workflowActivationWarning.test.mjs
Classify broad message and frequent schedule triggers for contextual activation warnings.

desktop/src/features/workflows/ui/workflowConditionExpression.ts and workflowConditionExpression.test.mjs
Model and cover parsing, serialization, validation, and advanced-expression preservation.

desktop/src/features/workflows/ui/workflowDefinition.ts and workflowDefinition.test.mjs
Preserve trigger/step configuration and derive deterministic card metadata across YAML round trips.

desktop/src/features/workflows/ui/workflowStepDescription.ts and workflowStepDescription.test.mjs
Generate and cover local step summaries.

desktop/src/features/workflows/ui/workflowTemplateVariables.ts and workflowTemplateVariables.test.mjs
Define and cover trigger-specific, order-bounded variables and caret insertion.

desktop/src/features/workflows/ui/workflowTriggerDescription.ts and workflowTriggerDescription.test.mjs
Generate and cover semantic trigger summaries without network lookups.

desktop/tests/e2e/workflow-local-controls.spec.ts and snapshot
Cover filters, IDs, advanced expressions, autocomplete, activation choices, summaries, and YAML authority.

desktop/tests/e2e/workflow-reaction-picker.spec.ts
Covers configured reaction emoji in workflow nodes and summaries.

desktop/tests/e2e/workflows.spec.ts
Covers risk-aware activation warnings, direct safe creation, duplication, and card status controls.

Reproduction steps

  1. Create a message-posted workflow in Workflows, add a Send message step, and type {{trig; verify keyboard-selectable variables insert at the caret.
  2. Configure message-text and manual ID filters; verify malformed IDs block submission and advanced expressions survive Form/YAML transitions.
  3. Create a broad message workflow; verify Back persists nothing, Keep off saves it disabled, and Turn on enables it. Confirm a narrowly triggered webhook skips the warning.
  4. Inspect the saved card; verify its channel, semantic behavior, configured actions/reaction, real step stack, and status are understandable without opening YAML.

Validation

Validated at exact clean head cc26a53c466aa1621a842766153fc6ae94aa27aa on base 24ec6a468ec9d0d425ee58fbfc4d416412c446ad.

  • Focused changed regressions, repository pre-push gates, and E2E build/typecheck passed; the updated risk-aware activation screenshot passed against the real built UI.
  • A broader 36-test smoke invocation had 31 passes and five unrelated pre-existing expectation/snapshot failures, so it is not claimed as fully green. Adversarial fixes are recorded in round one and round two.

tellaho and others added 9 commits August 20, 2026 23:47
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho

tellaho commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

AI-assisted fix under Taylor Ho’s accountability.

Addressed both adversarial-review blockers at 53e314146:

  • Duplicate creation now follows the same explicit activation confirmation as new creation. The duplicate-mode enabled switch is removed; Back performs no create mutation, and either enabled or disabled creation requires an explicit choice.
  • Visible invalid manual author/message IDs now propagate form invalidity to the dialog. The create action is disabled for both fresh invalid IDs and invalid drafts replacing a previously valid ID, preventing stale or broader YAML from being persisted.

Validation at exact head 53e3141467caf2ea49baf0273ae3a55b281cc4e0 with a clean worktree:

  • focused duplicate safety smoke: 1 passed
  • focused manual-ID round-trip/submission safety smoke: 1 passed
  • desktop unit suite: 5,273 passed
  • pre-push desktop-check, desktop-typecheck, and desktop-test: passed
  • E2E build/typecheck and Biome checks: passed

A broader 36-test local smoke invocation had 31 passes and 5 pre-existing expectation/snapshot failures unrelated to these two paths; both changed regression tests passed in that invocation and again in isolated runs.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@buzz.block.builderlab.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho

tellaho commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

AI-assisted follow-up under Taylor Ho’s accountability.

Resolved the stale editor-validity finding at ded18fbde: YAML mode now owns submission validity and entering it clears stale Basic-condition drafts. A valid raw-YAML correction can therefore be created/saved immediately, and returning to Form reparses the corrected YAML instead of resurrecting the invalid hidden draft.

Regression coverage exercises invalid Form ID → YAML correction → enabled submit → Form reparse with the stale value absent.

Validation at exact clean head ded18fbdea9ebebe1b80d585e42a764870530681:

  • focused mode-switch/manual-ID smoke: 1 passed
  • E2E build/typecheck: passed
  • focused Biome check: passed
  • pre-push desktop-check, desktop-typecheck, and desktop-test: passed.

Rizz added 2 commits August 21, 2026 09:37
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Signed-off-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@buzz.block.builderlab.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant