WetherVane v5 ForecastHistoryChart#170
Open
HaydenHaines wants to merge 8 commits into
Open
Conversation
…t scores Exposes make_xt_impact_report() via a new FastAPI endpoint. Returns top race movers sorted by |delta_pp| with 1-hour module-level TTL cache. Includes ?races= and ?limit= query params. Adds 8 pytest tests (all passing). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Surface the GET /api/v1/forecast/xt-impact backend endpoint in the UI: - web/lib/api.ts: XtImpactMover + XtImpactResponse interfaces, fetchXtImpact() - web/app/api/forecast/xt-impact/route.ts: Next.js proxy (ISR 1h) forwarding to the Python backend - web/components/explore/XtImpactPanel.tsx: SWR client component rendering top-10 movers table (race, delta_pp, direction arrow) with 1h dedup interval - web/app/explore/types/page.tsx: lazy-load XtImpactPanel via dynamic import below the ScatterPlot section tsc --noEmit passes, npm run build exits 0. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
_xt_delta_from_polls already computed xt_race_counts but discarded it before returning. Now propagates through the full stack: - forecast_engine.py: include xt_race_counts in return dict - xt_impact.py: read xt_race_counts from cached report, attach n_xt_polls to each top_movers entry - api.ts: add n_xt_polls: number to XtImpactMover interface - XtImpactPanel.tsx: add Polls column rendering mover.n_xt_polls - test_forecast_engine.py: new TestXtRaceCounts unit test confirms xt_race_counts is present and correctly counts xt_ polls per race; update key-check test to include xt_race_counts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Surfaces the top 5 Senate races by cross-type poll impact delta on the landing page. New compact widget sits below the MiniMap and shows each race's name, a two-sided dem/rep delta bar, ±pp value, and a cross-type poll count badge. SWR-cached for 1 hour. tsc --noEmit passes clean. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a full Visx line chart showing dem margin over snapshot dates, replacing the inline sparkline in the Forecast History section of the race detail page. Chart includes axes, zero reference line, hover tooltip, loading/empty states, and is mounted above the polls section. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SC3: create web/app/api/forecast/race-history/route.ts proxying GET /api/v1/forecast/race-history to the Python backend (pattern mirrors xt-impact/route.ts). SC4: add typecheck (tsc --noEmit) and lint (eslint . --max-warnings=29) scripts to web/package.json; --max-warnings=29 baselines 29 pre-existing warnings so new regressions will break CI while legacy debt is visible. Closes T2 gate failures on feat/wethervane-v5-forecast-history-chart.
Resolved all 29 existing ESLint warnings (unused vars/imports, stale eslint-disable directives, react-hooks/exhaustive-deps, and ARIA combobox missing aria-controls). Lowered --max-warnings from 29 to 0 so any future warning immediately fails CI. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… page Import useRaceHistory hook and pass historyBySlug to all three RaceCardGrid instances (competitive, D-leaning, R-leaning) to match the senate overview pattern. No backend changes -- /forecast/race-history already returns all races. Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
QA
Agentic-box EPIC closed in commit 3baa744.