Skip to content

Sidebar date dividers, growing pinned section, and opt-in stale-session auto-archive - #70822

Merged
OutThisLife merged 6 commits into
mainfrom
bb/session-date-dividers
Jul 24, 2026
Merged

Sidebar date dividers, growing pinned section, and opt-in stale-session auto-archive#70822
OutThisLife merged 6 commits into
mainfrom
bb/session-date-dividers

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Summary

  • Date dividers in the sessions sidebar. The flat recents list and entered-project lanes group by recency: an unlabelled head of the newest run of sessions (cut at a real break in activity, mathematically sized toward the most recent handful), then one divider per coarse calendar range — Earlier today / Yesterday / Earlier this week / Last week / Earlier this month / month / month + year. Empty ranges are skipped, the first rendered group is never labelled, branch clusters never split, virtualized lists render dividers inline, and hand-ordered lists / pinned / project previews stay divider-free. The head cut only ever lands on a genuine pause (≥ 30 min gap inside a run chained by ≤ 8 h gaps), and a head that would merely top its own calendar group dissolves into it, so near-identical neighbours are never stranded across a divider. Verified by simulating the grouping against a real 840-session state.db, both the flat list and a sparse project lane.
  • Pinned section grows to fit. The pinned list was hard-capped at max-h-44 with an invisible scrollbar; it now grows up to half the viewport.
  • Opt-in auto-archive for stale sessions. New sessions.auto_archive / sessions.auto_archive_days config (off by default): soft-hide — never delete — sessions with no activity for N days, aging on last activity rather than creation. Sweeps are state_meta-throttled and fire from CLI startup, gateway startup + hourly housekeeping, and the serve/dashboard backend (opportunistic on session list + an hourly lifespan ticker). A new pinned column (declaratively migrated) exempts sessions; PATCH /api/sessions/{id} accepts pinned and flips the whole compression lineage as a unit. Desktop adds the settings toggle and transparently mirrors its localStorage sidebar pins to the backend flag so the sweep can never hide a pinned chat.

Test plan

  • Unit tests for the grouping math: head-run sizing, burst protection, midnight chaining, fuzzy dissolve, dedupe under non-monotonic order, started_at fallback (session-date-groups.test.ts, time.test.ts)
  • Pin-mirroring tests (session-pin-sync.test.ts); desktop suite for touched areas (899 tests), typecheck, eslint
  • Backend tests: set_session_pinned lineage propagation, archive_stale_sessions guards (pinned exemption, idempotence, compression tips), maybe_auto_archive throttling, PATCH pinned, config-gated sweep on GET /api/sessions (scripts/run_tests.sh tests/test_hermes_state.py tests/hermes_cli/test_web_server.py)
  • Manual: flat list and entered-project lane render sensible dividers against a large real session history

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 4cd4b3e

all good!

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery area/config Config system, migrations, profiles sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 24, 2026
Group the flat recents list and entered-project lanes by recency: an
unlabelled head of the newest run of sessions (cut at a real break in
activity, sized toward the most recent handful), then one divider per
coarse calendar range — Earlier today / Yesterday / Earlier this week /
Last week / Earlier this month / month / month + year. Empty ranges are
skipped, the first rendered group is never labelled, branch clusters
never split, and hand-ordered lists / pinned / project previews stay
divider-free.
The pinned list was hard-capped at max-h-44 with an invisible scrollbar;
cap it at half the viewport instead so every pin is visible.
New sessions.auto_archive / auto_archive_days config: soft-hide (never
delete) sessions with no activity for N days, aging on last activity
rather than creation so an old-but-active chat is spared. Sweeps are
throttled through state_meta and fire from CLI startup, gateway startup
+ hourly housekeeping, and the serve/dashboard backend (opportunistic
on session list + an hourly lifespan ticker), so every surface honours
one setting.

A new pinned column (declaratively migrated) exempts sessions from the
sweep; PATCH /api/sessions/{id} accepts pinned and flips the whole
compression lineage as a unit, mirroring set_session_archived.
Sessions settings gain an "Auto-archive stale chats" toggle with a
configurable idle threshold, persisted to sessions.* in config.yaml so
the backend sweep owns the policy. Sidebar pins (localStorage) are
mirrored to the backend pinned flag at boot and on every change —
pre-existing pins migrate transparently — so the sweep can never hide a
pinned chat.
…cape

The gateway startup maintenance block gained a maybe_auto_archive call in
the same provably-off-loop __init__ site as maybe_auto_prune_and_vacuum;
bump the reviewed sync-escape count from 3 to 4.
@OutThisLife
OutThisLife force-pushed the bb/session-date-dividers branch from d48c89f to 4cd4b3e Compare July 24, 2026 15:46
@OutThisLife
OutThisLife merged commit 951d606 into main Jul 24, 2026
47 checks passed
@OutThisLife
OutThisLife deleted the bb/session-date-dividers branch July 24, 2026 16:27
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…te-dividers

Sidebar date dividers, growing pinned section, and opt-in stale-session auto-archive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard comp/desktop Electron desktop app (apps/desktop/*) comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants