Repository navigation
Keep a manual unread mark on the chat that is already open (#3114) - #3204
Merged
Merged
Conversation
useMarkedUnread cleared the mark in the same pass that made it: `active` was already true when the row re-rendered with `marked`, so Mark as Unread on the chat on screen went away at once. Remember the previous `active` in a ref and clear only on the way back in, so the mark survives while that chat stays open and is cleared once when it is left and opened again.
Birfy
marked this pull request as ready for review
November 19, 2026 03:15
This was referenced Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Written-by: Dev
Fixes #3202
Owner: Dev
Reviewer: Reviewer
Part of #3114
Tier: T1
What
A manual Mark as Unread on the chat already on screen is cleared by
useMarkedUnreadin the same draw that sets it, becauseactiveis already true. The hook now keeps the previousactivein a ref and clears only on the way back in.Checkpoint
{
"pr": 3204,
"claim": "Dev",
"issue": 3202,
"summary": "useMarkedUnread now remembers whether the row was active on the previous draw and calls clearUnread only when a marked chat is opened. A manual Mark as Unread made on the chat already on screen therefore keeps its mark while that chat stays open, and the mark is cleared once when the chat is left and opened again. The unread dot and 'Unread activity' label still draw only when the row is not active, and the unread filter still reads the mark itself.",
"files": [
"core/src/client/sidebar.js",
"core/test/sidebar-manual-unread.test.js",
"docs/subsystems/core-client.md",
"changelog.d/3114-manual-unread-open.fixed.md",
"core/client.js",
"patches/ds-bot/0003-flybot-api-client.patch",
"patches/ds-bot/0008-client-bundle.patch",
"patches/ds-bot/files/test/sidebar-manual-unread.test.js"
],
"checks": {
"ran": "TZ=UTC TMPDIR=/data/flybot-tmp npm run verify (exit 0); cd core && node --test test/sidebar-session-filter.test.js test/sidebar-manual-unread.test.js test/context-menu-readonly.test.js test/client-bundle.test.js (13/13); node core/scripts/build-client.mjs --check; node scripts/ds-bot-patches.mjs check && canonical",
"result": "green",
"at": "0f4128c7098005e0a858189477045ec346b8eb3f"
},
"next": "none — ready for review. T1: green tests-ok at the tip is the gate; Dev writes no Verdict."
}
Verification at the tip
Tip:
0f4128c7098005e0a858189477045ec346b8eb3f.Ran:
cd core && TZ=UTC TMPDIR=/data/flybot-tmp node --test test/sidebar-manual-unread.test.js— 3 tests / 3 pass / 0 fail after the change; 3 / 1 / 2 before it (red first).cd core && TZ=UTC TMPDIR=/data/flybot-tmp node --test test/sidebar-session-filter.test.js test/sidebar-manual-unread.test.js test/context-menu-readonly.test.js test/client-bundle.test.js— 13 tests / 13 pass / 0 fail.node core/scripts/build-client.mjs --check— exit 0 on the committedcore/client.js.node scripts/ds-bot-patches.mjs check— 10 patches apply cleanly,core/ equals ds-bot/ + patches/ds-bot/;canonical— generate is a no-op.node .github/scripts/changelog.mjs check— 10 fragments well formed;node .github/scripts/check-mojibake.mjs --check— 0 occurrences.TZ=UTC TMPDIR=/data/flybot-tmp npm run verify— exit 0.Not run:
!activedraws (Bot row, group row, DSH Agent row) andmarked && !activeinunreadare untouched, by design (spec section 10).core/src/host/**,core/src/shared/**(T3),authz.js,plugins/**,.github/**,policy/**—git diff --name-only mainnames none of them; the decision stays insidebar.js.wasActivehunk incore/src/client/sidebar.js(itssession-unread.jsand its tests stay).Red first
The three cases in
core/test/sidebar-manual-unread.test.jsran before the implementation change:The second case already passes on the old code; it is the no-regression case. After the change the same command reports 3 / 3 / 0.
Scope
Four handwritten files (+138/−4 = 142 lines) and four generated ones:
core/client.js(+5/−2, 24759 → 24762),patches/ds-bot/0003-flybot-api-client.patch,patches/ds-bot/0008-client-bundle.patch, and thefiles/mirror of the new test.patches/ds-bot/topics.jsonis untouched. No new i18n key:Mark as Unreadalready exists, andgit diff main -- core/src/client/i18n.jsis empty.Ordering with #3112
#3112 is still open, not merged. It carries the same
wasActivehunk incore/src/client/sidebar.js; when it merges after this one it must rebase and delete that hunk fromsidebar.js, keepingcore/src/shared/session-unread.jsand its tests.