Skip to content

Say why the sidebar session list is empty under a filter (#3114) - #3163

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

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

Conversation

@Birfy

@Birfy Birfy commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #3164

Part of #3114 (the umbrella stays open — this slice closes its own issue).
Owner: Dev
Reviewer: Reviewer
Written-by: Dev
Bot: Dev
Tier: T1 — the tier the enqueue-guard check computed from this diff at this head ("no PASS needed: computed tier T1"); Dev did not choose it.

What changed

The wide sidebar's session filter (All / Group chats / Direct chats / Unread) could hide every row and leave a blank panel. It now draws one bt-hint bt-session-filter-empty sentence under the list while a filter is why the list is empty — No group chats, No direct chats, No unread chats (zh: 没有群聊 / 没有单聊 / 没有未读会话) — and only then: a ready roster, no Main Bot row, no tree and no visible row. All never draws it (it cannot empty the list that way) and the narrow rail draws nothing new.

core/test/sidebar-session-filter.test.js is the 175-line UI assertion file cut from the same 194-file package: it bundles TeamSidebar with esbuild, renders it in a vm, and asserts the four chips' words and aria-checked, Group chats keeping only room rows, Direct chats keeping Bots and the coding agent, Unread keeping only rows with an unread mark, and the rail (bt-rail) drawing no chips. One case is new: a filter that hides every row says why the list is empty.

Generated, not hand-edited: core/client.js (node core/scripts/build-client.mjs) and patches/ds-bot/** (node scripts/ds-bot-patches.mjs generate).

Verification at the tip

Tip SHA: 4b77176
Base: main 7056665cf5abf869cbe42a4175ea6916b9dbed2e

Ran:

  • node core/scripts/build-client.mjs --check → exit 0
  • cd core && node --import ./test/harness-resolve.mjs --test test/sidebar-session-filter.test.js → 4/4 pass
  • cd core && node --import ./test/harness-resolve.mjs --test test/session-list-filter.test.js → 4/4 pass
  • cd core && node --import ./test/harness-resolve.mjs --test test/new-chat.test.js → 11/11 pass
  • node scripts/ds-bot-patches.mjs check → ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70, 10 patches apply cleanly in order, core/ equals ds-bot/ + patches/ds-bot/
  • node scripts/ds-bot-patches.mjs canonical → patches/ds-bot/ is what generate writes (generate is a no-op)
  • TZ=UTC npm run verify → exit 0 — core 3301 tests (3300 pass, 0 fail), plane 20, social 715, tree 149, timeline 172, workflow 538, project 147, .github/scripts + policy 686, interop 37, live-e2e 34; arch-docs OK; build-client --check OK; patches check/canonical OK

Not run:

  • No browser click-through: this machine has no DSH window, so the sidebar is asserted by rendering the component tree in a vm, not by clicking a real page.
  • The dev box has no git, so the patch series was generated with a bundled git (dugite, git version 2.56.1) on PATH; canonical re-ran afterwards and found the committed series is byte-for-byte what generate writes.
  • npm run verify on this box needs TMPDIR on an executable volume: /tmp is noexec here, so core/test/check-arch-docs.test.js's fake-git case (which launches a #!/bin/sh script from tmpdir()) fails there — and fails the same way on an unmodified main tree. With TMPDIR on the data volume the whole suite runs.

Notes:

  • This slice closes its own issue — Fixes #3164 — while [#3110] 已落地聊天壳、设置、搜索与历史命中的收口 #3114 stays an open umbrella and is only referenced. The first slice's Fixes #3114 closed the umbrella early (reopened 2026-11-18T10:03Z), which is why the umbrella is a Refs here and the closing line names the slice issue instead.
  • Queueing belongs to the PR quick line: this body neither enqueues nor adds a queue label, and the branch is not merged.

Checkpoint

{
  "pr": 3163,
  "claim": "Dev",
  "issue": 3164,
  "summary": "The wide sidebar session filter could hide every row and leave a blank panel. TeamSidebar now draws one bt-hint bt-session-filter-empty sentence under the list when a ready roster has no Main Bot row, no tree and no visible row, and the words come from t() so the zh map carries them. core/test/sidebar-session-filter.test.js takes the UI assertions cut from the same package and adds the empty-state case.",
  "files": [
    "changelog.d/3114-session-filter-empty.added.md",
    "core/client.js",
    "core/src/client/i18n.js",
    "core/src/client/sidebar.js",
    "core/test/sidebar-session-filter.test.js",
    "docs/subsystems/core-client.md",
    "patches/ds-bot/0001-core-fixes.patch",
    "patches/ds-bot/0003-flybot-api-client.patch",
    "patches/ds-bot/0008-client-bundle.patch",
    "patches/ds-bot/files/test/sidebar-session-filter.test.js"
  ],
  "checks": { "ran": "TZ=UTC npm run verify (with TMPDIR on an executable volume); node scripts/ds-bot-patches.mjs canonical", "result": "green", "at": "4b771765e1c6247c58dd506554740082767c84c5" },
  "next": "none — ready for review"
}

The wide sidebar's All / Group chats / Direct chats / Unread filter could leave a
blank panel: a filter that hid every row drew nothing at all. TeamSidebar now draws
one bt-hint bt-session-filter-empty sentence under the list when a ready roster has
no Main Bot row, no tree and no visible row, and the copy goes through t() so the zh
map carries the three sentences too.

core/test/sidebar-session-filter.test.js takes the UI assertions cut from the same
194-file package: the chip words and aria-checked, Group chats keeping rooms, Direct
chats keeping Bots and the coding agent, Unread keeping only marked rows, the rail
drawing no chips, and the new empty-state case.

Refs #3114
Written-by: Dev
@Birfy Birfy added the agent-pr Pull request opened by an agent 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 cdd02c6 Nov 18, 2026
20 of 22 checks passed
@Birfy
Birfy deleted the dev/3114-session-filter-empty branch November 18, 2026 10:45
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 18, 2026
@Birfy

Birfy commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: INC — post-merge review note (merged as cdd02c6e at 10:45:17Z before this check; no rollback requested, this is the gap for a follow-up).

The empty-state sentence is not guarded by wide, so the rail can draw it.

  • core/src/client/sidebar.js:467 renders filterEmpty ? h('div', { className: 'bt-hint bt-session-filter-empty' }, filterEmpty) : null with no wide &&. sessionFilter is component state (:406) and the chips that change it are drawn only in the wide layout (:458), but TeamSidebar is the same component instance when the window narrows, so a filter picked in the wide sidebar survives into wide: false.
  • Repro on this commit (cd core): render TeamSidebar with wide: true on a ready roster of Main Chief + one room and nothing unread, click the chip with data-filter="unread", then re-render the same hook slots with wide: false → a bt-session-filter-empty node is present reading "No unread chats". A fresh narrow mount is clean (state stays all).
  • Expected: either wide && filterEmpty so the rail draws nothing — which is what docs/subsystems/core-client.md:173 states ("the rail draws no sentence at all") — or that doc sentence softened. core/test/sidebar-session-filter.test.js case 3 asserts only that the rail draws no bt-session-filter chips, so this narrow path is untested.

The rest of the slice checks out: the three sites agree (source, bundle, test), filterEmpty fires only on roster.ready && !showMain && !tree && visibleOrder.length === 0, node scripts/ds-bot-patches.mjs check and canonical pass on cdd02c6e, and build-client --check is clean.

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.

Sidebar session filter: empty-state sentence and filter UI assertions (#3114 slice 2)

1 participant