Admin: History loads one stretch of a day at a time, picked on a day chart #110

Closed
opened 2026-11-07 23:48:59 -05:00 by cmoriarty · 2 comments
Owner

Part of #103. On the mockup canvas, Picked column: History · 9C.

What happens

The owner wants to keep History, but:

  • the coloured dots seem arbitrary;
  • the list seems to grow without end;
  • it should load lazily, or otherwise limit how many events it shows, so memory doesn't become a problem.

Today:

  • On the page: the newest 200 events, fetched every 10 s, one sentence each.
  • On the server: the latest 2,000 in memory and in events.jsonl (KEEP in backend/app/events.py). That is 3 to 4 days at 400–780 events a day, and less on a busy night.

The idea

  1. A day switch: the last 3 days.

  2. A chart of the day's events in 15-minute bins, coloured by meaning:

    • routine (dim);
    • found (green);
    • handled by the app (amber);
    • needs you (red).
  3. A window on the chart with drag handles; by default the last 45 minutes. Only the window's events load below it, 50 at a time, with "N more".

  4. Routine re-checks are hidden until their legend toggle is turned on. The legend's other entries filter too.

  5. Each event as UI, not a sentence:

    • a swap or recovery: site → site;
    • a found stream: + site, then backup or standby;
    • a held-back site: a clock and how long;
    • a guide refresh: a refresh icon;
    • a closed channel: a TV icon and the swap count.

    The full sentence shows on hover.

  6. The page holds only the window it shows.

Data it needs

  • Keep events by age (3 days), not by count. The deque stays bounded, or a window is read from the file, so memory doesn't grow with a busy night.
  • GET /api/events?since=&until=&limit=&after= for a window, with a cursor for "more".
  • A histogram endpoint: a day's 15-minute bins, counted per meaning.
  • Each event carries:
    • its meaning (routine, found, handled, needs you), decided on the server;
    • the structured fields the chips need: from host, to host, duration, role. The check events already carry the links they tried.

Done when

  • In the unit lane:
    • a window query returns only that span;
    • the histogram's bins add up to the day's events;
    • events older than 3 days are dropped;
    • memory stays bounded at a busy day's rate.
  • In the frontend tests:
    • the page renders a window's events from a fixture;
    • "more" loads the next page;
    • moving the window replaces the list instead of adding to it.
Part of #103. On the [mockup canvas](https://claude.ai/artifact/81TFkGA3agPRSmkL38L4yJ), Picked column: **History · 9C**. ## What happens The owner wants to keep History, but: - the coloured dots seem arbitrary; - the list seems to grow without end; - it should load lazily, or otherwise limit how many events it shows, so memory doesn't become a problem. Today: - **On the page:** the newest 200 events, fetched every 10 s, one sentence each. - **On the server:** the latest 2,000 in memory and in `events.jsonl` (`KEEP` in `backend/app/events.py`). That is 3 to 4 days at 400–780 events a day, and less on a busy night. ## The idea 1. **A day switch:** the last 3 days. 2. **A chart of the day's events** in 15-minute bins, coloured by meaning: - routine (dim); - found (green); - handled by the app (amber); - needs you (red). 3. **A window on the chart** with drag handles; by default the last 45 minutes. Only the window's events load below it, 50 at a time, with "N more". 4. **Routine re-checks are hidden** until their legend toggle is turned on. The legend's other entries filter too. 5. **Each event as UI, not a sentence:** - a swap or recovery: site → site; - a found stream: + site, then backup or standby; - a held-back site: a clock and how long; - a guide refresh: a refresh icon; - a closed channel: a TV icon and the swap count. The full sentence shows on hover. 6. **The page holds only the window** it shows. ## Data it needs - **Keep events by age (3 days), not by count.** The deque stays bounded, or a window is read from the file, so memory doesn't grow with a busy night. - **`GET /api/events?since=&until=&limit=&after=`** for a window, with a cursor for "more". - **A histogram endpoint:** a day's 15-minute bins, counted per meaning. - **Each event carries:** - its meaning (routine, found, handled, needs you), decided on the server; - the structured fields the chips need: from host, to host, duration, role. The check events already carry the links they tried. ## Done when - **In the unit lane:** - a window query returns only that span; - the histogram's bins add up to the day's events; - events older than 3 days are dropped; - memory stays bounded at a busy day's rate. - **In the frontend tests:** - the page renders a window's events from a fixture; - "more" loads the next page; - moving the window replaces the list instead of adding to it.
Author
Owner

Deployed 2026-11-08 06:11Z in PR #111 (merge a133e29, container 71367c5163eb); OpenSpec change archived in b4d5b94. Live now: the log keeps 3 days by age; History shows the day's events as a chart with a draggable window (default the last 45 min), loads only that window 50 at a time, shows events as chips, and offers newer events as a count. Swaps and recoveries now record the hosts they left and landed on. Left open for a look at a busy night's window.

Deployed 2026-11-08 06:11Z in PR #111 (merge a133e29, container 71367c5163eb); OpenSpec change archived in b4d5b94. Live now: the log keeps 3 days by age; History shows the day's events as a chart with a draggable window (default the last 45 min), loads only that window 50 at a time, shows events as chips, and offers newer events as a count. Swaps and recoveries now record the hosts they left and landed on. Left open for a look at a busy night's window.
Author
Owner

Closed at the owner's word (2026-11-08): the fix is merged to develop in PR #111 (merge a133e29) and deployed. A new issue will be opened if a problem shows up.

Closed at the owner's word (2026-11-08): the fix is merged to develop in PR #111 (merge a133e29) and deployed. A new issue will be opened if a problem shows up.
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/sports-breaker#110
No description provided.