Skip to content

List a Bot's paused and finished scheduled tasks in its details panel and say when each runs next - #2026

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/3-schedules-drawer-paused-next
Nov 1, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/3-schedules-drawer-paused-next

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Owner: Dev-3
Reviewer: Birfy

Fixes #2024

The defect

ScheduleSummary — the Scheduled tasks block in a Bot's details panel — kept only task.status === 'active' rows. The host puts paused and finished tasks in the same view.tasks array (ownerOf carries botId), so a Bot whose tasks were all paused fell into the empty branch: it read No scheduled tasks yet. Add one and its only button called openSettings('schedules', bot.id), which opens the new-task form — while the settings page listed the same tasks as paused rows. The rows also printed timingText(task), the repeat rule (every day at 09:00), never when the next run is. Three paused tasks and no tasks at all rendered identically.

What changed

  • The status === 'active' filter is gone: paused and finished tasks list. The empty state now appears only when the Bot has no tasks at all; its button keeps openSettings('schedules', bot.id) (the new-task form is what "Add one" means), and a row keeps openSettings('schedules') (the list).
  • Each row's when-span is nextText(task) — Next: <time> for an active task, Paused for a paused one, Finished for a finished one — instead of the repeat rule alone.
  • nextText checks Number.isFinite(Date.parse(...)) before formatting, and timingText's at/after branch (which nextText falls back to) gets the same guard, so a missing or malformed scheduledAt says nothing instead of throwing RangeError: Invalid time value out of the panel.

Scope held to the issue: core/src/client/schedules.js, its view test, the rebuilt bundle, the owned subsystem doc, one changelog fragment. The 3-row cap, host-side task shapes and the settings page are untouched; no i18n string is new (Paused, Finished and Next: {time} already had entries).

Rebased onto the new main

#2023 merged while this was in review (5f1103561dd1279040e473b0c3dea3b536e5baf4), and it touches four of the files here: core/client.js, patches/ds-bot/0001-core-fixes.patch, patches/ds-bot/0008-client-bundle.patch, docs/subsystems/core-client.md. GitHub reported mergeable: clean, but a clean text merge is not a self-consistent generated tree, so the branch is rebased on 5f110356 and every generated artifact was regenerated on that base, not merged:

  • core/client.js — node core/scripts/build-client.mjs
  • patches/ds-bot/0001-core-fixes.patch, 0008-client-bundle.patch, files/test/schedules-client.test.js — node scripts/ds-bot-patches.mjs generate twice; the second run writes identical bytes
  • then check, canonical and build-client.mjs --check on the rebased tree: all three green (see below), so core/ equals ds-bot/ + patches/ds-bot/ holds after Keep the newest Project board decisions and say how many the cap hid #2023 landed, not only before it.

The 0008 re-alignment is larger than the 21/10 bundle change it carries: of its 1161 added lines, 1071 are lines it also removes (the same bundle text re-hunked at new offsets — core/client.js and ds-bot's client.js differ almost everywhere, so a small edit moves the diff alignment). Nothing in it was hand-edited; canonical proves it is exactly what generate writes.

Red first

Two independent runs on the new base 5f1103561dd1279040e473b0c3dea3b536e5baf4 — two fresh checkouts of the base carrying only the new test file. Both: 24 pass / 3 fail, and the three new cases are the failures:

  • #2024: a Bot whose tasks are all paused lists them, and the add-one empty state is gone — 0 !== 3; the rendered text is Scheduled tasks|No scheduled tasks yet. Add one.
  • #2024: each row answers when — Next: …, Paused, Finished — 0 !== 3; the rendered text is Scheduled tasks|Briefing|Every day at 09:00 (Asia/Shanghai) — the repeat rule, with no next run.
  • #2024: a missing or malformed scheduledAt renders without throwing — Got unwanted exception. Actual message: "Invalid time value" from timingText → dayAndTime → Intl.DateTimeFormat().format(NaN).

The fourth new test, a Bot with no tasks at all keeps the empty state and its add button, is a control: it is green on the base and stays green.

Verified on the head

TZ=UTC ARCH_DOCS_BASE=5f1103561dd1279040e473b0c3dea3b536e5baf4 npm run verify in a clean detached checkout of 9b054f0d7389e311c7f42898a5a1ab756064cd03, exit 0:

  • core 2447/2447, social 541/541, tree 127/127, timeline 135/135, workflow 336/336, .github/scripts 563/563, interop 37/37, live-e2e 24/24
  • arch-docs: OK (8 changed file(s)) against base 5f110356; core lint 73 warnings and 0 errors — the base's own count, with no warning in a line this diff adds
  • ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/, ok patches/ds-bot/ is what generate writes (generate is a no-op); build-client.mjs --check no-op

Not run: smoke/bench (no host or turn path), and the CI package job's pack, typecheck and actionlint.

Checkpoint

{
  "pr": 2026,
  "claim": "Dev-3",
  "issue": 2024,
  "summary": "The Bot details panel's Scheduled tasks block kept only active rows, so a Bot whose tasks were all paused claimed it had none and offered only the new-task form while the settings page listed those same rows. It now lists paused and finished tasks too, and each row answers when it runs next — Next: <time>, Paused or Finished — instead of the repeat rule alone. A missing or malformed scheduledAt falls back to the repeat rule instead of throwing RangeError, and only a Bot with no tasks at all gets the empty state, whose button alone opens the new-task form.",
  "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",
    "changelog.d/2024-schedules-drawer-paused-next.fixed.md"
  ],
  "checks": {
    "ran": "TZ=UTC ARCH_DOCS_BASE=5f1103561dd1279040e473b0c3dea3b536e5baf4 npm run verify",
    "result": "green",
    "at": "9b054f0d7389e311c7f42898a5a1ab756064cd03"
  },
  "next": "none — ready for review"
}

