Skip to content

Conversation

@lenisko
Copy link
Contributor

@lenisko lenisko commented Dec 15, 2025

Persistent "Hide" feature.

Hides everything for 1h can be restored via Settings > Clean Hidden.

Tested, working.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Copy link

Copilot AI left a 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.

Copy link
Collaborator

@Mygod Mygod left a 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

@lenisko
Copy link
Contributor Author

lenisko commented Dec 16, 2025

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

Copy link
Collaborator

@Mygod Mygod left a 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.

@Mygod
Copy link
Collaborator

Mygod commented Dec 16, 2025

As a human, I personally think hiding for exactly one hour is too arbitrary and the use case is too niche.

@lenisko
Copy link
Contributor Author

lenisko commented Dec 16, 2025

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

@kamieniarz
Copy link
Contributor

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

@lenisko
Copy link
Contributor Author

lenisko commented Dec 20, 2025

As a human, I personally think hiding for exactly one hour is too arbitrary and the use case is too niche.

I simply rework what we already have. Taking it away is a bad idea. I will add cleanup every ~15s and keep current flow.

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

Can't. It would be too heavy to support multiple timezones.

fix: clean outdated storage 15s after map loads
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.

3 participants