Repository navigation
feat(latest): show the last supporters of all streams in «Últimos» - #358
Merged
Merged
Conversation
«Ú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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 withSession#latestthroughlatestOf). 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./api/simulate) are markedsimulated: trueon the session event: they still count for the current stream but never for the record./api/testalerts were never recorded.latestAll;latestkeeps its per-stream meaning for every existing consumer (custom overlays, MCPver_widgets,/api/session).widgets.latest.scope:stream(default, unchanged behavior) orall; validated byPUT /api/widgetsand/api/config, accepted by MCPeditar_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
test/latest-history.test.mjs4/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).test/latest-history-browser.test.mjs(panel «Mostrar» savesall, 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.Session#latestrefactor: old vs new grouping over 2000 random event lists with every alert type, 0 differences.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