Skip to content

Inbox: restore the queue when a card's Settings page closes - #2542

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-inbox-back-to-queue
Nov 5, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-inbox-back-to-queue

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2541

Owner: Dev-1
Written-by: Dev-1
Reviewer: Birfy
Risk tier: T1

Rebased onto 276042f828bb (#2523 has landed on the 0008 lane) and the generated bundle is re-cut once: pushed head 6d225737c75e keeps tree c93a443ecdbebedea1abc522836088969ad1449041 from the local verified commit 78ab970f5579. Earlier tips of this same branch (fd64c5c4, 57e7e219) are superseded.

What was wrong

core/src/client/inbox.js openCard closes the Inbox and sends a failed workflow run's Open to Settings → Workflows. Closing that page ran closeSettings, which only cleared settings/remoteBotSettings: state.inbox is written in exactly one place (openInbox), so the queue the card was read from stayed closed. Working through five cards meant opening the Inbox five times.

What changed

  • inbox.js: openCard still closes the queue first and now passes back: 'inbox' as openSettings's third argument; new exported closedSettings(state) is the one close transition — it restores { settings: null, remoteBotSettings: null, inbox: true } for a page carrying back: 'inbox', and only clears the panel for any other page.
  • index.js: openSettings(page, id, back = null) stores back only when given, so a page opened from the menu keeps { page, id } and no queue reopens behind it; closeSettings runs closedSettings.
  • The chat branch needs no marker: openSession swaps the conversation in place and leaves no surface to close.
  • Generated once, after the rebase: core/client.js, patches/ds-bot/0003-flybot-api-client.patch (the index.js hunk) and 0008-client-bundle.patch, the src/client/ and test/ mirrors in files/; one docs/subsystems/core-client.md line; one changelog fragment. The 0008 churn (+173/−164) is generator re-pairing around the 11 changed bundle lines — canonical reports generate is a no-op.

Red first, on base 276042f828bb (source reverted, test kept, clean worktree)

$ TZ=UTC node --test core/test/inbox-settings-back.test.js
not ok 1 - \#2541: a workflow card asks Settings to return to the inbox when it closes
  error: |-
    the page names the inbox as where closing returns
    + actual - expected
      [ [ 'close' ], [ 'settings', 'workflows',
    -     null,
    -     'inbox'
        ] ]
not ok 2 - \#2541: closing that page brings the inbox back instead of the chat under it
  error: 'module.exports.closedSettings is not a function'   (TypeError)
not ok 3 - \#2541: a Settings page opened any other way still closes to the view under it
  error: 'module.exports.closedSettings is not a function'   (TypeError)
# tests 3
# pass 0
# fail 3

Ran at local 78ab970f55797b97c57f07c577550d7ed995f371 (tree c93a443ecdbedea1abc522836088969ad1449041; pushed head 6d225737c75e has the same tree), base 276042f828bbf21716d93e1901619eab9f4e794c

  • TZ=UTC node --test test/inbox-settings-back.test.js → # tests 3 / # pass 3 / # fail 0
  • TZ=UTC node --test test/inbox.test.js test/inbox-workflow-failure.test.js test/inbox-readonly.test.js test/inbox-task-status.test.js test/inbox-settings-back.test.js → # tests 53 / # pass 53 / # fail 0
  • node core/scripts/build-client.mjs --check → exit 0
  • node scripts/ds-bot-patches.mjs check → ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5), 10 patches apply cleanly in order, core/ equals ds-bot/ + patches/ds-bot/
  • node scripts/ds-bot-patches.mjs canonical → patches/ds-bot/ is what generate writes (generate is a no-op)
  • TZ=UTC ARCH_DOCS_BASE=276042f828bb npm run verify → exit 0: core 2936/2936, social 577/577, tree 137/137, timeline 141/141, workflow 440/440, .github + policy 671/671, interop 37/37, live-e2e 26/26; arch-docs: OK (10 changed file(s))

The first npm run verify on this rebase died in scripts/lint-plugins.mjs with npm error code EROFS … /home/xuke/.npm/_cacache/tmp/… (the box's npm cache is not writable from this sandbox), not in any repository file; re-running with npm_config_cache pointed inside the checkout gave the exit-0 run above. No source or test line was touched for that.

Not run: the smoke test (no core/index.js or core/src/host/ change; this is the client half only), CI.

Files (10, +359/−183)

core/src/client/inbox.js +13/−1, core/src/client/index.js +6/−5, core/test/inbox-settings-back.test.js +66, core/client.js +11/−5, patches/ds-bot/0003-flybot-api-client.patch +9/−6, patches/ds-bot/0008-client-bundle.patch +173/−164, patches/ds-bot/files/src/client/inbox.js +13/−1, patches/ds-bot/files/test/inbox-settings-back.test.js +66, docs/subsystems/core-client.md +1/−1, changelog.d/2541-inbox-back-to-queue.fixed.md +1.

Checkpoint

{
  "pr": 2542,
  "claim": "Dev-1",
  "issue": 2541,
  "summary": "A failed workflow run's Open closes the Inbox and lands in Settings, so closing that page left the queue shut and one card cost one Inbox reopened by hand. The page now carries back: 'inbox', and closedSettings, the transition the shell's closeSettings runs, restores the queue for that page only. A Settings page opened from the menu stores no marker, so it still closes to the view beneath it. The chat branch needs no marker: openSession swaps the conversation in place and leaves nothing to close.",
  "files": ["core/src/client/inbox.js", "core/src/client/index.js", "core/test/inbox-settings-back.test.js", "core/client.js", "docs/subsystems/core-client.md", "changelog.d/2541-inbox-back-to-queue.fixed.md"],
  "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=276042f828bb npm run verify", "result": "green", "at": "78ab970f55797b97c57f07c577550d7ed995f371" },
  "next": "none — ready for review"
}

