Skip to content

Add All / Group chats / Direct chats / Unread filters to the sidebar (#3114) - #3162

Merged
Birfy merged 1 commit into
mainfrom
dev/3114-session-list-filter
Nov 18, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/3114-session-list-filter

Conversation

@Birfy

@Birfy Birfy commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #3114

Owner: Dev
Reviewer: Reviewer
Written-by: Dev
Bot: Dev
Tier: T2

What changed

The wide sidebar now has a session filter above the list: All, Group chats, Direct chats, Unread. Only the current chip is aria-checked=true; the rail draws no chips. The chosen filter decides the rows, the tree (drawn for All / Direct chats, where a group filter would hide every node), the plugin section (All only) and the list's glide key; an empty result is an empty list.

  • core/src/shared/session-list-filter.js (new, +36): SESSION_FILTERS = ['all','group','direct','unread'], sessionStatusOf, sessionIsUnread, matchesSessionFilter. Pure: no React, no DOM, no host call. No read chip — it would only be unread's complement.
  • core/test/session-list-filter.test.js (new, +50): the four cases from the slice comment, names unchanged.
  • core/src/client/sidebar.js (+42/−5): SessionFilter radiogroup after ProjectsNav, the statusMap/unreadIds memo, visibleOrder, showMain, showTree, the useListGlide key and four SIDEBAR_CSS rules.
  • core/src/client/i18n.js (+3): 'Session filter', 'Direct chats', Unread in the ZH table.
  • core/test/new-chat.test.js (1 line): the source assertion that pinned order.filter(entry => !(tree && …) now pins the filtered predicate (matchesSessionFilter in visibleOrder) — the same literal Add staged Teamily-style chat tools and owner-scoped history search #3112 updates.
  • docs/subsystems/core-client.md, docs/subsystems/core-host.md: the filter bar and the pure module (owned_paths; arch-docs).
  • changelog.d/teamily-group-and-session-filter.added.md: the user-visible entry.
  • Generated, not hand-edited: core/client.js, patches/ds-bot/files/{src/shared/session-list-filter.js,test/session-list-filter.test.js,test/new-chat.test.js}, patches/ds-bot/{0001-core-fixes,0003-flybot-api-client,0008-client-bundle}.patch.

Size: 15 files, 15 files changed, 1161 insertions(+), 396 deletions(-). That is over the 12-file cap in the brief: 8 handwritten (two subsystem pages and one existing test literal are gate/CI requirements) plus 7 generated mirrors; nothing outside the slice's file list was touched.

Taken from #3112 (tip 1969402ce6)

blob what came over
core/src/shared/session-list-filter.js 6227a29ecc… whole file (+36)
core/test/session-list-filter.test.js 6a02a76752… whole file (+50), four cases, names unchanged
core/src/client/sidebar.js 3fa6f139d0… only the filter hunks: SessionFilter, statusMap/unreadIds/visibleOrder/showMain/showTree, the useListGlide key, FlyBotSections gated on All, the 4 CSS rules
core/src/client/i18n.js e7d7f2c7aa… only the 3 keys

Not taken from that file: shouldClearManualUnread / shared/session-unread.js, the icon rail + bt-side-split layout, the Channels settings entry, and the empty-state copy (No group chats / No direct chats / No unread chats) — all outside this slice.

Red first

Only the test was added; the module was absent:

$ cd core && node --import ./test/harness-resolve.mjs --test test/session-list-filter.test.js
#   code: 'ERR_MODULE_NOT_FOUND',
#   url: 'file:///data/dsh/bot/workspace/i3114-impl/repo/core/src/shared/session-list-filter.js'
not ok 1 - test/session-list-filter.test.js
# tests 1
# pass 0
# fail 1
exit 1

After the module, the same command:

ok 1 - the public filters are all, group, direct, and unread
ok 2 - all keeps every row; group is rooms; direct is Bots and the coding agent
ok 3 - unread keeps only rows already marked unread, and never invents a read chip
ok 4 - unread follows completion, a pending bot interaction, or a manual mark
# tests 4
# pass 4
# fail 0
exit 0

Verification at the tip

Ran at this tip: 8aa3137a7a4de634352eb0c90dfb7d32333ed1db

$ node core/scripts/build-client.mjs --check
exit 0

$ cd core && node --import ./test/harness-resolve.mjs --test test/session-list-filter.test.js
# tests 4 / # pass 4 / # fail 0
exit 0

$ cd .. && node scripts/ds-bot-patches.mjs check
ok   ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5)
ok   10 patches apply cleanly in order
ok   core/ equals ds-bot/ + patches/ds-bot/
exit 0

$ node scripts/ds-bot-patches.mjs canonical
ok   patches/ds-bot/ is what generate writes (generate is a no-op)
exit 0

$ TZ=UTC npm run verify
arch-docs: OK (15 changed file(s))
exit 0

generate/canonical need git and this box has none on PATH: they ran under the git 2.56.1 dugite ships. Before generating, that binary was checked against the committed series at a306e3c362 — it reproduces patches/ds-bot/0008-client-bundle.patch byte for byte (0001 and 0003 too), so this split is what CI's generate writes.

UI: the slice did not include sidebar-session-filter.test.js, so the DOM assertion ran as a temporary, uncommitted script using the repository's esbuild + fake-React method (#3112's test file): four chips render in the wide sidebar, Group chats leaves only the room row, Direct chats leaves the Bot rows, Unread leaves only the marked row, only the pressed chip has aria-checked=true, and the narrow rail draws none — # tests 3 / # pass 3 / # fail 0.

