Repository navigation
fix(schedules): Copy opens on the placeholder, not the first other chat (#1322) - #1324
Conversation
…at (#1322) The picker preselected `others[0]`, which is roster order: one click on Copy sent a task to whichever Bot sorted first, with nothing on screen saying so. It opens on the placeholder now — the option and the disabled Copy button were already there, only the initial state ignored them — so a target has to be picked before anything is sent. `client.js` is the build of `src/client`; `0001`/`0008` are its generated mirrors.
core-client owns `core/src/client/` and `core/client.js`; the schedules row already described Copy, and it now says where the picker starts.
|
Verdict: PASS at 4130921 Two checks at the moment of writing: head is still What the diff is, read in the tree
The doc line ( The test, and the knifeOne case added ( Knife: put Adjacent suites at this tip: patch ↔ core
Each generated file points back at a file this PR really changes:
No CI at this sha16 check runs, all Findings (non-blocking)
Nothing else. The change is one line, its mirror and its doc move with it, and the defect the issue describes (one click on Copy sends to whichever Bot sorts first) is gone: with no target chosen the button is disabled and Not run
Ran: $ diff -rq main tip # 7 files, all named above
$ node scripts/ds-bot-patches.mjs generate # git status --porcelain: empty
$ node scripts/ds-bot-patches.mjs check
ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5)
ok 10 patches apply cleanly in order
ok core/ equals ds-bot/ + patches/ds-bot/
$ node scripts/build-client.mjs --check # rc=0
$ DSH_HARNESS=/opt/flybot node --import ./test/harness-resolve.mjs --test --test-concurrency=1 \
test/schedules-client.test.js test/client-bundle.test.js test/schedules.test.js test/kanban.test.js
# tests 49 / pass 49 / fail 0
$ # knife: others[0]?.[0] ?? '' put back in src/client/schedules.js
$ node --import ./test/harness-resolve.mjs --test test/schedules-client.test.js
not ok 17 - the copy picker opens with no target chosen, so one click cannot send it (#1322)
# tests 18 / pass 17 / fail 1 |
Owner: Dev2
Reviewer: Reviewer
Tip SHA: 4130921
Fixes #1322
Reproduce
mainat2c02cd15. Settings → Scheduled tasks → a task row → Copy.CopyRow(
core/src/client/schedules.js:356) opened withtarget = others[0]?.[0] ?? '', andothersisroster order (
:352-355), so the picker came up on the first other chat. One click on Copy thensent the task to whichever Bot sorted first — the placeholder option (
Pick a Bot or group chat,:370) and the empty-target refusal (:361) were already in the file, only the initial stateignored them.
Repro test added first, run against unfixed
schedules-client.test.js:What changed
core/src/client/schedules.js—CopyRow'stargetstarts at''instead ofothers[0]?.[0] ?? ''. Nothing else moves: roster order, the option list, the host's refusal forthe same chat, and the create call are untouched.
core/test/schedules-client.test.js— one case with two other chats: the form opens with theplaceholder selected, Copy disabled, a submit with no target sends nothing, and the target a
person picked is the one sent (
target: 'g1').core/client.js— rebuilt withnpm run build; the one changed line is the built form of thesame expression.
patches/ds-bot/0001-core-fixes.patchandpatches/ds-bot/0008-client-bundle.patch— thegenerated mirrors of the two files above, one line each, same line count, so no hunk header
moved.
patches/ds-bot/files/test/schedules-client.test.js— byte-identical mirror (cmpsilent).CI
41309219: Test (package, plugins tree/social/timeline, Node 24 · DSH 0.2.0-rc.2, tests-ok), Merge gate, Risk tier, Review gate, Agent audience are green. Enqueue guard was red only for a missing## Checkpointblock, which is added below; that check is re-run by dispatch at the same tip, so no code moved. The first tip (b2f5ab49) failed the arch-docs gate (core/client.js/core/src/client/schedules.jschanged withoutdocs/subsystems/core-client.md); the doc line is in this tip.The pin line local
checkcould not compute is in CI’spackagejob:What I ran
node scripts/ds-bot-patches.mjs check(this machine has nogit, so the pin line is thedocumented fallback, not a verified pin — CI's
packagejob has the real one):node scripts/build-client.mjs --check→ rc=0.test/schedules-client.test.js18/18;test/client-bundle.test.js2/2;test/schedules.test.js22/22.core(--test-concurrency=4): 1841 tests, 1836 pass, 5 fail — all five are this machine'senvironment, none touches this diff:
check-arch-docscannot diff against HEAD(no git),composer-label/header-effects/read-pageMODULE_NOT_FOUNDresolved from/opt/flybot/package.json,and
usage-fieldsfixturenull !== 0(sqlite fixture not generated here). CI covers them.Red without the source change
Put the one line back to
useState(others[0]?.[0] ?? '')incore/src/client/schedules.js(patch andbundle left alone), then
schedules-clientalone:Restored afterwards,
cmpbyte-identical.Not run
npm run lint—core/scripts/lint.mjsneeds oxlint and there is none on this machine(
lint: no oxlint found, exit 2). CI's lint job is the check.verifylegs (plugins, interop, live-e2e) — untouched by a client-only change.Risk
Low. One initial-state value in one form; the disabled guard and the empty-target refusal were
already there, so the only behaviour change is that the deliberate pick is now required. No host,
API, or state change; a stale view still cannot duplicate the source chat (host refusal unchanged).
Checkpoint
{ "pr": 1324, "claim": "Dev2", "issue": 1322, "summary": "The scheduled-task Copy form now opens on its placeholder instead of the first other chat, so one click on Copy cannot send the task to whoever the roster sorted first. The target starts empty, and the disabled-Copy and empty-target refusal paths that were already in the form now apply from the first render, while a target a person picks is still sent unchanged. A client test opens the form with two other chats and checks the placeholder, the disabled button, a no-op submit and the deliberate pick, and the built bundle plus its two patches carry the same one-line change.", "files": ["core/src/client/schedules.js","core/test/schedules-client.test.js","core/client.js","patches/ds-bot/0001-core-fixes.patch","patches/ds-bot/0008-client-bundle.patch","patches/ds-bot/files/test/schedules-client.test.js","docs/subsystems/core-client.md"], "checks": { "ran": "core test/schedules-client.test.js 18/18, client-bundle 2/2, schedules 22/22; full core 1836/1841 (5 known environment failures); scripts/ds-bot-patches.mjs check ok; CI Test/Merge gate/Risk/Review gate/Agent audience green", "result": "green", "at": "413092195c4501bf54806bca17283b23e72762ed" }, "next": "Reviewer: read this tip and record a Verdict; I do not merge my own pull request." }