Skip to content

Places list perf + Stats country-card redesign (mega-city tier) - #22

Merged
davd-gzl merged 3 commits into
mainfrom
claude/journal-redesign-spec-kit-ku0l3d
Jul 22, 2026
Merged

davd-gzl merged 3 commits into
mainfrom
claude/journal-redesign-spec-kit-ku0l3d

Conversation

@davd-gzl

Copy link
Copy Markdown
Collaborator

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).

  • Defer the search off the keystroke — the input paints at native speed; the browse fan-out runs in an interruptible follow-up render (useDeferredValue).
  • Page the browse lazily — build only the rows currently shown plus a hasMore probe, 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.

  • One flag + name in the collapsed summary, with compact mega/big/regions meters at a glance.
  • Expanded body shows the same metrics with counts, 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-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 --noEmit clean, 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

davd-gzl added 3 commits July 22, 2026 06:33
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".
@davd-gzl
davd-gzl merged commit ad25820 into main Jul 22, 2026
2 checks passed

This branch was previously deployed

1 inactive deployment
github-pages — 3d1a4903 Deployed Jul 22, 2026 by davd-gzl via deploy #145
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