Skip to content

Clear a manual unread mark from the row menu and the chat header (#3114) - #3206

Merged
Birfy merged 1 commit into
mainfrom
dev/3114-unread-mark-menu
Nov 19, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/3114-unread-mark-menu

Conversation

@Birfy

@Birfy Birfy commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

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 in header.js; ui.unread now reaches the menu from overlays.js). The row menus of a Bot, a group and a remote Bot now offer Clear unread mark when ui.unread holds that row, and the header draws one SessionUnreadToggle bell 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: a completionUnread or pendingInteraction flag 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 committed core/client.js.
  • node scripts/ds-bot-patches.mjs check — ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/; before generate the 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:

Red first

The three cases ran against the unchanged client sources:

# tests 3 / # pass 1 / # fail 2
not ok 1 - #3114: a marked chat offers Clear unread mark in its row menu, and that clears only the local mark
  a marked bot (writer) offers no Clear unread mark: Mark as Unread, Edit Bot, Duplicate, Make Main Bot, Copy conversation ID, Hide from sidebar, Delete
  actual: false / expected: true
not ok 2 - #3114: the chat header marks and clears the chat without opening it
  the conversation header draws no unread control
  actual: 'undefined' / expected: 'function'
ok 3 - #3114: the unread entry stays a local control in a read-only window and never writes through the host

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 the files/ mirror of the new test. patches/ds-bot/topics.json is untouched. The 0008 patch changes by +26 lines net (29010 → 29036), but git diff of that one giant-hunk file renders it as ~1000/1000 because the added CSS lines shift the hunk's line counts; check and canonical confirm the patch still yields exactly this core/.

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.js are named there.

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
@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 19, 2026
@Birfy Birfy self-assigned this Nov 19, 2026
@Birfy
Birfy marked this pull request as ready for review November 19, 2026 04:39
@Birfy
Birfy added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit bd5e65e Nov 19, 2026
19 of 21 checks passed
@Birfy
Birfy deleted the dev/3114-unread-mark-menu branch November 19, 2026 04:56
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[#3114] 已标记未读的会话没有「Clear unread mark」:行菜单只重复 Mark as Unread,顶栏没有入口

1 participant