Repository navigation
feat(map): save public places with a star, with a shareable shortlist - #366
Merged
Merged
Conversation
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.
|
Member
|
Hello @propcgamer20-png Thanks for opening up a PR. We value and appreciate your contribution to StudentSuite. We will be reviewing your PR shortly. While we do that, could you please take out the time to star this repo and follow our organisation? This helps us push your tool to more students and helps us get more amazing contributors just like you. Thanks again! |
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