@HugoXK

HugoXK commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy review request for the current tip of this PR.

  • Tip: fd64c5c44f1d (10 files, +503/-327), mergeable: true / clean
  • Base: main at d400edb74798b71e233eccd46f221eaef782ff5d
  • Tier: T1 (core/src/client/**, core/test/**, docs/subsystems/**, changelog.d/**); enqueue-guard is green with no PASS needed, so this one can go in on green checks alone
  • Issue: Fixes #2541
  • Checks at this tip: 14 success + 1 cancelled (agent-audience, cancelled and non-blocking)

If the workflows for this fork PR did not start on their own, please approve/run them as well. The tip will not move while this request stands.

@HugoXK
HugoXK force-pushed the dev/1-inbox-back-to-queue branch from fd64c5c to 6d22573 Compare November 5, 2026 14:48
@HugoXK

HugoXK commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

The tip moved (fd64c5c4 → 6d225737) after the rebase onto the new main, so this is the one request for the current tip; the earlier one is void.

  • Tip: 6d225737c75e (tree c93a443ecdbebede1abc522836088969ad1449041), 10 files +359/-183, commits 1
  • Base: 276042f828bbf21716d93e1901619eab9f4e794c = current main (the #2523 merge)
  • Tier: T1 (core/src/client/**, core/test/**, docs/subsystems/**, changelog.d/**); enqueue-guard is green with no PASS needed, so green checks are enough to enqueue
  • Issue: Fixes #2541
  • Checks at this tip: 15 success, mergeable: true / clean, mcm: true
  • Regenerated once on the new base: patches check three lines ok, canonical = generate is a no-op, build-client --check exit 0; the only generated change is 0008-client-bundle.patch +173/-164
  • Red-first retaken on 276042f8: not ok 1/2/3, # pass 0 / # fail 3; post-fix verify exit 0 (core 2936)

The tip will not move while this request stands.

Replay of this tip onto main 276042f: the branch's core/src/client changes
applied on the current main, with core/client.js and patches/ds-bot/
regenerated (npm run build, ds-bot-patches generate) rather than merged.
@Birfy
Birfy force-pushed the dev/1-inbox-back-to-queue branch from 6d22573 to 4908e13 Compare November 5, 2026 14:58
@Birfy

Birfy commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at 4908e13
Written-by: Reviewer
Attestation: 4908e13 role=Reviewer

Ran at this tip:

$ TZ=UTC node --test test/inbox-settings-back.test.js
# tests 3  # pass 3  # fail 0

What this tip is: the replay of #2542's change set onto main 276042f8 (parent of this commit is 276042f8, the tip now carries the #2523 client changes). Tree c93a443ecdbebedea1abc522836088969ad1449041 is the tree the author's locally checked commit 78ab970f had, so the content judged here is the content the author verified, only rebuilt on the new base. This head supersedes fd64c5c4 and 6d225737; the body's "pushed head 6d225737" line is superseded by this tip.

Red first: in the same extracted tip tree I restored core/src/client/inbox.js alone to the base blob at 276042f8 and reran the same command — not ok 1/2/3, # tests 3 # pass 0 # fail 3 — then restored the file and reran: # tests 3 # pass 3 # fail 0. So the test fails on the base and passes on the tip.

CI at this tip: tests-ok, ubuntu-latest · Node 24 · DSH 0.2.0-rc.2, plugins (social|tree|timeline|workflow), package, merge-gate, enqueue-guard, risk tier (report only), reviewed tip (report only), policy-sign, agent-audience, judge — all success; mergeable: true, state clean, base 276042f8.

Not run: the full npm run verify suite here and the smoke test (client-only change; no core/index.js or core/src/host/ file touched). The author's recorded verify run is green at the same tree.

@github-actions github-actions Bot added the pass label Nov 5, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 5, 2026
Merged via the queue into ThinkFlowLab:main with commit f36b388 Nov 5, 2026
14 checks passed
@Birfy
Birfy deleted the dev/1-inbox-back-to-queue branch November 5, 2026 15:06
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.

Inbox: closing a card opened from the queue should return to the queue

2 participants