Skip to content

Location caption precision (country / city / city+country)#48

Merged
ankitsejwal merged 3 commits into
mainfrom
feat/geocode-precision
Jun 28, 2026
Merged

Location caption precision (country / city / city+country)#48
ankitsejwal merged 3 commits into
mainfrom
feat/geocode-precision

Conversation

@ankitsejwal

Copy link
Copy Markdown
Member

Closes #39.

The location caption was a plain city/country toggle. This turns it into a precision picker and adds a genuinely useful level the data supports — City, Country ("Cortona, Italy") — while being honest about what offline geocoding can't do.

Levels (a dropdown): Country · City · City, Country. Switching reflows the auto labels on existing photos but leaves any caption you typed yourself alone (isAutoLocation matches only the generated labels).

Honesty about the dataset
offline-geocode-city returns only city + country — there's no neighborhood/landmark in the data. Per the issue, rather than fake it, Neighborhood appears as a disabled option ("offline N/A"). Finer detail would need an online API, which we deliberately don't use (privacy is the moat).

Changes

  • geocode.ts: LocationDetail, LOCATION_DETAILS, placeLabel, isAutoLocation.
  • CaptionLocation widened to the new union (back-compat: old city/country values still valid).
  • Store derivation + applyLocationMode use the helpers; picker replaces the two-button toggle.

Verification
9/9 headless assertions: all three labels format correctly and auto-detection matches every generated label while leaving custom captions untouched. typecheck / oxlint / build green.

@ankitsejwal ankitsejwal merged commit c594b97 into main Jun 28, 2026
1 check passed
@ankitsejwal ankitsejwal deleted the feat/geocode-precision branch June 28, 2026 15:23
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.

Let me choose geocode precision (neighborhood / city / country)

1 participant