Files
scarf/scarf
Alan Wizemann 1174c5abc7 feat(mac-sessions): project filter + badges (v2.5 parity with iOS)
The Mac global Sessions feature rendered all sessions with no project
context. ScarfGo's new Sessions tab added a project filter Menu and
badge chips on each row in v2.5 — bring the same to Mac so v2.5 lands
as a user-visible upgrade on both platforms, not just iOS.

Changes:

- `SessionsViewModel`: load `~/.hermes/scarf/session_project_map.json`
  + the project registry off the main actor (single batched read,
  matches the iOS Dashboard pattern). Exposes `sessionProjectNames`,
  `allProjects`, `projectFilter`, `filteredSessions`, and
  `projectName(for:)`.
- `SessionsView`: filter bar above the list (shown only when at least
  one project is registered) with a Menu listing "All projects",
  "Unattributed", and each registered project. An xmark button clears
  the filter. The right side shows "X of Y shown" so the filter's
  effect is obvious.
- `SessionRow` (shared with Dashboard): gains an optional
  `projectName: String?` parameter that renders a tinted folder chip
  alongside the relative date when set.

Both services already lived in ScarfCore (moved there in v2.5's iOS
work), so this is pure UI consumption — no new shared logic.

Verified: Mac build succeeds.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 07:54:34 +02:00
..