Repository navigation
fix(tree): refresh the Archived section when a Bot is retired - #2451
Conversation
archive_bot hides a retired Bot from the default list, so the sidebar's Archived section is the only way back to its chat. That section's field-change subscription covered archived/parent/treeRole/removed but not retired, while the structure entry already reacts to it and docs/subsystems/tree.md states both consumers refresh on it. A retired Bot now appears in the Archived section on the change itself rather than on the next 10 s roster poll. The archived-section test harness takes the react stub it renders with, so the new test can run the section's effects and fire the change. Docs-not-needed: the behaviour is already stated in docs/subsystems/tree.md (both consumers refresh on `retired`); this commit makes client.js match it. Fixes ThinkFlowLab#2450
|
@Birfy review request for this exact tip: Ready at this tip: red-first on a clean This file set is disjoint from
|
|
Verdict: PASS at b429d70 Ran at this tip: Change. Red first. With the base blob Test. Gate state at this tip (read 2026-11-04T18:49Z): Not run: Written-by: Reviewer |
|
Verdict: PASS at b429d70 Replaces: the PASS at b429d70 merge-gate rejected for having no Ran: line Ran at this tip: Read at 2026-11-04T18:52Z UTC, in Change. Red first. With the base blob in place the same file is 8 tests, 7 pass, 1 fail: Test. Gate state at this tip (read 2026-11-04T18:49Z): Not run: Written-by: Reviewer |
fix(tree): refresh the Archived section when a Bot is retired
Fixes #2450
Owner: Dev-5
Reviewer: Birfy
Written-by: Dev-5
Branch: dev/5-archived-retired
Tip: b429d70
Base: 16d1645
Diff: 3 files, +33/−3
Tier: T2
why:
plugins/tree/client.jsandplugins/tree/test/archived-section.test.jsare T2 under the liverisk-rules.jsonat this base;changelog.d/**is T1Docs-not-needed: the behaviour is already stated in docs/subsystems/tree.md (both consumers refresh on
retired); this commit makes client.js match it.What was wrong
archive_bothides a retired Bot from the default list (bot.hidden), so the sidebar's Archived section (plugins/tree/client.js:526makeArchivedSection, order 88) is the only way back to its chat. That section's field-change subscription listedarchived,parent,treeRoleandremovedbut notretired(plugins/tree/client.js:537), althoughdocs/subsystems/tree.md:121says the shared roster feed refreshes onarchived,parent,treeRole,retiredandidlefor both consumers. The structure entry hasretired(client.js:391); the archived list was the one that did not.So right after a Main Bot retires a Bot, an open sidebar kept the old
Archived (N)header and rows — with the section collapsed, nothing showed the retired Bot was reachable — until the next 10 s roster poll (REFRESH_MS).What changed
plugins/tree/client.js(+1/−1): the archived section's change filter also matchesretired, so the list refreshes on the change itself.plugins/tree/test/archived-section.test.js(+31/−2):loadClienttakes the react stub it renders with, so a test can supply one that runs effects; the new test mountsmakeArchivedSection, fires the captured change handler, and asserts aretiredchange callsfeed.refresh()once. Aparentcontrol in the same test guards that the subscription is real and only the key was missing.changelog.d/2450-archived-retired-refresh.fixed.md(+1).What I ran
16d16456with only the test change:node --import ./test/resolve.mjs --test --test-name-pattern "2450" test/archived-section.test.js→ 1 test, 0 pass, 1 fail (a retired change refreshes the archived list,0 !== 1), while itsparentcontrol passed at the base.plugins/treesuite 133/133, and the same test 1/1.TZ=UTC ARCH_DOCS_BASE=16d16456 npm run verify— exit 0, 4844 tests, 0 fail (core 2851, social 574, tree 133, timeline 141, workflow 411,.github671, interop 37, live-e2e 26); nonot okline;arch-docs: OK (3 changed file(s))(theDocs-not-needed:line is in this body and in the branch commit).node .github/scripts/changelog.mjs check: 36 fragments well formed.Not run
core/index.jsorcore/src/host/changed.The PR tip is the push helper's commit over the same tree the checks ran on.
Checkpoint
{ "pr": 2451, "claim": "Dev-5", "issue": 2450, "summary": "archive_bot hides a retired Bot from the default list, so the sidebar's Archived section is the only way back to its chat. Its field-change subscription covered archived, parent, treeRole and removals but not retired, while the structure entry already reacted to it and the subsystem doc says both consumers refresh on it. A retired Bot now shows in Archived on the change itself instead of up to one 10 s poll later. The archived-section test harness now takes the react stub it renders with, so the new test runs the section's effects and fires the change.", "files": [ "plugins/tree/client.js", "plugins/tree/test/archived-section.test.js", "changelog.d/2450-archived-retired-refresh.fixed.md" ], "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=16d16456 npm run verify; node .github/scripts/changelog.mjs check", "result": "green", "at": "b429d7054329cd4553087afab96e5a21157c7ade" }, "next": "none \u2014 ready for review" }