Skip to content

feat(web): one filter menu for multi-select inboxes and environments - #79

Merged
nullStack65 merged 3 commits into
release/native-0.1.10from
feat/native-0.1.10-sidebar-filter-menu
Nov 18, 2026
Merged

nullStack65 merged 3 commits into
release/native-0.1.10from
feat/native-0.1.10-sidebar-filter-menu

Conversation

@nullStack65

@nullStack65 nullStack65 commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Kameron couldn't see just his own threads and agent threads together. The sidebar's single-choice "Inbox" dropdown forced "All threads", which shows 200+ threads. Two rows of selects ("Inbox" and "New threads") also sat between the search bar and the list.

What changed

  1. One filter menu next to Search (sliders icon). Its Inbox section is multi-select: Kameron · Agents · Jeff · Shared, each with a live count. Its Environments section is multi-select too, with a count and a connected/not-connected dot per environment. That section only appears when the app knows more than one environment.
  2. Default view: the founder chosen for this device plus Agents. With no founder chosen, the default is every inbox (unchanged).
  3. Each thread is filtered under exactly one inbox: Shared if its audience is Shared, else the founder it's filed to, else Agents. Before this, "Agents" matched any thread an agent started, so checking Agents brought back Jeff's and Shared threads. Now unchecking Jeff hides every Jeff thread. matchesInboxView itself is unchanged.
  4. Non-default view: a small dot on the filter button, the button's accessible name spells out the selection (for example "… (Kameron, Agents, Jeff)"), and a Reset to default item appears in the menu.
  5. "New threads belong to" moved to Settings → Threads → Inbox. It controls creation, not viewing.
  6. Both rows between search and the list are gone. Search still looks across every inbox and environment.
  7. Notifications use the same filter, as they already did for the single inbox view, so a hidden inbox or environment also stays quiet.
  8. Saved per device in client settings: founderInboxFilter replaces founderInboxView, plus sidebarHiddenEnvironmentIds. Old saved settings still decode, and the old single choice isn't carried over. Environments are stored as hidden IDs, so a newly linked machine shows up by default.
  9. CI: the founder-inbox source guard now checks the new filter menu instead of the deleted SidebarInboxBar.tsx, and the new logic test runs in CI.

Differences from the proposed design

  • No Status section and no Sort. The sidebar already has Working/Snoozed sections, and Settled is already a collapsed, off-by-default section with a count. A second Status control would duplicate them.
  • No "Show child threads" toggle. Subagent and delegated children already nest under their parent and never list at top level. Counts skip them the same way.
  • No presets or saved views for now. With Reset to default and multi-select, "Mine + Agents" is the default and "Everything" is four checkboxes. Easy to add if it turns out to be missed.
  • No chip row under the search bar. Chips would bring back the row Kameron asked to remove. The dot, the accessible name and Reset do that job.
  • No URL sync. The filter is a per-device sidebar view. Putting it in the URL would change what someone sees when they open a shared thread link.
  • No "stalled" badge. The Thread hygiene lane is fixing stale Working runs at the source and asked for no client-side heuristic.
  • The new-thread owner is in Settings only, not in a split dropdown on the New thread button. It's a set-once preference.
  • The project filter stays its own button, next to the new one. It has search, pinning and per-project settings that wouldn't fit inside a checkbox menu.

Review round

One independent bot review (Claude Sonnet 5.5 via T3 delegation) at `74dd322422`: no blocking findings. A Codex attempt before it hit a rate limit and reviewed nothing. Fixed in `01d578e1ac`: an empty saved inbox choice no longer blanks the list (5); hidden machines that haven't loaded yet stay hidden (6); the last checked option says why it stays checked (8); `Founder.literals` (9).

Kept as designed:

  • The old single "Inbox" choice is not carried over (1). Kameron was stuck on "All threads", and the default should be his inbox plus Agents.
  • A hidden environment also stays quiet for notifications (2), the same way a hidden inbox already did.

Noted, not changed:

  • Reset stores the default as an explicit choice (3). Patches can't delete a key.
  • Unfiled history shows only when all four inboxes are checked (4). It has no checkbox of its own.
  • Counts recompute on streaming ticks while the menu is open (7). It's bounded and cheap.

Screenshots (dev server with demo data)

Default for Kameron: Kameron + Agents, with Jeff's and Shared threads hidden:

Default view

Jeff checked from the keyboard: Jeff's threads appear, the button gets a dot, and Reset to default shows:

