Repository navigation
Cap the map results list at one page and mount a single MapPanel - #323
Merged
AnayDhawan merged 1 commit intoOct 30, 2026
Merged
Conversation
Contributor
|
@propcgamer20-png is attempting to deploy a commit to the studentsuite Team on Vercel. A member of the Team first needs to authorize it. |
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.
What this changes
Fixes #294. The unfiltered map built a list row (a select button and two external links) for every place, and always mounted the desktop
MapPaneleven on a phone, where CSS hid it.src/components/map/results-list.tsx: renders 100 rows (RESULTS_PAGE_SIZE, overridable with apageSizeprop) and a "Show 100 more (N not shown)" button for the rest, the pattern the nearest-first list already uses. A new result set (filter, search, nearest-first) starts again from the first page. If the focused pin is beyond the loaded rows, its row is added so the highlight still shows. No new dependency.src/lib/use-media-query.ts(new):useMediaQuery(query)onuseSyncExternalStore;falseon the server and during hydration, so there is no hydration mismatch.src/components/map/places-map.tsx: the sidebarMapPanelmounts only atmin-width: 1024px(the same breakpoint as the existinglg:classes), the sheet's panel only below it.results-list.test.tsx(first page plus button, next pages, no button when it fits, focused row beyond the page, reset on a new result set) and 2 inplaces-map.test.tsx(panel mounts on desktop, not on a phone). The existingplaces-maptests now stub a desktopmatchMedia, since jsdom has none.Proof
Measured in Chrome against
npm run devat/map, with the issue's selectors:The desktop page still reports two
Search places by name or cityinputs: one is the sidebar panel and the other is the separate mobile top bar, which CSS hides at that width (it is not aMapPanel). I did not open the mobile sheet in the browser; the unit tests cover that the sheet panel is the one mounted belowlg.npm run lint,npm run typecheck,npm run format:checkclean;npm run test:unit: 608 passed.Type of change