Skip to content

Conversation

@xrendan
Copy link
Member

@xrendan xrendan commented Feb 1, 2026

Summary

  • Add new route structure for First Nations bands with searchable index, band overview pages, and year-specific financial data views
  • Create Supabase REST API client with ISR caching (1 hour revalidation)
  • Display Statement of Operations as interactive Sankey diagram
  • Show Statement of Financial Position as stats grid (assets, liabilities, net assets)
  • Present Remuneration data in sortable table with dynamic columns
  • Include Notes section with accordion display
  • Handle edge cases for bands without fiscal year data (shows "no data available" page)
  • Add First Nations link to desktop and mobile navigation menus
  • Add i18n translation keys for all new content

Test plan

  • Navigate to /en/first-nations and verify band list loads with search functionality
  • Search for a band name and verify filtering works
  • Click a band with data and verify redirect to latest year
  • Verify Sankey diagram displays Statement of Operations correctly
  • Verify Financial Position stats show assets, liabilities, net assets
  • Verify Remuneration table displays with correct columns
  • Test year selector to switch between available fiscal years
  • Navigate to a band without data (e.g., /en/first-nations/ISC_490) and verify "no data" page displays
  • Test French locale (/fr/first-nations)
  • Verify navigation links work in desktop and mobile menus

🤖 Generated with Claude Code

- Create new route structure for First Nations bands:
  - /first-nations/ - Index with searchable band list
  - /first-nations/[bcid]/ - Band overview (redirects to latest year)
  - /first-nations/[bcid]/[year]/ - Year-specific financial data

- Add Supabase REST API client with ISR caching (1 hour revalidation)

- Display financial data:
  - Statement of Operations as Sankey diagram
  - Statement of Financial Position stats grid
  - Remuneration table with dynamic columns
  - Notes section accordion

- Handle edge cases for bands without fiscal year data

- Add First Nations link to navigation (desktop and mobile)

- Add i18n translation keys for new content

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@build-canada-deploy-bot
Copy link

build-canada-deploy-bot bot commented Feb 1, 2026

Dokploy Preview Deployment

Name Status Preview Updated (UTC)
nextjs ✅ Done Preview URL 2026-02-03T21:51:23.860Z

- Add configurable amountScalingFactor prop to SankeyChart and JurisdictionSankey
- Default to 1e9 (billions) for backwards compatibility with federal/provincial data
- Use amountScalingFactor={1} for First Nations data which is in raw dollars

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@xrendan xrendan force-pushed the first-nations-pages branch from 743e037 to ac22bdb Compare February 1, 2026 19:44
@xrendan
Copy link
Member Author

xrendan commented Feb 1, 2026

@claude fix the build.

#21 62.50 Export encountered an error on /[lang]/(main)/first-nations/[bcid]/[year]/page: /en/first-nations/ISC_602/2018, exiting the build.
#21 62.54 Error occurred prerendering page "/en/first-nations/ISC_406/2015". Read more: https://nextjs.org/docs/messages/prerender-error
#21 62.54 TypeError: Cannot read properties of null (reading 'actual_2015')
#21 62.54 at m (.next/server/chunks/495.js:1:267)
#21 62.54 at (.next/server/chunks/495.js:1:2030)
#21 62.54 at Array.map ()
#21 62.54 at (.next/server/chunks/495.js:1:2012)
#21 62.54 at q (.next/server/chunks/495.js:1:2606) {
#21 62.54 digest: '749805600'
#21 62.54 }
#21 62.54 Export encountered an error on /[lang]/(main)/first-nations/[bcid]/[year]/page: /en/first-nations/ISC_406/2015, exiting the build.

xrendan and others added 16 commits February 2, 2026 07:36
Add null check in getActualValue() to handle line items where
the values object is null, preventing TypeError during SSG.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add document icon next to section titles that toggles inline PDF viewer
- PDFs display inline filling window width when icon is clicked
- Custom tooltip shows immediately on hover with document type
- Statement of Operations and Financial Position use extraction_metadata.source_file
- Remuneration uses URL pattern: cdn.canadaspends.com/financial_statements/{bcid}/{year}/source/remuneration.pdf
- Add "Download Full Financial Report" link at bottom (opens in new tab)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Display historical and ongoing land claims for each First Nation band,
including claim status, key dates timeline, settlement amounts, and
tribunal awards. Claims data fetched from the Supabase API.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Sankey diagram was showing ~$10M higher totals than financial
statements because d3's hierarchy().sum() adds root amount to children's
sum. Fixed by:

- Set root amount to 0 so displayed total equals children's sum
- Show net deferred revenue as a single item instead of hiding it:
  - If positive: "Deferred Revenue (Net)" on revenue side
  - If negative: "Deferred to Future Years" on expenses side
- Scale children proportionally to match stated totals

Added tests for the sankey transform function.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add external link icon next to Land Claims title pointing to AANDC reporting centre
- Display claim status (e.g., "File Closed") in Last Update column above the date

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Convert card layout to full-width table with sticky header
- Add year filter dropdown and search functionality
- Show FS (Financial Statements) and R (Remuneration) indicators per year
- Use auburn color scheme with clickable squares linking to band/year pages
- Add placeholder columns for Revenue, Expenses, Surplus, Population
- Auto-scroll table to show most recent years by default
- Sticky first two columns (First Nation, Province) for horizontal scrolling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move key prop from inner <tr> to Fragment wrapper to fix
"Each child in a list should have a unique key prop" warning.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The root layout includes Plus_Jakarta_Sans font class but the [lang]/layout.tsx
was missing it, causing a hydration mismatch between server and client.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The font was loaded but never used - the CSS explicitly sets
Financier Text for body, Söhne Kraftig for headings, and
Founder's Grotesk Mono for code.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Allow the table to fill available vertical space instead of being
limited to 70vh.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The difference block was missing pathToRoot and descendants properties,
causing highlightNode to crash when trying to spread undefined values.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add province filter dropdown with full province names
- Add legend showing FS=Financial Statements, R=Remuneration
- Link R buttons to #remuneration section on band pages
- Add id="remuneration" to remuneration section for hash linking
- Remove unused Revenue/Expenses/Surplus/Population columns
- Center table and limit First Nation column to 250px
- Rename Province header to Prov. for space
- Make FS/R text non-selectable
- Add Section id prop support to Layout component

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Show on-reserve population under band names and add sort dropdown
to toggle between alphabetical and population-based ordering.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fill in all empty msgstr entries for French locale including:
- First Nations financial terms (Total Expenses, Total Liabilities, etc.)
- Remuneration table labels (Travel, audited/unaudited)
- Tax visualizer labels
- Land claims terminology (Tribunal Award, Total Payments)
- View action labels

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Retry up to 3 times with exponential backoff (1s, 2s, 4s) when
encountering 5xx server errors like 502 Bad Gateway during static
generation. Non-5xx errors are thrown immediately.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace all references to "First Nations band(s)" with "First Nations" to
use more appropriate terminology. This includes renaming files, types,
functions, and updating UI text in both English and French locales.

Co-Authored-By: Claude Opus 4.5 <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.

2 participants