Jeff added

Settings → Threads → Inbox:

Settings row

The demo server has only one environment, so these captures don't show the Environments section. Its filtering, counts and default rules are covered in threadListFilter.logic.test.ts.

Verification

  • vp test run on threadInbox.test.ts, threadListFilter.logic.test.ts, settingsSearch.test.ts, SettingsPanels.logic.test.ts, ThreadNotificationCoordinator.logic.test.ts, ThreadNotificationCoordinator.badge.browser.test.ts, Sidebar.logic.test.ts and Sidebar.browser.test.tsx: 8 files, 179 tests passed before the single-inbox fix. The two directly affected files were rerun after it and pass (17 tests).
  • Typecheck of @t3tools/contracts and @t3tools/web is clean, and format and lint pass on the changed files.
  • check:changed's knip step flags only the 4 upstream scripts that were already unused on this base, plus INBOX_CAPABILITY, which was already exported and unused.
  • In a real browser against isolated dev state: the menu is made of menuitemcheckbox items with names like "Kameron, 1 active" and aria-checked. Arrow keys and Enter toggle an item, and the menu stays open.

Coordinated with: Thread hygiene across the fleet (server-side stale-run reconcile and environment visibility), and the founder-inbox lane-semantics task, which edits founderInboxLane in the same file.

Opus 5.5 via Claude Code in T3 Code.

🤖 Generated with Claude Code

nullStack65 and others added 2 commits November 18, 2026 21:17
The sidebar's single-choice "Inbox" dropdown forced "All threads" to see a
founder's threads and agent threads together, and two rows of selects sat
between search and the list.

The sliders button next to Search now opens one menu with multi-select Inbox
(Kameron, Agents, Jeff, Shared) and Environments sections, live counts, a
connection dot, and "Reset to default". The default is the chosen founder plus
Agents. A dot on the button marks a non-default view. Search still looks across
every thread. The owner for new threads moves to Settings > Threads > Inbox.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lls in Jeff's and Shared threads

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nullStack65

Copy link
Copy Markdown
Owner Author

Independent bot review (Claude Sonnet 5.5 via T3 delegation), head 74dd322

No blocking findings. Static review plus vp test run threadListFilter.logic.test.ts threadInbox.test.ts (2 files, 17 tests, pass). I did not run a browser, so the keyboard and screen-reader notes come from reading the code, not from testing the menu.

What I checked and found correct:

  • primaryInbox (packages/contracts/src/threadInbox.ts): Shared is tested first, then the filed founder, then Agents. A thread has one assignee, so it can't match both founders, and each thread counts under exactly one inbox. A founder-filed thread whose origin is an agent counts under the founder, not Agents (covered by the test).
  • The legacy createdBy === "agent" fallback (threadListFilter.logic.ts:35-40) only applies when primaryInbox is null, so it can't pull in threads filed to Jeff or Shared. It is applied in the sidebar list, the notification coordinator and the counts, because all three go through matchesInboxes/matchesThreadListFilter.
  • Upgrade path: founderInboxView is no longer read by web, desktop, mobile or server code (only the old matchesInboxView helper and its tests remain). The Schema.Struct ignores the unknown key on decode, and the next encode drops it from the stored settings. The contracts test covers decode → encode → decode.
  • Selectors: useClientSettings compares with Equal.equals. I confirmed it is structural on nested arrays, so threadListFilterOf returning fresh {inboxes, hiddenEnvironmentIds} objects doesn't cause extra renders.
  • Counts: they are computed in SidebarThreadFilterOptions, which only mounts while the popup is open.
  • Trigger accessibility: the trigger's aria-label carries the active-filter summary, and the dot is aria-hidden. Each checkbox item's aria-label starts with its visible text, so label-in-name holds. ComboboxTrigger render={<SidebarHeaderIconButton/>} is an existing precedent for the render pattern.

should-fix

  1. packages/contracts/src/threadInbox.ts:140-146 (and threadInbox.test.ts) — Saved founderInboxView choices are silently discarded on upgrade. Scenario: a device with founderInboxOwner: "kameron" and founderInboxView: "all" (or "shared", or "jeff") decodes to the default [kameron, agents]. Jeff's and Shared threads disappear, and the trigger shows no "changed" dot because that is now the default. The test comment says this is deliberate, so I'm flagging it for confirmation. Fix: map the old key once on decode (all → every inbox, X → [X]), or accept the loss and say so in the PR description.
  2. ThreadNotificationCoordinator.tsx:117-123, 147-153 — The notification gate now also respects hiddenEnvironmentIds. Scenario: hiding an environment to declutter the list also silences "needs input" and approval notifications from it, with nothing in the menu saying so. The inbox part of this gate already existed, but environments are a new axis. Fix: confirm this is intended and say so in the menu or docs. Otherwise gate notifications on the inbox match only.