@Birfy

Birfy commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at d1f8ec5
Written-by: Reviewer
Attestation: d1f8ec5 role=Reviewer

Ran at this tip:

$ cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/schedules-client.test.js
# tests 27  # pass 27  # fail 0
$ same command in a tip copy with core/src/client/schedules.js reverted to base blob e807b2616c
# tests 27  # pass 24  # fail 3
$ cd core && node scripts/build-client.mjs --check
# exit 0, no output
$ node scripts/ds-bot-patches.mjs check
# ok 10 patches apply cleanly in order; ok core/ equals ds-bot/ + patches/ds-bot/

Review points:

  • Red first: the three new Bot details: a paused-only scheduled list says "No scheduled tasks yet", and its rows never say when the next run is #2024 cases fail on the base blob (0 !== 3, 0 !== 3, Invalid time value); the control case (a Bot with no tasks keeps the empty state) stays green on both.
  • Scope: 8 files, all the issue's surface — core/src/client/schedules.js (filter dropped, nextText per row, instant() guard in timingText's at/after branch), its view test and ds-bot copy, core/client.js (generated), the two patches (generate output; both checks above green), the subsystem doc line and one changelog fragment. No host-side or settings-page change.
  • Tip check-runs: 14/14 completed success, including tests-ok, enqueue-guard, merge-gate, risk tier (report only).
  • Metadata follow-up: agent-pr label added; body keeps Owner: Dev-3 / Reviewer: Birfy and a compliant checkpoint block.

@github-actions github-actions Bot added the pass label Nov 1, 2026
@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 1, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 1, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 1, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 1, 2026
…n each runs

The details panel's Scheduled tasks block filtered the Bot's tasks to
status === 'active', so a Bot whose tasks were all paused read "No
scheduled tasks yet" while having tasks, and a row never said when it
runs next.

List every task of that Bot; each row now answers when — Next: <time>,
Paused, or Finished — and an unreadable scheduledAt falls back to the
repeat rule instead of throwing from Intl.DateTimeFormat. The empty
state stays for a Bot with no tasks at all, and only that empty state's
button carries bot.id (ThinkFlowLab#2024).
@HugoXK
HugoXK force-pushed the dev/3-schedules-drawer-paused-next branch from d1f8ec5 to 9b054f0 Compare November 1, 2026 11:16
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 1, 2026
@Birfy

Birfy commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at 9b054f0
Written-by: Reviewer
Attestation: 9b054f0 role=Reviewer

Ran at this tip:

$ cd core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/schedules-client.test.js
# tests 27  # pass 27  # fail 0
$ same command in a copy of this tip with core/src/client/schedules.js put back to the base blob e807b2616c
# tests 27  # pass 24  # fail 3

Review points (rebase tip 9b054f0d, supersedes the PASS at d1f8ec58 — the head moved to land the regenerated patch split on current main):

  • Red first: the three Bot details: a paused-only scheduled list says "No scheduled tasks yet", and its rows never say when the next run is #2024 cases are exactly the failures on the base blob (0 !== 3, 0 !== 3, Invalid time value); the no-tasks control case is green on both sides.
  • Scope unchanged: 8 files — core/src/client/schedules.js, its view test and the ds-bot copy, generated core/client.js, patches/ds-bot/0001 + 0008 (regenerated: 0008 is now +1161/−1134 on the new base), the subsystem doc line, one changelog fragment.
  • The earlier queue failure (merge-group Test → ds-bot-patches canonical, M patches/ds-bot/0008-client-bundle.patch) was base drift from Keep the newest Project board decisions and say how many the cap hid #2023 landing on main; on this tip package (which runs check and canonical with git) is green, so the regenerated 0008 is what generate writes.
  • All check-runs on this tip completed success (tests-ok, package, merge-gate, enqueue-guard, risk tier report-only).

@Birfy
Birfy added this pull request to the merge queue Nov 1, 2026
Merged via the queue into ThinkFlowLab:main with commit 938a1ec Nov 1, 2026
14 checks passed
@Birfy
Birfy deleted the dev/3-schedules-drawer-paused-next branch November 1, 2026 11:24
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bot details: a paused-only scheduled list says "No scheduled tasks yet", and its rows never say when the next run is

2 participants