-
Notifications
You must be signed in to change notification settings - Fork 16
Description
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.