nit

  1. SidebarThreadFilterMenu.tsx:186-193 — "Reset to default" writes the default as an explicit choice (founderInboxFilter: effectiveInboxFilter({founderInboxOwner: owner})). The key can't be deleted through ClientSettingsPatch, so after Reset a later owner change in Settings no longer moves the filter, which contradicts the "whole-snapshot saves must not record a default as a choice" comment. With owner unset it stores all four. Fix: let a patch unset the key, or leave it unfixed and note it.
  2. threadInbox.ts:164-168, threadListFilter.logic.ts:83 — Unclassified threads (primaryInbox === null, which includes founder-assigned background threads) have no checkbox and no count. Unchecking any one inbox hides them with no hint, and the four inbox counts then don't add up to the list. Fix: a footer note such as "N unfiled shown only when every inbox is checked", or leave it and document it.
  3. packages/contracts/src/settings.ts:409-410 — founderInboxFilter: Schema.Array(InboxChoice) accepts [] and duplicates. A hand-edited or other-client [] gives a blank sidebar (Reset recovers it). Fix: Schema.NonEmptyArray or treat empty as unset in effectiveInboxFilter.
  4. SidebarThreadFilterMenu.tsx:157-161 — Toggling an environment rewrites sidebarHiddenEnvironmentIds from the currently known identities only. A hidden id for an environment that hasn't loaded yet (startup, offline remote) is dropped and that environment reappears. Fix: keep unknown ids, i.e. [...hidden.filter(id => !environmentIds.includes(id)), ...newlyHidden].
  5. Sidebar.tsx (countedThreads={() => …}) — The prop is a fresh closure on every Sidebar render, so while the menu is open the visible/settled filter and counts re-run on every streaming tick. It is bounded and cheap, so only a nit. Fix: pass the already-computed list, or useCallback.
  6. Accessibility — a checked item that is the last one left is disabled with no stated reason. Keyboard and screen-reader users can't tell why it won't uncheck, and the disabled item may be skipped by arrow-key navigation. Fix: add ", required" to its aria-label, or use aria-disabled and keep it focusable. The long dynamic trigger label is reused as the tooltip, so consider a shorter tooltip.
  7. threadListFilter.logic.ts:47-53 — inboxMenuOrder derives the founders by filtering InboxChoice.literals through a type guard. Founder.literals (a value import) is simpler.

Anti-overengineering: matchesInboxView and InboxView/"all" stay because primaryInbox builds on them, and the pure logic module with 4 test cases is reasonable. The part that is more than a minimal change is the faceted counts (threadListFilterCounts), the connected-dot indicator and the summary/reset machinery. For a two-founder fleet, a plain checkbox list without counts would be the smaller sufficient change. I'd keep it as is, since the counts are covered by tests and cost nothing while the menu is closed.

CI guard (closura-arc-ci.yml): It still protects the inbox. The threadInbox.ts needles (matchesInboxView, agent-only) are unchanged, and the two new files are checked for Kameron/Jeff/Agents/Environments and matchesInboxFilter/hiddenEnvironmentIds. All of these are present at this head. The new logic test is added to the test list. The weakness is that the checks are substring-only: matchesInboxFilter would pass on an import alone, and neither Sidebar.tsx nor the coordinator wiring is guarded. That was also true before, so no change is needed.

- An empty saved inbox choice falls back to the default instead of
  blanking the list.
- Toggling an environment keeps hidden ids of machines this client has
  not loaded yet, so an offline machine stays hidden.
- The last checked option says why it can't be unchecked.
- inboxMenuOrder uses Founder.literals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nullStack65
nullStack65 merged commit 417f8e8 into release/native-0.1.10 Nov 18, 2026
2 checks passed
nullStack65 added a commit that referenced this pull request Nov 18, 2026
…box-lanes

Conflict was only the threadInbox.test.ts import list. The sidebar's filter test
now files its agent threads to a founder with a reason, since under this PR an
agent's unreasoned filing stays in Agents; an assertion pins that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant