feat(archives): faction introduction-order markers in the Event Log (#157)#447
Merged
Conversation
…157) Surface WHEN each faction entered the war on the /archives timeline, as synthetic "<Faction> enter the war" markers interleaved chronologically with the event rows. Archives-only; the live dashboard is untouched. - buildIntroMarkers(data): pure helper → one marker per faction with a positive introduction_order slot AND a non-null first_seen; day math + article strip mirror buildWarNarrative; reduce-min war_start fallback; missing data → []. - EventLog: opt-in `introMarkers` prop (default []). When empty, output is byte-identical to today (HomeClient passes nothing) — a test asserts default- vs-empty render identical. Markers render via a faction-colored IntroMarker divider, keyed intro-${enemy}, excluded from the day W/L count. - ArchivesClient computes + passes the markers. Verified: lint, typecheck, test:unit (1518), build all pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Closes #157.
What
Surfaces when each faction entered the war on the
/archivesEvent Log — synthetic "<Faction> enter the war" markers interleaved chronologically with the event rows. Archives-only; the live dashboard is untouched. (The map-reveal half of #157 already works viacomputeMapStateAtEvent; this adds the timeline half.)How
buildIntroMarkers(data)— pure helper → one marker per faction with a positiveintroduction_orderslot and a non-nullfirst_seen. Day math + article-strip mirrorbuildWarNarrative; reduce-minwar_startfallback; missing data →[].EventLog— opt-inintroMarkersprop (default[]). Markers flow through the same day-group/sort path (taggedstart_time), render as a faction-coloredIntroMarkerdivider (--color-faction-*), keyedintro-${enemy}, excluded from the day W/L count.ArchivesClientcomputes + passes the markers.Live-dashboard safety (the key risk)
EventLoghas two call sites:HomeClient(live) andArchivesClient(archives). HomeClient passes nointroMarkers→ defaults to[]→rows = events ?? []and no row carries__intro, so grouping, outcome-counting, and rendering are all byte-identical to before. A newEventLogtest asserts default-vs-empty render produces identicalinnerHTML.Sample marker
Verification
✅ lint · typecheck · test:unit (1518, +16) · build — all pass (node 24). Reviewed: confirmed
FACTION_SLUG_BY_IDresolves and the 2 EventLog call sites keep the live view unaffected./archivesonce merged (or I can run a visual pass).ArchivesClient.jsxin nearby spots — trivial/auto-mergeable, but merge order may need a glance.🤖 Generated with Claude Code