Skip to content

feat(latest): show the last supporters of all streams in «Últimos» - #358

Merged
egdev6 merged 1 commit into
mainfrom
feat/latest-history
Nov 25, 2026
Merged

egdev6 merged 1 commit into
mainfrom
feat/latest-history

Conversation

@egdev6

@egdev6 egdev6 commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Summary

«Últimos» only read the current session, so every stream started with empty cards (automatic session from Meld/OBS is on by default). This adds an optional historical view.

  • src/latest-history.mjs: a record apart from sessions (latest-history.json) with the last supporter of each «Últimos» type (same grouping, now shared with Session#latest through latestOf). Updated with every real event, never cleared at stream start, survives restarts, rebuilt once from the archived and current streams when missing, merged with imported streams after a config import.
  • Simulated alerts (/api/simulate) are marked simulated: true on the session event: they still count for the current stream but never for the record. /api/test alerts were never recorded.
  • Widget state gains latestAll; latest keeps its per-stream meaning for every existing consumer (custom overlays, MCP ver_widgets, /api/session).
  • widgets.latest.scope: stream (default, unchanged behavior) or all; validated by PUT /api/widgets and /api/config, accepted by MCP editar_widget, chosen in the panel «Últimos» page with Mostrar («Este directo» / «Histórico»). READMEs updated.

Known limitations: simulated events archived before this change carry no mark, so the first backfill cannot tell them apart. Antena has no event or stream deletion today, so the issue's "deletions correct the record" has nothing to hook into.

Validation

  • RED first for the server: test/latest-history.test.mjs 4/4 failed, then 4/4 pass (record across streams and restarts, simulated excluded, backfill from archives newest first, scope default/accept/reject keeps the saved value).
  • Browser: test/latest-history-browser.test.mjs (panel «Mostrar» saves all, the widget switches between «—» and the historical supporter and back). Written after the UI change; retro-RED confirmed by reverting the widget and panel files.
  • Differential check of the shared Session#latest refactor: old vs new grouping over 2000 random event lists with every alert type, 0 differences.
  • Typecheck 0. Full suite 3404 tests: 3400 pass, 2 skipped, 2 failed only under full-suite load (scheduled-streams-browser, widget-slot-mode), both pass in isolation (3/3). The typecheck error found in that run (select value type) is fixed; the latest panel and history browser tests pass after it.

Risk: none. Additive state field and opt-in option; the shared grouping refactor is differential-checked.

Linked issue

Closes #357

«Últimos» only read the current session, so every stream started with
empty cards. A separate record (latest-history.json) now keeps the last
supporter of each type across streams and restarts: it is updated with
every real event, rebuilt once from the archived streams when missing,
and merged with imported streams. Simulated alerts are marked on the
session event and never enter it.

The widget state gains latestAll; latest keeps its per-stream meaning
for every existing consumer. New widgets.latest.scope ('stream' by
default, or 'all'), validated by the widgets API, accepted by MCP
editar_widget and chosen in the panel with «Mostrar» («Este directo» /
«Histórico»). READMEs describe the option.

Closes #357
@egdev6 egdev6 added the type:feature New feature or enhancement label Nov 25, 2026
@egdev6
egdev6 merged commit 1d193a4 into main Nov 25, 2026
5 checks passed
@egdev6
egdev6 deleted the feat/latest-history branch November 25, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(latest): option to show the last supporters of all streams, not only the current one

1 participant