Repository navigation
Clear a manual unread mark from the row menu and the chat header (#3114) - #3206
Merged
Merged
Conversation
A chat already marked unread only offered Mark as Unread again, and the conversation header had no unread entry, so the local mark could not be cleared without opening the chat. The row menus now offer Clear unread mark when `ui.unread` holds that row, the header draws one bell toggle that maps the Session id to the sidebar's row id, and clearing either one writes only the local key — completion and pending-interaction flags are untouched. Fixes #3205 Part of #3114
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 #3205
Owner: Dev
Reviewer: Reviewer
Part of #3114
Tier: T1
What
A chat already marked unread only offered Mark as Unread again, and the conversation header had no unread entry, so the local mark could not be cleared without opening the chat (row menus in
core/src/client/context-menu.js; the header inheader.js;ui.unreadnow reaches the menu fromoverlays.js). The row menus of a Bot, a group and a remote Bot now offer Clear unread mark whenui.unreadholds that row, and the header draws oneSessionUnreadTogglebell that maps the Session id to the sidebar's row id (unreadEntryId) and sets or clears the same key. Clearing writes only the local key: acompletionUnreadorpendingInteractionflag is untouched and still clears only when the chat is opened. This is the second half of #3110 L102/L243, not a new behavior.Checkpoint
{
"pr": 3206,
"claim": "Dev",
"issue": 3205,
"summary": "A chat already marked unread now offers Clear unread mark in its row menu, and the conversation header draws one bell toggle that maps the Session id to the sidebar row id and sets or clears the same local key. Clearing writes only
ui.unread, so a completion or pending-interaction flag still clears only when the chat is opened. No host, shared-layer or authz file changed.","files": [
"core/src/client/context-menu.js",
"core/src/client/header.js",
"core/src/client/overlays.js",
"core/src/client/styles.js",
"core/src/client/i18n.js",
"core/test/unread-mark-menu.test.js",
"docs/subsystems/core-client.md",
"changelog.d/3114-unread-mark-menu.fixed.md",
"core/client.js",
"patches/ds-bot/0012-room-membership.patch"
],
"checks": {
"ran": "TZ=UTC TMPDIR=/data/flybot-tmp npm run verify (exit 0); six-file node --test 19/19; node core/scripts/build-client.mjs --check; node scripts/ds-bot-patches.mjs check && canonical; changelog / mojibake / testing-layers checks",
"result": "green",
"at": "581db146fce053ec33a62d2a3976d3dd9f26de04"
},
"next": "none — ready for review. T1: green tests-ok at the tip is the gate; Dev writes no Verdict."
}
Verification at the tip
Tip:
581db146fce053ec33a62d2a3976d3dd9f26de04.Ran:
cd core && TZ=UTC TMPDIR=/data/flybot-tmp node --test test/unread-mark-menu.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/unread-mark-menu.test.js test/context-menu-readonly.test.js test/context-menu-agent-readonly.test.js test/sidebar-manual-unread.test.js test/header-slot.test.js test/client-bundle.test.js— 19 tests / 19 pass / 0 fail.node core/scripts/build-client.mjs --check— exit 0 on the committedcore/client.js.node scripts/ds-bot-patches.mjs check—ok 10 patches apply cleanly in order,ok core/ equals ds-bot/ + patches/ds-bot/; beforegeneratethe same command exits 1 and names the five changed sources plus the new test file;canonical— generate is a no-op.node .github/scripts/changelog.mjs check— 11 fragments well formed;node .github/scripts/check-mojibake.mjs --check— 0 occurrences;node .github/scripts/testing-layers.mjs --check— every test file and workflow classified.TZ=UTC TMPDIR=/data/flybot-tmp npm run verify— exit 0.grep -rn "Mark as Read" core/src/client | wc -l— 0.Not run:
core/src/shared/session-unread.jsplus the three imports that follow it (sidebar.js:17shouldClearManualUnread,header.js:13isManuallyUnread/unreadEntryId,context-menu.js:10isManuallyUnread), keeps this branch'sunreadItem/SessionUnreadToggleand drops its duplicate unread menu item andi18nline (spec section 1A). If Add staged Teamily-style chat tools and owner-scoped history search #3112 merges first instead, this cut is void and [#3114] 已标记未读的会话没有「Clear unread mark」:行菜单只重复 Mark as Unread,顶栏没有入口 #3205 closesnot_planned.completionUnread/pendingInteractionstay host-written.core/src/host/**,core/src/shared/**(T3),authz.js,plugins/**,.github/**andpolicy/**are untouched;unreadEntryIdis exported fromheader.jsrather than a new shared module.Red first
The three cases ran against the unchanged client sources:
The third case already passes on the old code; it is the no-regression case. After the change the same command reports 3 / 3 / 0.
Scope
Eight handwritten files (+218/−9 = 227 lines) and six generated ones (14 files in total):
core/client.js(+31/−5, 24762 → 24788; the spec's estimate was +32/−5, one bundle line fewer because the two header helpers are written more compactly),patches/ds-bot/{0001,0003,0008,0012}and thefiles/mirror of the new test.patches/ds-bot/topics.jsonis untouched. The0008patch changes by +26 lines net (29010 → 29036), butgit diffof that one giant-hunk file renders it as ~1000/1000 because the added CSS lines shift the hunk's line counts;checkandcanonicalconfirm the patch still yields exactly thiscore/.Ordering with #3112
#3112 is still open (not merged) at this tip, with the same unread front-end hunks. It must rebase onto this branch as described in Not run above; the three imports to delete with
core/src/shared/session-unread.jsare named there.