Add Rankings tab and sector drill-down#252
Merged
Merged
Conversation
- 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>
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
Leaderboardicon) showing all countries sorted by total CO₂e or per-capita emissions, switchable via aTabRow. Reuses the/rankings/countriesresponse already fetched on app start, so there's no new network call. Tapping a row pushesCountryEmissionsScreenand forwards the per-capita rank.selectedSectorstate is now hoisted from the treemap intoCountryInfoDetailedViewSuccessand 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"AssistChipappears to clear the filter. Resets when the country changes.CountryEmissionsInfo.nameis now deserialized (the API was returning it; we were ignoring it). Lets the Rankings screen show country names without a separate lookup.