Skip to content

Restore v2 dashboard with burn-up chart and policy area pages#166

Open
xrendan wants to merge 26 commits intomainfrom
v2-dashboard-restore
Open

Restore v2 dashboard with burn-up chart and policy area pages#166
xrendan wants to merge 26 commits intomainfrom
v2-dashboard-restore

Conversation

@xrendan
Copy link
Member

@xrendan xrendan commented Mar 10, 2026

Summary

  • Restores the v2 dashboard pages that were lost when the repo was re-cloned
  • Adds burn-up chart, waffle grid, metric cards, policy area cards on the overview page
  • Adds explore page with search, filters, sorting, pagination
  • Adds commitment detail page with timeline, drift, criteria, sources
  • Adds policy area detail pages with scoped burn-up charts
  • Adds API proxy rewrite for the burndown endpoint
  • Removes superseded status references (no longer in API)

Files

  • app/v2/layout.tsx — Nav tabs (Overview / Explore)
  • app/v2/page.tsx — Homepage overview
  • app/v2/commitments/page.tsx — Explore page
  • app/v2/commitments/[id]/page.tsx — Commitment detail
  • app/v2/policy-areas/[slug]/page.tsx — Policy area detail
  • lib/commitment-types.ts — TypeScript types
  • next.config.mjs — Added burndown API rewrite

Test plan

  • Visit /tracker/v2 and verify metric cards, waffle grid, burn-up chart, and policy area cards load
  • Click a policy area card and verify scoped burn-up chart loads
  • Navigate to Explore tab and verify search/filter/pagination
  • Click a commitment and verify detail page loads

🤖 Generated with Claude Code

xrendan and others added 2 commits March 10, 2026 15:05
New v2 UI with metric cards (Not Started, Completed, Started),
burn-up chart showing scope/started/completed over mandate period,
waffle grid, and per-policy-area drill-down pages. Scope line
extends to end of mandate. Proxies API burndown route.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The superseded_by/supersedes fields were removed from the API.
Drop references from status maps, labels, colors, and the detail page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jean-guy-batisseur
Copy link

jean-guy-batisseur bot commented Mar 10, 2026

The preview deployment for Outcomes Tracker NextJS failed. 🔴

Open Build Logs

Last updated at: 2026-03-24 23:52:41 CET

…il UI

Success criteria are hidden from the UI. The partially_met visual state
(half-filled checkbox, badge) is removed since the status no longer exists.
Progress and completion criteria now stack vertically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@xrendan xrendan force-pushed the v2-dashboard-restore branch from 64cfd7e to 7c72b0d Compare March 11, 2026 05:02
The chart samples data at fixed weekly intervals, but when the latest
API data point falls between two weekly samples, it's never plotted.
Add today as an explicit sample point so current values are always visible.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@xrendan xrendan force-pushed the v2-dashboard-restore branch from 7c72b0d to 1f1c8c8 Compare March 11, 2026 05:10
xrendan and others added 22 commits March 11, 2026 18:07
Adds /v2/feed with event type filtering, date range selection,
timeline UI, and pagination. Adds Feed nav link and FeedItem types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace policy area bar charts with interactive waffle grids linking
to individual commitments. Remove standalone waffle grid section.
Regenerate pnpm-lock.yaml to include chartjs-adapter-date-fns and
date-fns dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t component

Adds ministry detail page with slug routing, extracts ChartLine component,
moves dashboard logic to HomePageClient for client-side rendering, and
updates commitment types and Next.js config.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tion on commitment detail

- Add Platform tab filtering commitments by election platform source
- Reorder metric cards: Not Started, In Progress, Completed, Abandoned (2x2 mobile)
- Unify status colours across UI: gray (not started), amber (in progress), #8b2332 (completed), black (abandoned)
- Show waffle charts with completed/in-progress first, abandoned last
- Add SourceAttribution component showing linked sources on activities, status changes, and timeline
- Pass source_type filter through Explore page query params
- Refactor overview and detail pages to server components where applicable

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fixes static generation build error: useSearchParams() requires a
Suspense boundary during prerendering.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e prerender

- Add force-dynamic to server-component pages (v2, ministries, policy-areas)
  to prevent static generation which fails without API access at build time
- Add pages/_error.tsx to fix useRef prerender crash from client components
  in root layout during internal error page static generation
- Add not-found.tsx and global-error.tsx for App Router error handling
- Lazy-load Toaster to avoid SSR issues

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The API is not available at Docker build time, so fetchApi must use
cache: "no-store" instead of revalidate to opt pages into dynamic
rendering.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
NEXT_PUBLIC_API_URL is baked in at build time and unavailable to
server components at runtime. Fall back through API_URL first.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cache: no-store was causing every page load to make 4 fresh API calls.
Restore revalidate: 300 (5 min) — the page is already dynamic due to
runtime env var reads so this won't trigger build-time fetching.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace emoji favicon with Build Canada square logo
- Add Build Canada logo alongside Outcomes Tracker title in sidebar
- Add Carney quote with attribution and photo on homepage
- Update FAQ to standalone page at /v2/faq with updated content
- Add responsive metric cards (compact for mobile, large for desktop)
- Remove border/padding on mobile for more space
- Move commitment count below ministry name on mobile
- Hide Feed and Platform nav tabs
- Various copy updates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Requires entering a password to view the site. Cookie expires at 6am MT daily.
Unauthenticated visitors are redirected to /tracker/password.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds new top-level routes (commitments, ministries, policy-areas, faq, feed, platform),
TrackerNav component, and updated homepage. Removes old [department] and v2/ routes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Show linked evidence source on each recent activity feed item
- Add source type badges, section/reference pills, and "Added" date to source cards
- Display relevance notes when available
- Show source type badge in activity timeline for source items

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move Criteria Assessment card to second position (after header)
- Hide criterion assessed events from Activity Timeline
- Add client-side pagination (10 items) to Activity Timeline
- Hide Sources and Recent Activity cards

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Generates per-page Open Graph images using next/og:
- Main tracker page shows Carney's photo + full waffle chart of all commitments coloured by status + Build Canada logo
- Ministry pages show minister's photo + their commitments waffle + status legend + Build Canada logo

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Social crawlers don't have auth cookies so opengraph-image routes
were being redirected to the password page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The tracker is now publicly accessible. Simplified middleware to a no-op
and removed the auth cookie check from RootLayout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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