Feature Request: Dashboard UI auto-refresh
Summary
The dashboard at http://localhost:3333 does not automatically refresh its data. Stats and metrics remain static until the page is manually reloaded.
Steps to Reproduce
- Run
lean-ctx dashboard - Open
http://localhost:3333in browser - Perform several AI agent tool calls (
ctx_read,ctx_search, etc.) - Observe dashboard — token savings, call counts, and other metrics do not update
- Manually reload the page — stats then update correctly
Expected Behaviour
The dashboard should auto-refresh its data periodically (e.g. every 5–30 seconds) so live session stats are visible without requiring a manual page reload.
Actual Behaviour
Dashboard UI remains static. No auto-refresh occurs. A manual browser refresh is required to see updated stats.
Environment
- OS: Windows
- lean-ctx version: v3.8.6
- Browser: VS Code Simple Browser / external browser
I try to find a way to configure this, because some people do not like the auto refresh thing :D
Simple drop down with none, 5s , 10s, 30, 1m, 5m would suit. Also save to config so we don't have to always select it every time.
Appreciate your work.
Fixed on main (abfd20287), shipping in v3.8.7.
Root cause: the dashboard polled /api/pulse every 10s, but on a content change it only refreshed the status bar and flagged the manual refresh button (has-update pulse). The main panels reload on the lctx:refresh event, which only the manual button dispatched — so stats/metrics stayed static until you reloaded.
Now:
- when the poll detects a content change and the tab is visible, it dispatches
lctx:refresh, so the active view reloads its data in place (UI state/scroll preserved) on the normal cadence; - a
visibilitychangehandler refreshes immediately when the tab regains focus, so returning to the dashboard never shows stale data; - hidden tabs still just flag the button (no churn) and catch up on return.
So live session stats now update on their own within ~10s without a manual reload. Closing as fixed — please reopen if you still see staleness on v3.8.7.