Exposes the scoped (project, branch) filter everywhere sessions are
browsed: --branch flags on session list, session search, and activity
report (rejected without --project, since a branch name only identifies
work within a project); git_branch parameters on the MCP tools; and a
Branch section in the web sidebar filter with multi-select, search,
selected entries floated to the top, removable chips, a numeric
active-filter badge on the filter button, and URL round-trip. The
sidebar selection also drives the Analytics dashboard, and the usage
endpoints receive the same session-scoped branch filter.
Branch filters travel as opaque (project, branch) tokens because the
shared filter field carries multiple pairs and project or branch names
can contain commas; CLI and MCP accept two plain parameters and encode
internally, so callers never see the token format. Branch metadata is
ordered by most recent session activity so pickers surface current
work first, and cmd/testfixture seeds git branches so e2e suites and
screenshots exercise the branch surfaces with synthetic data.
Adds branch filtering to the session-browsing surfaces. The CLI accepts
--branchonsession list,session search, andactivity report; each requires--projectbecause branch names are project-scoped. MCP tools accept the same human inputs: a plainprojectplus a plaingit_branch. Both surfaces encode the internal(project, branch)token at the edge, so callers never need to see or construct token separators.On the web, the shared sidebar filter gets a Branch section with multi-select, client-side search, selected branches floated to the top, removable chips, a numeric active-filter badge, and URL round-trip. The same selection flows into Analytics and usage filtering.
Branch metadata now sorts by most recent session activity in SQLite, PostgreSQL, and DuckDB, with project and branch tiebreakers for deterministic lists.
cmd/testfixtureseeds synthetic branch data so screenshots and e2e fixtures exercise the branch surfaces.Known limitation: branch filters still travel as an uncapped token list, matching the existing CSV-style filters rather than adding a separate cap in this PR.
Part of #928; parallel to the activity-rollups and usage-grouping PRs.