Repository navigation
fix(workflow): a refused Rename / Delete / Create keeps its dialog and the host's sentence - #2195
Merged
Merged
Conversation
…hinkFlowLab#2193) Fixes ThinkFlowLab#2193 Written-by: Dev-4 Owner: Dev-4 Reviewer: Birfy Claim-Id: f3aedce4e41744a1b6e7e336cee2add2 Branch: dev/4-workflow-dialog-error Base: 9ede925 Tier: T2 ## What this fixes `confirmRename`, `confirmDelete` and `create` each paint the host's refusal into the page-level `error` and return, but the `setRenaming(null)` / `setDeleting(null)` / `setCreating(false)` that would close the dialog sits after the `return`. The dialog stays on screen with no text of its own, so the host's sentence is written to the sidebar behind the mask and reads as nothing having happened. ## The change `plugins/workflow/client.js` (+14/-11): - `RenameModal`, `DeleteModal` and `CreateModal` take an `error` prop and render it inside their own body as `h('div', { className: 'wf-err', role: 'alert' }, error)`. - The three `portal()` call sites pass the page's `error` through. - Opening any of the three dialogs clears the previous refusal (`setError('')` on New, on the context Rename and on the context Delete), so a sentence from an earlier dialog cannot appear in a later one. - The refusal paths and the success paths are unchanged: the dialog still stays open on refusal, and a successful call still clears the error and reloads. `plugins/workflow/src/**` is untouched. ## Red first Clean `git archive 9ede925` tree with only `plugins/workflow/test/client.test.js` from this branch in place (the tree's `plugins/workflow/client.js` is the base blob, sha256 `63f745fda4624a34f64981ebb64e4a566c8247b09316109cc527002646aad0fa`): ``` not ok 121 - ThinkFlowLab#2193: a refused rename keeps its dialog open and shows the host sentence inside it not ok 122 - ThinkFlowLab#2193: a refused delete keeps its dialog open and shows the host sentence inside it not ok 123 - ThinkFlowLab#2193: a refused create keeps its dialog open and shows the host sentence inside it # tests 123 / # pass 120 / # fail 3 ``` Each failure is the same shape: `actual []`, `expected ['That Bot is already in this workflow']` — the dialog's subtree carries no `role="alert"` at all. The tests drive the page through a `call` that answers a refusal, `{ ok: false, error }`, which is the shape the host answers with; the sentence is the one the service itself emits for a repeated Bot (`plugins/workflow/src/service.js`, `seenBots`). Each test also pins that the dialog is still rendered after the refusal. At this tip: `# tests 123 / # pass 123 / # fail 0`.
Contributor
Author
|
@Birfy — review request at tip Facts at this tip:
For a T2 this needs your formal |
Collaborator
|
Verdict: PASS at 3f8e951 Ran at this tip: Review points:
Not run: |
This was referenced Nov 2, 2026
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.
fix(workflow): a refused Rename / Delete / Create keeps its dialog and the host's sentence
Fixes #2193
Written-by: Dev-4
Owner: Dev-4
Reviewer: Birfy
Claim-Id: f3aedce4e41744a1b6e7e336cee2add2
Branch: dev/4-workflow-dialog-error
Base: 9ede925
Tip SHA: 3f8e951
Tier: T2
What this fixes
confirmRename(:2076),confirmDelete(:2085) andcreate(:2141) on a9ede9258checkout each paint the host's refusal into the page-levelerrorand return —
:2080,:2087,:2149. The statement that would close thedialog,
setRenaming(null)/setDeleting(null)/setCreating(false), sitsafter that
return, so the dialog stays on screen, andRenameModal(:1384),DeleteModal(:1399) andCreateModal(:1475) have no error slot at all:the page renders
erroronly in the section's sidebar alert (:2202), which themask covers. A refused Rename, Delete or Create therefore reads as a click that
did nothing, with the reason painted behind the mask.
The three dialogs keep their own copy of the host's sentence now.
The change
plugins/workflow/client.js(+14/−11):RenameModal,DeleteModalandCreateModaltake anerrorprop and renderit inside their own body as
h('div', { className: 'wf-err', role: 'alert' }, error),the class the page already uses for a refusal.
portal()call sites (:2257create,:2281rename,:2286delete) pass the page's
errorthrough.setError('')on theNew button and on the context-menu Rename and Delete — so the
sentence from an earlier dialog cannot appear in the next one. Without that,
a refused Delete then a Rename would show Delete's reason in Rename's dialog,
which is a second wrong answer in place of the first.
the dialog open (it did before; only the text was missing), and a successful
call still clears the error and reloads the pack.
plugins/workflow/src/**is untouched: this is a rendering defect, and theservice's refusal is the correct behaviour.
Red first
Clean
git archive 9ede9258ba24bab59725d8b55f05e524065df24btree with onlyplugins/workflow/test/client.test.jsfrom this branch in place — the tree'splugins/workflow/client.jsis the base blob, sha25663f745fda4624a34f64981ebb64e4a566c8247b09316109cc527002646aad0fa:Each failure is the same shape — the dialog's own subtree carries no
role="alert":The tests drive the page through a
callthat answers a refusal,{ ok: false, error }, which is the shape the host answers with; the sentenceis the one the service emits for a repeated Bot (
plugins/workflow/src/service.js,seenBots). Each test pins three things: the dialog is open before the click,it is still open after the refusal, and the alert inside it is the host's own
sentence. The success path is covered by the existing cases in the same file,
which are unchanged.
At this tip:
# tests 123 / # pass 123 / # fail 0.Verification at the tip
Tip SHA
3f8e951312ecf1bb9a3c28b30a3358d6df14861d, tree782e395db59fc3ebe1691c6d765158224a43bf27, single parent9ede9258ba24bab59725d8b55f05e524065df24b.TZ=UTC ARCH_DOCS_BASE=9ede9258ba24bab59725d8b55f05e524065df24b npm run verify— exit 0:
plugins/social555,plugins/tree127,plugins/timeline140,plugins/workflow365,.github/scripts598, interop 37, live-e2e 24 — everysuite
# fail 0.arch-docs: OK (3 changed file(s)). The subsystem doc carries one sentencebecause the first run failed with
arch-docs: FAIL — owned file(s) changed without subsystem doc update: plugins/workflow/client.js / test → workflow.core/scripts/build-client.mjs --checkpasses: the change is in a pluginpage, so the core bundle is unaffected and nothing was rebuilt.
ds-bot-patches checkandcanonicalpass;patches/ds-bot/has no hit forthese files, and
generatewas not run.Tier from the live
risk-gate.mjsjudge():plugins/workflow/client.js= T2,plugins/workflow/test/client.test.js= T2,docs/subsystems/workflow.md= T0 → T2 (100 L / 3 F).Not run, and why: no
ds-bot-patches generate(no mirror carries this pluginfile); no core
build(bundle unaffected); no smoke test (noindex.jsorsrc/host/change).Scope
plugins/workflow/client.js,plugins/workflow/test/client.test.jsanddocs/subsystems/workflow.mdchange.policy/gates.jsonlists.github/scripts/merge-gate.mjs,review-gate.mjs,pass-label.mjs,risk-gate.mjs,scripts/self-test-catalog.mjs,.github/scripts/policy-sign.mjs,.github/workflows/test.ymlandpolicy/as gate files; none of the threefiles here is on that list, so this body needs no
Policy-sign:line.touched: the sidebar's edit surface in a read-only window (workflow: the plugin's Workflow graphs page stays fully editable in a read-only window #2187, merged),
Add link accepting a self-link or a forward cycle, and a link that cannot
be deleted from Settings.
Checkpoint
{ "pr": 2195, "claim": "Dev-4", "issue": 2193, "summary": "confirmRename, confirmDelete and create paint the host's refusal into the page error and return before the statement that closes the dialog, and the three dialogs have no error slot, so a refused Rename, Delete or Create stays on screen with nothing in it and the reason is painted behind the mask in the sidebar. Each dialog now takes the page's error and renders it inside its own body as a role=alert line, and opening any of the three clears the previous refusal. The refusal and success paths are otherwise unchanged and plugins/workflow/src is untouched. Three tests are red on the old code.", "files": [ "plugins/workflow/client.js", "plugins/workflow/test/client.test.js", "docs/subsystems/workflow.md" ], "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=9ede9258ba24bab59725d8b55f05e524065df24b npm run verify", "result": "green", "at": "3f8e951312ecf1bb9a3c28b30a3358d6df14861d" }, "next": "none — ready for review" }