Skip to content

Add a setting to turn off Google Places API requests - #3

Merged
Murbal merged 1 commit into
mainfrom
feature/places-api-toggle
Nov 27, 2026
Merged

Murbal merged 1 commit into
mainfrom
feature/places-api-toggle

Conversation

@Murbal

@Murbal Murbal commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a Use Places API switch under Settings → API keys. It is on by default, so existing behavior is unchanged.
  • When the switch is off, the app makes no Places API requests for place search, map place-name labels, or horizon peak names. This keeps them from using up a free quota.
  • The main process refuses the four Places IPC calls (autocomplete, details, nearby, cities) while the switch is off, so no request reaches Google.
  • The command palette hides place search when the switch is off.
  • The Place names rail button shows as off with a tooltip explaining that the Places API is off in Settings. The earlier label on/off choice returns when the switch is turned back on.
  • The horizon panorama's peak-name hint points to the new Settings switch.
  • The setting is saved with other settings and sanitized on load. Settings files without the key load with it on.
  • Known gap: clicking Re-validate on the keys page still sends one Places request to check the key. It only runs on click, so it was left as is.

Testing

  • npm run typecheck: passed
  • npm run lint: passed
  • npm test: 465 tests passed, including a new unit test covering the default value and sanitizing of placesApi
  • npm run build: passed
  • Not run: manual check in the running app (toggling the switch and confirming no Places requests are made while it is off)

- Add a "Use Places API" switch in Settings, on by default
- When off, place search, map place names and horizon peak names make no Places requests, so they stop counting toward the key's quota
- Main process answers Places IPC calls with an error without contacting Google
- Disable the place names rail button and command palette place search while the switch is off
- Store the setting in sanitized settings with a unit test covering the default and sanitizing
@Murbal
Murbal merged commit 6b4afe6 into main Nov 27, 2026
1 check passed
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.

1 participant