Skip to content

Commit 9479ae4

Browse files
atulmguptaCopilot
andcommitted
chore(settings): remove unused Google Maps API Key field
The General Settings preferences audit revealed no UI map code reads settings.google_maps_api_key -- it was a dead preference being collected from users with no consumer. Remove the form field, type field, search index entry, and i18n strings so the UI stops misleading users that entering a key does anything. Backend env-var fallback (internal/config, helm, docker-compose, .env.example) is preserved for when maps are properly implemented later as a reusable component that actually consumes the key. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 940bf9b commit 9479ae4

4 files changed

Lines changed: 3 additions & 36 deletions

File tree

β€Žweb/src/api/types.tsβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ export interface AppSettings {
248248
quiet_hours_start: string
249249
quiet_hours_end: string
250250
alert_digest_mode: string
251-
google_maps_api_key?: string
252251
polling_config?: PollingConfig
253252
/** Unicode currency glyph (e.g. "$", "€"). Stored verbatim β€” no ISO 4217 lookup. */
254253
currency_symbol?: string

β€Žweb/src/features/settings/components/GeneralSettings.tsxβ€Ž

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,9 @@ export function GeneralSettings() {
7474
const settingsMut = useSaveSettings()
7575

7676
// Persist form drafts to localStorage so a long edit session survives a tab
77-
// close, an SW reload, or an auth redirect. The optional google_maps_api_key
78-
// field is a client-side public-tier integration key (comparable to the theme
79-
// setting) β€” not a server credential. If a true secret is ever added to this
80-
// form, switch that field to a separate non-persisted useState.
77+
// close, an SW reload, or an auth redirect. None of the persisted fields are
78+
// server credentials β€” keep it that way; if a true secret is ever added to
79+
// this form, switch that field to a separate non-persisted useState.
8180
const {
8281
value: form,
8382
setValue: setForm,
@@ -389,21 +388,6 @@ export function GeneralSettings() {
389388
placeholder={t('app.mpgPlaceholder', 'Average MPG of equivalent gas car')}
390389
/>
391390
</SettingField>
392-
393-
<SettingField label={t('app.googleMapsApiKey', 'Google Maps API Key')}>
394-
<Input
395-
type="password"
396-
value={form.google_maps_api_key || ''}
397-
onChange={e => setForm({ ...form, google_maps_api_key: e.target.value })}
398-
className="w-full px-3 py-2.5 text-sm"
399-
placeholder={t('app.googleMapsPlaceholder', 'Enter your Google Maps API key')}
400-
/>
401-
<p className="text-[10px] text-[var(--text-muted)] mt-1">
402-
{t('app.googleMapsHint', 'Optional β€” enables satellite views, Places autocomplete, and enhanced geocoding.')}{' '}
403-
{t('app.getKeyAt', 'Get a key at')}{' '}
404-
<a href="https://console.cloud.google.com" target="_blank" rel="noreferrer" className="text-cyan-300 hover:underline">console.cloud.google.com</a>
405-
</p>
406-
</SettingField>
407391
</div>
408392
</>
409393
)}

β€Žweb/src/features/settings/searchIndex.tsβ€Ž

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,6 @@ export function getSettingsIndex(t: TFunction): SettingsEntry[] {
201201
description: t('search.entries.general.mpg.desc', 'Average MPG of the equivalent gas car for savings calculations.'),
202202
keywords: ['fuel economy', 'efficiency', 'mpg'],
203203
},
204-
{
205-
id: 'general.google-maps',
206-
href: '/settings#general',
207-
section: 'general',
208-
title: t('search.entries.general.googleMaps.title', 'Google Maps API key'),
209-
description: t('search.entries.general.googleMaps.desc', 'Optional key enabling satellite views and Places autocomplete.'),
210-
keywords: ['maps', 'api key', 'satellite', 'places'],
211-
},
212204

213205
// ── Gas price auto-poll ─────────────────────────────────────────
214206
{

β€Žweb/src/i18n/en.jsonβ€Ž

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,10 +1844,6 @@
18441844
"mpg": {
18451845
"title": "Comparison vehicle MPG",
18461846
"desc": "Average MPG of the equivalent gas car for savings calculations."
1847-
},
1848-
"googleMaps": {
1849-
"title": "Google Maps API key",
1850-
"desc": "Optional key enabling satellite views and Places autocomplete."
18511847
}
18521848
},
18531849
"gasPrice": {
@@ -6726,10 +6722,6 @@
67266722
"perLiter": "/ liter",
67276723
"comparisonMPG": "Comparison Vehicle MPG",
67286724
"mpgPlaceholder": "Average MPG of equivalent gas car",
6729-
"googleMapsApiKey": "Google Maps API Key",
6730-
"googleMapsPlaceholder": "Enter your Google Maps API key",
6731-
"googleMapsHint": "Optional β€” enables satellite views, Places autocomplete, and enhanced geocoding.",
6732-
"getKeyAt": "Get a key at",
67336725
"save": "Save Settings",
67346726
"settingsSaved": "Settings saved",
67356727
"newVersion": {

0 commit comments

Comments
Β (0)