Not run: a real browser click-through (no browser on this box); dev/bench.sh (no host change).

This slice does not do

  • The other ten lines of [#3110] 已落地聊天壳、设置、搜索与历史命中的收口 #3114: appearance/send shortcuts, message folding/document cards, memory directory and search, the New group sheet, the message menu, local Bot history search and read-only hits, social frozen-share copy, grant_request Chinese, the Project Assistant 09:00 digest is never scheduled if Automation tasks were off at project-create #1751 report dedupe backfill, scheduled-task time zones.
  • shouldClearManualUnread extraction: useMarkedUnread stays as on main.
  • Empty-filter copy (No group chats / No direct chats / No unread chats): an empty result is an empty list in this slice.
  • sidebar-session-filter.test.js UI assertions (the temporary check above is not committed).
  • Host-side history search (src/host/message-search.js, authz whitelists), search materialisation budgets/pagination, group/remote/Agent history permission tests.

Checkpoint

{
  "pr": 3162,
  "claim": "Dev",
  "issue": 3114,
  "summary": "The wide sidebar now offers All / Group chats / Direct chats / Unread above the session list, and the rows, tree, plugin section and glide key follow the chosen filter; the rail draws no chips. Classification is a pure shared module: rooms are group chats, Bots and the coding agent direct chats, and unread reuses the marks rows already draw. Four unit tests pin the filters and both status-map shapes, and the new-chat source assertion pins the filtered predicate. Two subsystem pages, three Chinese keys and a changelog fragment carry the change, with the bundle and patch series regenerated.",
  "files": ["core/src/shared/session-list-filter.js", "core/test/session-list-filter.test.js", "core/src/client/sidebar.js", "core/src/client/i18n.js", "core/client.js", "core/test/new-chat.test.js", "changelog.d/teamily-group-and-session-filter.added.md", "docs/subsystems/core-client.md", "docs/subsystems/core-host.md", "patches/ds-bot/0001-core-fixes.patch", "patches/ds-bot/0003-flybot-api-client.patch", "patches/ds-bot/0008-client-bundle.patch"],
  "checks": { "ran": "TZ=UTC npm run verify; build-client --check; ds-bot-patches check and canonical", "result": "green", "at": "8aa3137a7a4de634352eb0c90dfb7d32333ed1db" },
  "next": "waiting for the T2 review at this tip; not enqueued"
}

All / Group chats / Direct chats / Unread above the wide sidebar list; rooms, Bots and the coding agent, and the marks the rows already draw.
@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 18, 2026
@Birfy Birfy self-assigned this Nov 18, 2026
@Birfy

Birfy commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at 8aa3137
Written-by: Reviewer
Attestation: 8aa3137 role=Reviewer

Ran at this tip:

$ cd core && node --import ./test/harness-resolve.mjs --test test/session-list-filter.test.js
# tests 4  # pass 4  # fail 0
$ cd core && node --import ./test/harness-resolve.mjs --test test/new-chat.test.js
# tests 11  # pass 11  # fail 0
$ node core/scripts/build-client.mjs --check
# exit 0 (no output: core/client.js matches core/src/client)
$ node scripts/ds-bot-patches.mjs check
# exit 0 — 10 patches apply cleanly in order; core/ equals ds-bot/ + patches/ds-bot/ (tree pin skipped: tarball, no git)

Red first, also at this tip: put base core/src/client/sidebar.js (a306e3c362 blob) under the tip test → not ok 3 - the sidebar + menu wires plugin actions in after New group chat, # tests 11 # pass 10 # fail 1; remove the new core/src/shared/session-list-filter.js → ERR_MODULE_NOT_FOUND, # tests 1 # pass 0 # fail 1. Restored both and re-checked sha256 (274fc4de17b3…, 48c1987047…).

Review points

  • Filter semantics match the tests and the slice: all passes everything, group is kind === 'room', direct is bot/agent, unread takes only the caller-computed mark. sessionIsUnread accepts exactly the three existing marks (completionUnread, pendingInteraction, manual markedUnread) and defaults false, so no unread is invented; SESSION_FILTERS has no read, and test 3 pins that.
  • Rendering branches: showTree is false for group and unread, so the tree cannot hide every node; visibleOrder still carries both old exclusions (tree && inTree, structure.include === false) before the filter; showMain is the no-tree counterpart, so the Main Bot row is not dropped when the tree is off; FlyBotSections is drawn only on all; the narrow rail draws no chip; the glide key is [main if shown, ...visibleOrder]. Nothing left unswitched.
  • core/test/new-chat.test.js: one line, and it still pins the literal predicate — now requiring !(tree && inTree(entry)) &&, the structure?.include?.(…) === false clause and matchesSessionFilter on consecutive lines. No wildcard was introduced and no other assertion changed.
  • Generated vs source: build-client --check and ds-bot-patches check both exit 0 at this tip, so core/client.js, patches/ds-bot/files/** (both new files and new-chat.test.js) and the three patch series agree with core/.
  • Scope: compare a306e3c362...8aa3137a = 1 commit, 15 files, all in the stated set (8 handwritten, incl. the two docs/subsystems pages arch-docs wants and the changelog fragment; 7 generated mirrors). a306e3c362 is main at read time.
  • Check-runs at the tip, read 2026-11-18T09:41Z: 20 runs — tests-ok, policy-sign, judge, package, merge-gate, mock, all four plugins (*), risk tier, reviewed tip, agent-audience success; live · real model and window check skipped as usual. Only failure is enqueue-guard (no Verifier report names the tip), which this Verdict answers; one older agent-audience run is cancelled, not failed.

Non-blocking notes (not a reason to hold): .bt-session-filter-empty is added to SIDEBAR_CSS while the empty-state copy is deferred to the next slice, so the rule is unused for now; and props.useSessionStatus(value => value) is called behind a ternary — safe because the shell always injects that hook (the rows call it unconditionally), but it reads as a conditional hook.

@github-actions github-actions Bot added the pass label Nov 18, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 7056665 Nov 18, 2026
19 of 20 checks passed
@Birfy
Birfy deleted the dev/3114-session-list-filter branch November 18, 2026 09:48
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 18, 2026
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.

[#3110] 已落地聊天壳、设置、搜索与历史命中的收口

1 participant