Skip to content

feat(archives): faction introduction-order markers in the Event Log (#157)#447

Merged
elfensky merged 1 commit into
developfrom
feature/faction-intro-viz
Jun 28, 2026
Merged

feat(archives): faction introduction-order markers in the Event Log (#157)#447
elfensky merged 1 commit into
developfrom
feature/faction-intro-viz

Conversation

@elfensky

Copy link
Copy Markdown
Owner

Closes #157.

What

Surfaces when each faction entered the war on the /archives Event 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 via computeMapStateAtEvent; this adds the timeline half.)

How

  • 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 []). Markers flow through the same day-group/sort path (tagged start_time), render as a faction-colored IntroMarker divider (--color-faction-*), keyed intro-${enemy}, excluded from the day W/L count.
  • ArchivesClient computes + passes the markers.

Live-dashboard safety (the key risk)

EventLog has two call sites: HomeClient (live) and ArchivesClient (archives). HomeClient passes no introMarkers → defaults to []rows = events ?? [] and no row carries __intro, so grouping, outcome-counting, and rendering are all byte-identical to before. A new EventLog test asserts default-vs-empty render produces identical innerHTML.

Sample marker

<div class="event-log-intro" style="--intro-color:var(--color-faction-illuminate)">
  <span class="event-log-intro-day">Day 4</span>
  <span class="event-log-intro-label">Illuminate enter the war</span>
</div>

Verification

✅ lint · typecheck · test:unit (1518, +16) · build — all pass (node 24). Reviewed: confirmed FACTION_SLUG_BY_ID resolves and the 2 EventLog call sites keep the live view unaffected.

⚠️ Hold before merge

🤖 Generated with Claude Code

…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>
@elfensky elfensky merged commit fb81da6 into develop Jun 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant