Skip to content

Investigate: session activity ratchet stored only in localStorage, not server-side #204

@danshapiro

Description

@danshapiro

Opportunity

sessionActivitySlice.ts maintains Record<string, number> mapping session keys to lastInputAt timestamps, stored in localStorage. This powers the activity-based sidebar sort mode. However, this data is entirely per-browser-tab — on multi-device or fresh-browser use, the sidebar shows stale ordering.

The server already has the signal: it processes every terminal.input and codingcli.event WebSocket message. It could maintain authoritative activity timestamps.

Analysis

Medium impact, medium complexity. The server would need a small in-memory map of session-key to last-activity-timestamp, updated on terminal.input and codingcli.event messages. The session directory read model could include server-authoritative activity timestamps, allowing the client to drop the localStorage-based ratchet.

This would make activity-based sort work correctly across devices and browser sessions.

Action

Investigate and validate this opportunity. Determine the right implementation approach following TDD.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions