Places list perf + Stats country-card redesign (mega-city tier) - #22
Merged
Merged
Conversation
The Places search drove browseList (gazetteer search + sort + visit overlay) and re-rendered up to 100 rows synchronously on every keystroke, so the list lagged far behind typing — while the map's search stayed smooth because it already uses useDeferredValue. Apply the same: the input stays instant (bound to raw filter), and the expensive browse recompute + row re-render run in an interruptible deferred pass. typecheck clean; places-explore e2e green.
…own)
The list lag was browseList building the WHOLE matching set (up to ~5,600
airport rows, ~9ms) on every visit toggle / filter change, even though
only ~100 render. Refactor to page: the ordered base pools are built
once (memoised), and a call materialises only up to a limit (= rows
shown) plus a one-item hasMore probe. So a recompute builds ~100 row
objects, not thousands (airports 9.28ms -> 0.08ms, 116x), and "Show more"
pages uncapped through the full set — no 300 cap.
browseList now returns { rows, hasMore } and takes a limit; PlacesScreen
passes shown, renders the page, and loads more via hasMore. Personal
list unchanged. Combined with the deferred search query, the Places list
keeps up with typing and toggles like the map.
typecheck clean; 444 unit (incl. new paging test); places-explore +
a11y + smoke + filter-panel e2e green.
…M+) tier The per-country card was hard to read: a doubled flag/name, a "cities %" sliver that was always ~0, and a wall of rounded chips for regions/monuments. - Country card: one flag + name in the summary; compact mega/big/regions meters at a glance; expanded body shows the same with counts plus an "Open full page" link (no repeated name) and plain, scannable name lists for what's left to explore — no chip wall. Tighter spacing when open. - Mega cities (1M+): a new tier alongside big cities (100k+). Precomputed per country at load (megaCityCount), surfaced as a KPI, a By-city-size segment, and a per-country meter. - Mobile top-bar search: short placeholder on narrow screens and reclaim the clear-button padding while empty, so it reads "Search…" instead of clipping to "Se".
This branch was previously deployed
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.
Three commits on top of the filter-scope work already on
main.Places list performance
The Places list lagged badly on every keystroke and toggle — much more than the map — because the whole reference pool was materialised into rows on each recompute (airports built ~5,600 rows per pass).
useDeferredValue).hasMoreprobe, never the whole pool (airports browse went from ~9.3 ms to ~0.08 ms per recompute). The list is not capped: "Show more" loads the next page, so you can scroll through everything.Stats: country card redesign
The per-country card was hard to read — a doubled flag/name, a "cities %" that was always ≈0, and a wall of rounded chips for regions/monuments.
Mega-city tier (1M+)
A new tier alongside big cities (100k+): precomputed per country at load (
megaCityCount), surfaced as a KPI, a By-city-size segment, and a per-country meter.Mobile top-bar search
Short placeholder on narrow screens and reclaim the clear-button padding while empty, so the field reads "Search…" instead of clipping to "Se".
Gate:
tsc --noEmitclean, 444 unit tests pass, e2e (smoke / a11y axe WCAG 2.1 AA / countryscope / keyboard / offline / filter-panel / wishlist) pass.🤖 Generated with Claude Code
https://claude.ai/code/session_014W6tgHRgLEugCsbKC9ccST
Generated by Claude Code