Repository navigation
feat(map): save public places with a star, with a shareable shortlist - #366
Open
propcgamer20-png wants to merge 10 commits into
Open
propcgamer20-png wants to merge 10 commits into
propcgamer20-png wants to merge 10 commits into
Conversation
…view A search that leaves one place fitted a zero-size box and zoomed to level 19, where the basemap is blank. The fit is now capped (16 for one place, 15 for several) and the go-to-place zoom shares one constant. The map used to open on the whole world with grey bands above and below the tiles. It now keeps the basemap covering the viewport with a minimum zoom, reopens where the visitor last left it (localStorage, guarded), and opens on a signed-in visitor's saved home when nothing else chose a view. An explicit lat/lng/zoom, place, search or filter in the URL still wins, and nothing asks for geolocation on load. Closes #350 Closes #353
Rows showed only the type, so two places sharing a name prefix could not be told apart. The second line is now 'type · city, country' (distance last when known), the name may take two lines before truncating, and the three row actions are 44px touch targets below the lg sidebar breakpoint. Their aria-labels are unchanged. Closes #354
…ilter row Chips and presets both set the same types filter under different labels. The chip row stays (it carries counts and the pin colours), the one combo chips cannot express, SAT plus foreign-language exam centres, becomes a leading 'All exam centres' chip, and the single-type presets go. The row gains an 'N categories selected' line with Clear, and the scrolling row fades its right edge instead of clipping a chip. Labels come from PLACE_TYPE_LABELS only. Closes #352
…h this area prompt The results list was driven by filters only, so panning to Lagos still listed Heathrow first. An 'Only places in this view' switch (on by default from zoom 8) limits the list to the area the map showed, and the header now reads 'N places in this view' or 'N places total'. The list is pinned to one area: moving the map shows a 'Search this area' button instead of re-sorting rows under the visitor's cursor mid-scroll. Nearest-first still applies when a location is set. The map now reports its visible bounds; they are kept out of the URL and storage. Works in the desktop panel and the mobile sheet, which share one MapPanel. Closes #351
/country/<code> is generated from the dataset next to the city pages: a count per category (each linking to the map filtered to that country), the country's cities linking to their existing city pages, and a short 'start here' list that puts verified places first. It carries a schema.org Country with an ItemList of its cities, a generated Open Graph image in the same style as the city cards, and a meta description built from real counts. The only URL is the lowercase code, so /country/IN is a 404 and there is one canonical page per country. Counts are checked against the same tally that /stats uses. Part of #358
Country pages join the sitemap (lastmod from the newest verified place, like the city entries), each city page gets a country breadcrumb, and the map shows 'View <country> page' next to the country filter once a country is chosen. Closes #358
A star on the pin popup, the detail drawer and every results row saves a public place. The list is kept in the browser first (localStorage, every access guarded), so it works signed out, offline and on a self-hosted copy with no Supabase. Signed in, it is also kept in a new saved_places table (private per user through row-level security, migration included), and signing in merges the browser's list with the account's with nothing lost and nothing duplicated. A 'Saved' chip with a count narrows the list to the visitor's places, and 'Share list' copies a ?saved=a,b link. Opening such a link shows that shortlist read only, with a banner offering 'Save all to my list' or 'Show all places'; ids that no longer exist in the dataset are dropped silently. The table is listed on the privacy page and in SELF-HOSTING.md. Closes #355
Keeps the saved-places provider around the page and re-applies the openOnHome prop on the map; both test blocks are kept.
Keeps both the Star import and the Link import in map-panel.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully 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.
What this changes
#355: save public places with a star, with no account needed.
aria-pressed, and its name says which place it acts on ("Save City Library" / "Remove City Library from saved"). Where there is no saved list (the embed, previews) the star simply does not render.localStorage(every read and write in try/catch, a corrupt value reads as empty), so it works signed out, offline and on a self-hosted copy with no Supabase.saved_placestable, mirroringcompetition_saves: one row per user and place, private through row-level security. The migrationsupabase/migrations/20261124_create_saved_places.sqlhas to be run once by hand, like the others; until it is, saving still works and only the sync is idle (a failed sync shows a toast and keeps the star).?saved=a,blink.SELF-HOSTING.mdandARCHITECTURE.mdmention it.Type of change
Testing
npm run typecheck,npm run lint,npm run test:unit(920 tests on this branch) andprettier --check .pass. I also built the combination of every branch I have open (this one plus chore: remove three unused components left over from the #313 pass #361 and feat: optional website, phone and hours for places #364) as a throwaway and ran the same checks: 972 tests, all passing.saved-places.test.ts(31): id cleaning, corrupt and blocked storage, the?saved=parser, merge (no loss, no duplicates, stable), pruning, and the account calls against a fake client.use-saved-places.test.tsx(13): survives a reload, follows another tab, merge on sign-in sends up only what the account lacked, the account unreadable keeps the local list, a failed write keeps the star and shows a toast.save-star,shareandpin-popuptests, andplaces-map.test.tsx(the full flows through the real page): star, reload, the Saved filter and its empty message, Share list, and a shared link (read only, missing ids dropped, address-bar kept, "Save all" merges without duplicates, "Show all places" saves nothing).Not covered
SaveStartests.Closes #355