Skip to content

Add Rankings tab and sector drill-down#252

Merged
joreilly merged 1 commit into
mainfrom
feature/rankings-tab-and-sector-drilldown
May 24, 2026
Merged

Add Rankings tab and sector drill-down#252
joreilly merged 1 commit into
mainfrom
feature/rankings-tab-and-sector-drilldown

Conversation

@joreilly

@joreilly joreilly commented May 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Rankings tab — new bottom-nav destination (Leaderboard icon) showing all countries sorted by total CO₂e or per-capita emissions, switchable via a TabRow. Reuses the /rankings/countries response already fetched on app start, so there's no new network call. Tapping a row pushes CountryEmissionsScreen and forwards the per-capita rank.
  • Sector drill-downselectedSector state is now hoisted from the treemap into CountryInfoDetailedViewSuccess and shared with the assets section. Tapping a treemap block or legend row both dims non-matching sectors and filters the "Top Emission Sources" list client-side. The list title flips to "Top Sources · <Sector>" and an "All sectors" AssistChip appears to clear the filter. Resets when the country changes.
  • Model fieldCountryEmissionsInfo.name is now deserialized (the API was returning it; we were ignoring it). Lets the Rankings screen show country names without a separate lookup.

- New Rankings screen with Total / Per Capita tabs, reusing the
  already-fetched /rankings/countries response (now exposed on
  CountryListUIState.Success as rankingsList).
- Bottom nav grew a third destination ("Rankings", Leaderboard icon).
- Tapping a rankings row pushes CountryEmissionsScreen and forwards
  the per-capita rank so the detail view still shows "Per Capita (#N)".
- Treemap legend / blocks now drive a hoisted selectedSector state in
  the detail view; the Top Sources list filters to that sector, with
  a title hint ("Top Sources · Power") and an "All sectors" clear chip.
- CountryEmissionsInfo gained a `name` field so the Rankings screen
  can display the country label without a separate lookup.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@joreilly joreilly merged commit 647f77c into main May 24, 2026
2 checks passed
@joreilly joreilly deleted the feature/rankings-tab-and-sector-drilldown branch May 24, 2026 11:26
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