Skip to content

feat: session source filter in Settings (checkbox-style)#74

Merged
rusty4444 merged 1 commit into
rusty4444:mainfrom
louquillio:feat/session-source-filter
Jul 17, 2026
Merged

feat: session source filter in Settings (checkbox-style)#74
rusty4444 merged 1 commit into
rusty4444:mainfrom
louquillio:feat/session-source-filter

Conversation

@louquillio

@louquillio louquillio commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Problem

The Android session list shows all Hermes sessions including scheduled tasks and developer tool calls, making it noisy for mobile users who only want their chat conversations.

Solution

Checkbox-style source filter in Settings. Each session origin type gets a checkbox (checked = visible). Unchecked sources are filtered client-side from the fetched session list by Session.source — no backend API changes needed.

Changes

2 files, +98/-2:

  • lib/core/screens/settings_screen.dart — New _SessionSourcesFilter widget with 14 known source types, each with a plain-English label. Lives in a "Session Sources" section below Voice, above Connection. Preference key is scoped by connection ID so multi-gateway users don't bleed settings.
  • lib/core/screens/session_list_screen.dart — After fetching sessions, reads the excluded list from SharedPreferences and filters client-side. Re-reads prefs on every refresh so changes from Settings take effect immediately.

connection_manager.dart intentionally unchanged — filtering is entirely client-side.

Design

  • Checked = visible — intuitive semantics
  • Empty default = show everything (backward compatible)
  • Connection-scoped keyexcluded_session_sources_<connection.id>
  • Unknown sources whitelisted — not in the known list = always shown
  • Plain-English labels — "Scheduled tasks", "Signal messages", "Phone or tablet" — not internal source keys
  • Same SharedPreferences pattern as existing _VerboseToggle and _ThemeToggle

Sources covered

acp (Autonomous agents), api_server, cli, cron (Scheduled tasks), desktop, discord, gateway, mobile, signal, slack, telegram, tool, tui, whatsapp

@louquillio
louquillio force-pushed the feat/session-source-filter branch from 3e004d6 to 97648f0 Compare July 17, 2026 02:59

@rusty4444 rusty4444 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Changes Requested 🔴 (1 blocking issue, 1 suggestion)

PR: #74 — feat: session source filter in Settings (checkbox-style)
Author: @louquillio
Files changed: 3 (+97 -4)

🔴 Critical

  • lib/core/services/connection_manager.dart:143-149 — The new client sends GET /api/sessions?exclude_source=..., but the current Hermes Gateway /api/sessions handler only reads source, limit, offset, and include_children; it does not implement exclude_source. As written, the Settings checkboxes are persisted locally but the session list response will be unchanged, so the feature appears to work in UI state while filtering nothing. Please either add/ship matching gateway API support for exclude_source or filter client-side from the returned Session.source values until the backend supports it.

💡 Suggestions

  • lib/core/services/connection_manager.dart:143-149 — Build the request with Uri query helpers rather than string concatenation, especially if multiple source values will be sent. That avoids future encoding issues and makes the API contract explicit (comma-separated value vs repeated exclude_source params).
  • lib/core/screens/settings_screen.dart:738 / session_list_screen.dart:56 — Consider scoping the persisted preference key by connection/profile if users can connect this app to multiple Hermes gateways; a global excluded_session_sources setting may bleed one backend's preferences into another.

✅ Looks Good

  • The UI defaults to showing all sources, preserving backwards-compatible behavior until the user changes settings.
  • flutter pub get completed, and flutter analyze --no-pub lib/core/screens/session_list_screen.dart lib/core/screens/settings_screen.dart lib/core/services/connection_manager.dart reported no issues.

Reviewed by Hermes Agent

The Android session list shows all Hermes sessions including scheduled tasks
and tool calls, making it noisy for mobile users who only want chat sessions.

Add a checkbox-style source filter in Settings. Each session origin type gets
a checkbox in plain English ("Scheduled tasks", "Signal messages", etc.):
unchecked sources are filtered client-side by Session.source.

Key design choices:
- Client-side filtering (no backend API dependency)
- Preference key scoped by connection ID (multi-gateway safe)
- Unknown source types always shown
- All sources shown by default (backward compatible)
@louquillio
louquillio force-pushed the feat/session-source-filter branch from 97648f0 to c6d4130 Compare July 17, 2026 18:47
@louquillio

Copy link
Copy Markdown
Contributor Author

All three review items addressed in the force-push:

🔴 Critical — Backend exclude_source not supported → Switched to client-side filtering. connection_manager.dart is now untouched (fully reverted). The session list filters by Session.source in _fetchSessions() after fetching.

💡 Uri query helpers → No longer relevant since filtering is client-side — no URL params needed.

💡 Connection-scoped pref key → Implemented. Both the settings reader/writer and the session list filter use excluded_session_sources_<connection.id> as the SharedPreferences key.

New diff: +98/-2, 2 files (connection_manager.dart unchanged).

@rusty4444 rusty4444 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved ✅

The updated implementation addresses the prior blocking review item by keeping filtering fully client-side and leaving connection_manager.dart unchanged.

Checked

  • SessionListScreen._fetchSessions() fetches all sessions, reloads the connection-scoped excluded source preference on each refresh, and filters by Session.source locally.
  • SettingsScreen stores checkbox state under excluded_session_sources_<connection.id>, preventing cross-gateway preference bleed.
  • Unknown sources remain visible by default because only sources present in the excluded list are filtered.
  • Existing Hermes UI structure is preserved; this is a small surgical settings/session-list change.

Validation

  • flutter pub get
  • flutter analyze --fatal-infos ✅ — no issues
  • flutter test --reporter=expanded ✅ — 39 tests passed
  • flutter build apk --release --split-per-abi ✅ — built armeabi-v7a, arm64-v8a, and x86_64 APKs

Warnings observed are existing dependency/tooling warnings only: discontinued flutter_markdown, future Swift Package Manager/Kotlin Gradle Plugin notices.


Reviewed by Hermes Agent

@rusty4444
rusty4444 merged commit 15b0b71 into rusty4444:main Jul 17, 2026
rusty4444 added a commit that referenced this pull request Jul 17, 2026
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.

2 participants