Repository navigation
feat(webapp): make a trigger a real node in the editor - #530
Merged
Merged
Conversation
Congrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
|
LeadcodeDev
added this pull request to stack #531
September 17, 2026 08:03
The canvas invented its trigger. `buildInitialNodes` created one node at a hard-coded `__trigger__` id from two workflow-level props, and `buildInitialEdges` invented an edge to every root. Nothing about it came from the graph, so a workflow could hold exactly one trigger and it could never be moved, deleted, or told apart from another. Triggers are now drawn from `graph.triggers`: one node each, at its own graph-local id, positioned from the layout, draggable, deletable, with the same card, selection ring, error badge and `+` handle a connector node has. `buildLayout` records their position, which it used to discard. Nothing is invented any more, so `TRIGGER_NODE_ID` and the three helpers that built the fiction are gone. Configuration moved from the workflow to the node. The panel edits one trigger and reports through `onChange`; it has no save button of its own, because a trigger is saved with the graph exactly like a connector's config. The pane context menu offers "Ajouter un déclencheur" in place of "Configurer le déclencheur", and `useWorkflowTrigger`/`useSetWorkflowTrigger` are deleted along with the route constant they called. `projectGraphErrors` routed errors by `connector_id` alone, so the five `GraphError` variants that name a trigger instead — `InertTrigger`, `EmptyEventTrigger`, `UnknownEventName`, `EdgeIntoTrigger`, `BranchedTriggerEdge` — landed in the graph-level banner rather than on the node at fault. The backend has emitted `trigger_id` since WS1; the editor now reads it. Two consequences worth naming. `run-now-feature` read the subscribed event names from the deleted `/trigger` route and now derives them from the graph's triggers. And the workflow list loses its "Déclenchement" column: it said "Manuel" or "Sur événement", which cannot describe a workflow holding several triggers of different kinds, and the list response carries no graph to summarise. Restoring a summary needs a new API field and is a change of its own. Closes #525 Refs #521
…dding it Two things made the trigger node look real without behaving like one. Dragging a connection from a trigger to a connector dropped the line on release. `isBranchDeclared` refused every connection whose source was a trigger — correct while the canvas invented those edges and the user could never draw them, wrong the moment a trigger became a node you add unwired. It now refuses only a *branched* edge leaving a trigger, which is the rule the domain actually states (`BranchedTriggerEdge`); a plain one is what wires the graph. Connector-to-connector was never affected, which the new test pins alongside. A trigger's kind was picked after the fact, in its configuration panel. That treated "manual or events" as a setting, when it is what the node is — a connector chooses its kind at creation and never changes it, and a trigger is no different. The context menu now offers "Manuel" and "Sur événement(s)" as two ways to add one, and the panel drops its mode tabs: it configures the events of an events trigger, and a manual trigger has nothing to configure, so adding one opens no panel at all. The three panel tests covering mode switching are deleted rather than rewritten — their subject no longer exists.
LeadcodeDev
force-pushed
the
feature/automation-triggers-ws4
branch
from
September 17, 2026 08:03
e46a293 to
8cc4eee
Compare
Contributor
|
🚀 Preview deployed: https://pr-530.mestier.fr Synced revision |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WS4 of #521. Stacked on #529 (WS2) — review that one first; this PR's diff will shrink to its own commit once WS2 merges.
What changed
The canvas invented its trigger.
buildInitialNodescreated one node at a hard-coded__trigger__id from two workflow-level props, andbuildInitialEdgesinvented an edge to every root. Nothing about it came from the graph, so a workflow could hold exactly one trigger, and it could never be moved, deleted, or told apart from another.Triggers are now drawn from
graph.triggers— one node each, at its own graph-local id, positioned from the layout, draggable and deletable, with the same card, selection ring, error badge and+handle a connector node has.buildLayoutrecords their position, which it used to discard. Nothing is invented any more, soTRIGGER_NODE_IDand the three helpers that built the fiction are gone.Configuration moved from the workflow to the node. The panel edits one trigger and reports through
onChange; it has no save button of its own, because a trigger is saved with the graph exactly like a connector's config. The context menu offers "Ajouter un déclencheur" in place of "Configurer le déclencheur" — the part of the original context-menu request (#520) that was never delivered.A gap this closed on the way
projectGraphErrorsrouted errors byconnector_idalone. The fiveGraphErrorvariants that name a trigger —InertTrigger,EmptyEventTrigger,UnknownEventName,EdgeIntoTrigger,BranchedTriggerEdge— therefore landed in the graph-level banner instead of on the node at fault, which is precisely what #525 asks for. The backend has emittedtrigger_idsince WS1; the editor now reads it.This was found because a test was written against the real pipeline and left failing rather than weakened to pass.
Two consequences worth naming
run-now-featureread the subscribed event names from the/triggerroute that WS2 deletes. It now derives them from the graph's triggers.The workflow list loses its "Déclenchement" column. It said "Manuel" or "Sur événement" — a label that cannot describe a workflow holding several triggers of different kinds — and the list response carries no graph to summarise. Restoring a summary needs a new API field, so it is a change of its own rather than a passenger on this one. The two tests asserting that column were deleted rather than contorted, since their intent is superseded.
Acceptance (#525)
Verification
pnpm checkpnpm vitest runpnpm exec tsc --noEmitmain's baselinepnpm buildCloses #525
Follow-up from running it (second commit)
Two things made the node look real without behaving like one, both found by using the editor rather than by a test.
A trigger could not be wired by hand — the line vanished on release.
isBranchDeclaredrefused every connection whose source was a trigger. That was correct while the canvas invented those edges and no user could draw them; it is wrong the moment a trigger is a node you add unwired. It now refuses only a branched edge leaving a trigger, which is the rule the domain actually states (BranchedTriggerEdge). Connector-to-connector was never affected — pinned by a new test alongside, so the distinction is recorded rather than assumed.A trigger's kind is now chosen when adding it, not afterwards in its panel. Treating "manual or events" as a setting was the wrong model: it is what the node is. A connector picks its kind at creation and never changes it; a trigger is no different. The context menu offers "Manuel" and "Sur événement(s)" as two ways to add one, and the panel drops its mode tabs — it configures the events of an events trigger, and a manual trigger has nothing to configure, so adding one opens no panel at all.
The three panel tests covering mode switching were deleted rather than rewritten: their subject no longer exists.
Re-verified after both:
pnpm checkclean, 1819 frontend tests pass,tscatmain's 28-error baseline, build clean. Four unrelated failures in the full sweep (hr, planning, quotes) were load-induced timeouts on a loaded machine — all pass when re-run alone.