Repository navigation
Commit edefc50
authored
fix(workflow): select the first task card in the assign dialog, and show a failed Tasks load as an error (#1600)
Fixes #1457
Fixes #1458
Owner: Chief
Reviewer: Reviewer
Written-by: Chief
Tip: d6eec2d
Base: main @ 571be6d
Replay of #1485: the original head is on a fork we cannot push to
(maintainer_can_modify=false), so this PR carries the same change
replayed onto current main; the original is closed as superseded.
The original declares `Owner: Dev-1`, and that name is not in the
`writers` list of `.github/agent/review-policy.json`, so a pull request
on a branch this repository owns is refused at the queue for it (`Owner
names "dev-1", who is not a writers Bot name`, read from the guard’s own
`guard()`). This replay therefore claims the change as `Chief`, the Bot
that dispatched and tracks it. The work and the credit stay with the Bot
that wrote #1485.
## What was wrong
`AssignModal` read the selected card once, in `useState(tasks[0]?.id ??
'')`, but the dialog opens before the host `tasks` call answers, so
`taskId` froze to `''` and never re-synced: every card rendered
unselected, `confirmAssign` looked the frozen id up, found nothing and
returned, and `Assign` carried no `disabled`, so the click looked
accepted and posted nothing. A genuinely empty board offered the same
live button with the same result, and `root.openWorkflowAssign` did not
even call `loadTasks()`.
Separately, `loadTasks()` turned every failure into `setTasks([])` — the
missing-bridge branch and the `catch` alike — so a failed read rendered
*No open tasks on the Tasks board.*: no error surface, no retry,
`Assign` still clickable.
## What changed
`AssignModal` gets one `useEffect` that selects the first card once rows
arrive (and re-selects when the selected card is gone), and `Assign` is
`disabled: !canAssign`, with `canAssign = tasksStatus === 'ready' &&
tasks.some(task => task.id === taskId)`. `confirmAssign`’s `if (!task)
return` stays as the backstop, and `root.openWorkflowAssign` now calls
`loadTasks()`.
`Section` keeps `tasksStatus` (`idle` / `loading` / `ready` / `failed`)
and `tasksError` beside the rows; both failure paths set `failed` and
keep the host’s message. `failed` renders `.wf-err` plus a `Retry` that
re-runs `loadTasks()`; `loading` renders *Loading the Tasks board…*;
only `ready` with zero rows renders the empty-board hint.
`plugins/workflow/src/service.js` is untouched — it already refused a
task with no id and title.
## Replay notes
Replayed onto `main` `ae7b19f4` from #1485’s `9019337f`. Three of the
four files had also moved on `main` since the original’s base
`c1b9fd23`; both sides are kept in each:
- `plugins/workflow/client.js` — merged three-way, no manual edit; the
payload against `main` is the original’s 64-line diff, equal as a
multiset on both the `+` and the `-` side, and every line `main` added
since the base is still there.
- `plugins/workflow/test/client.test.js` — both sides appended tests
after the same last test; `main`’s block is kept first, then this
change’s 154 added lines, unchanged (it deletes nothing).
- `docs/subsystems/workflow.md` — two rows both sides edited; `main`’s
wording is kept and the two clauses are inserted at the same places.
Stripping them gives a file byte-equal to `main`’s.
- `changelog.d/1457-1458-assign-dialog.fixed.md` — new, no conflict.
## Second replay onto `main` `571be6d4`
`main` then took #1599, which had changed the same three files, so the
branch was merged onto `main` `571be6d4957f7c6427b39e5d16dcd63725aeead0`
in `d6eec2d2`. `plugins/workflow/client.js` and
`docs/subsystems/workflow.md` merge with both sides kept and no manual
edit; `plugins/workflow/test/client.test.js` had both sides appending
after the same last test, so `main`'s block is kept first and this
change's 154 added lines follow it unchanged. Every line `main` added
since `ae7b19f4` is still in all three files.
## Verification at the tip
The tip `d6eec2d2` is `main` `571be6d4` merged into `c7a25511`; these
four files are the tip's tree over `main`.
- `node --test test/client.test.js` in `plugins/workflow` -> 67/67 pass
(the 63 of the previous tip plus the 4 tests #1599 added on `main`).
- The same run with `main`'s `client.js` written over it -> 63/67; the 4
failures are exactly the #1457/#1458 tests, so they still fail without
the change.
- `node --import ./test/resolve.mjs --test "test/*.test.js"` in
`plugins/workflow` -> 191/191 pass.
Not re-run here: the full `npm run verify` (only `plugins/workflow` and
`docs/` change), `arch-docs` (this copy has no `git`, so it cannot diff
against a base - the owned doc is updated in this diff), the `package`
job, the smoke test (no `index.js` or `core/src/host/` change), Desktop
and the running instance. CI `tests-ok` runs on the new tip.
CI at `d6eec2d2` (UTC 15:47): `tests-ok` green (`plugins (workflow)`,
`plugins (social)`, `plugins (tree)`, `plugins (timeline)`, `package`,
`ubuntu-latest · Node 24` all success), `merge-gate` success, `risk
tier` success. `enqueue-guard` is red only because no PASS names this
tip yet.
## Checkpoint
<!-- flybot:checkpoint -->
{
"pr": 1600,
"claim": "Chief",
"issue": 1457,
"summary": "The \"Hand a task to a Workflow\" dialog now selects the
first card of the Tasks board once it loads, so Assign posts the task
instead of closing on a silent no-op, and an empty board leaves it
disabled. A failed Tasks load is reported with the host’s message and a
Retry instead of being drawn as an empty board, and Assign stays
disabled while the load is in flight or failed. The bridge entry point
openWorkflowAssign now loads the board too, and the service layer is
unchanged because it already refused a task with no id and title.",
"files": [
"plugins/workflow/client.js",
"plugins/workflow/test/client.test.js",
"docs/subsystems/workflow.md",
"changelog.d/1457-1458-assign-dialog.fixed.md"
],
"checks": {
"ran": "plugins/workflow: node --test test/client.test.js (67/67); the
same with main's client.js (63/67, the 4 new #1457/#1458 tests failing);
node --import ./test/resolve.mjs --test test/*.test.js (191/191)",
"result": "green",
"at": "d6eec2d2c1cbd607447e40be10bee6528454ef85"
},
"next": "merged onto main 571be6d as d6eec2d; a fresh PASS is needed
at this tip - the reviewed blobs changed, so the previous PASS does not
carry"
}
<!-- /flybot:checkpoint -->1 parent 571be6d commit edefc50
4 files changed
Lines changed: 206 additions & 17 deletions
File tree
- changelog.d
- docs/subsystems
- plugins/workflow
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
939 | 942 | | |
940 | 943 | | |
941 | 944 | | |
942 | | - | |
| 945 | + | |
943 | 946 | | |
944 | 947 | | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
945 | 956 | | |
946 | 957 | | |
947 | 958 | | |
| |||
957 | 968 | | |
958 | 969 | | |
959 | 970 | | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
968 | 985 | | |
969 | 986 | | |
970 | 987 | | |
| |||
985 | 1002 | | |
986 | 1003 | | |
987 | 1004 | | |
988 | | - | |
| 1005 | + | |
989 | 1006 | | |
990 | 1007 | | |
991 | 1008 | | |
| |||
1379 | 1396 | | |
1380 | 1397 | | |
1381 | 1398 | | |
| 1399 | + | |
| 1400 | + | |
1382 | 1401 | | |
1383 | 1402 | | |
1384 | 1403 | | |
| |||
1429 | 1448 | | |
1430 | 1449 | | |
1431 | 1450 | | |
1432 | | - | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
1433 | 1454 | | |
1434 | 1455 | | |
1435 | 1456 | | |
| |||
1474 | 1495 | | |
1475 | 1496 | | |
1476 | 1497 | | |
| 1498 | + | |
| 1499 | + | |
1477 | 1500 | | |
1478 | | - | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
1479 | 1507 | | |
1480 | 1508 | | |
1481 | 1509 | | |
| |||
1484 | 1512 | | |
1485 | 1513 | | |
1486 | 1514 | | |
| 1515 | + | |
1487 | 1516 | | |
1488 | | - | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
1489 | 1520 | | |
| 1521 | + | |
| 1522 | + | |
1490 | 1523 | | |
1491 | 1524 | | |
1492 | 1525 | | |
| |||
1633 | 1666 | | |
1634 | 1667 | | |
1635 | 1668 | | |
1636 | | - | |
1637 | | - | |
| 1669 | + | |
| 1670 | + | |
1638 | 1671 | | |
1639 | 1672 | | |
1640 | 1673 | | |
| |||
1840 | 1873 | | |
1841 | 1874 | | |
1842 | 1875 | | |
| 1876 | + | |
1843 | 1877 | | |
1844 | 1878 | | |
1845 | 1879 | | |
| |||
0 commit comments