feat(sidebar): add show_kanban_sessions toggle to hide kanban worker sessions (#6780)

* feat(sidebar): add show_kanban_sessions toggle to hide kanban worker sessions

* fix(sidebar): kanban source-filter override + filtered-view cap (cron/webhook parity)

Gate re-review (Codex) found the kanban-hide addition missed cron/webhook
parity for the source-filter case:
- An explicit kanban source_filter now overrides the default hide (threaded
  source_filter into _dedupe_cli_sidebar_sessions_for_api, normalized with
  strip().lower() to match the loader), so a deliberate kanban view shows
  those rows even with the toggle off. Scoped to the matching source only.
- A dedicated KANBAN_PROJECT_CHIP_LIMIT bounds a filtered kanban-only view,
  mirroring CRON/WEBHOOK_PROJECT_CHIP_LIMIT.

Deliberately NOT changing the general exclude_sources: the original PR lets
kanban load on the source_filter=None path so the toggle-ON case works (the
hide is applied by _hide_from_default_sidebar only when the toggle is off).
Excluding kanban there would save the 20-row budget but break toggle-on
unless a bounded kanban merge is added (cron/webhook don't do that either) —
that query-budget optimization is deferred as a separate cross-cutting change.
The pinned-survives-hide finding is also out of scope (cron/webhook hide pinned
identically, confirmed by Codex). Adds bite-tested regressions.

Co-authored-by: vduke <vduke@users.noreply.github.com>

---------

Co-authored-by: nesquena-hermes <nesquena-hermes@users.noreply.github.com>
This commit is contained in:
Vincent Dukeandnesquena-hermes authored and GitHub committed 2026-08-09 02:53:25 +00:00
1 parent eb04bf5951
commit 64c2c12df7
9 files changed
+217 -3

No files matched your search

+2
View File
@@ -127,6 +127,7 @@ def _session_list_cache_key(
exclude_hidden: bool = False,
visible_only: bool = False,
show_webhook_sessions: bool = False,
show_kanban_sessions: bool = False,
source_filter: str | None = None,
sidebar_source: str | None = None,
archived_limit: int | None = None,
@@ -152,6 +153,7 @@ def _session_list_cache_key(
bool(exclude_hidden),
bool(visible_only),
bool(show_webhook_sessions),
bool(show_kanban_sessions),
source_filter,
sidebar_source,
normalized_archived_limit,