-
-
Notifications
You must be signed in to change notification settings - Fork 80
feat: hidden persistence #1180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat: hidden persistence #1180
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements a persistent "Hide" feature that allows users to temporarily hide Pokemon, gyms, pokestops, nests, stations, and tappables for 1 hour, with the ability to restore them via Settings > Clean Hidden.
Key changes:
- New utility module for managing hidden entities with timestamp-based expiration
- Persistent storage using localStorage with automatic 1-hour cleanup
- User feedback via temporary snackbar notifications (limited to 3 displays)
- Settings UI to manually clear all hidden entities
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/pokemon/hiddenPokemon.js | New utility module providing localStorage-based persistence for hidden entities with timestamp tracking, automatic cleanup, and snackbar notification system |
| src/store/useMemory.js | Initialize hideList with persisted hidden entities from localStorage on app startup |
| src/features/tappable/TappablePopup.jsx | Update hide action to use persistent storage and show snackbar notification |
| src/features/station/StationPopup.jsx | Update hide action to use persistent storage and show snackbar notification |
| src/features/pokestop/PokestopPopup.jsx | Update hide action to use persistent storage and show snackbar notification |
| src/features/pokemon/PokemonPopup.jsx | Update hide action to use persistent storage (missing snackbar notification) |
| src/features/nest/NestPopup.jsx | Update hide action to use persistent storage and show snackbar notification |
| src/features/gym/GymPopup.jsx | Update hide action to use persistent storage and show snackbar notification |
| src/features/drawer/settings/index.jsx | Add "Clean Hidden" button to manually clear all hidden entities and reset state |
| packages/locales/lib/human/pl.json | Add Polish translations for "hidden_for_hour" and "clean_hidden" |
| packages/locales/lib/human/en.json | Add English translations for "hidden_for_hour" and "clean_hidden" |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Mygod
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you intend “hide for hour” to apply only to Pokémon, we should scope it to Pokémon; if you intend it to work for all hidden entities, we should add an automatic refresh/expiry so the in-memory Set drops expired IDs.
To continue this session, run codex resume 019b2474-8894-73f2-a399-a4a5be980d90
|
@Mygod Renamed things. It will run cleanup once 15s after map loads. There's no need to run this in the background loop at all (but so wasn't on add). Tested. |
Mygod
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That commit only partially addresses it.
- It does clean expired entries once after load and updates the in-memory Set (src/pages/map/components/Container.jsx:42 + src/utils/hiddenEntities.js:77), so stale hides from a previous session can drop ~15s after you open the map.
- It still does not make hides expire during a long-running session: after an hour passes, nothing re-runs cleanup, so useMemory().hideList stays stale until reload.
- It’s actually worse than before on “another hide refreshes it”: addHiddenEntity no longer calls cleanOldEntries, so hiding something later won’t drop expired IDs either (src/utils/hiddenEntities.js:54).
If “hidden for an hour” is still the intended behavior, you’ll need either cleanup-on-add back, or a one-shot setTimeout scheduled for the next expiry (not a loop) to refresh hideList when entries age out.
|
As a human, I personally think hiding for exactly one hour is too arbitrary and the use case is too niche. |
The original idea was for Pokemons, since map tends to refresh in background. Guess I can just bring back those and drop the rest |
5f95179 to
da54f9a
Compare
|
Could things be hidden till midnight? Iirc I already had few requests for such feature but for quests mostly so I personally think 1h is not enough |
I simply rework what we already have. Taking it away is a bad idea. I will add cleanup every ~15s and keep current flow.
Can't. It would be too heavy to support multiple timezones. |
fix: clean outdated storage 15s after map loads
da54f9a to
a39e59f
Compare
Persistent "Hide" feature.
Hides everything for 1h can be restored via Settings > Clean Hidden.
Tested, working.