Skip to content

Name-like tags: same autocapitalization as name in POI editor#956

Open
tordans wants to merge 1 commit into
bryceco:masterfrom
tordans:cursor/name-like-tags-autocap-8540
Open

Name-like tags: same autocapitalization as name in POI editor#956
tordans wants to merge 1 commit into
bryceco:masterfrom
tordans:cursor/name-like-tags-autocap-8540

Conversation

@tordans
Copy link
Copy Markdown
Contributor

@tordans tordans commented May 31, 2026

Problem

In the POI editor (All Tags and Common Tags), the primary name field gets word-style autocapitalization while typing. Other human-readable name tags—alt_name, old_name, and localized names such as name:en / name:de (name: + language suffix)—behave like plain text, so mappers must capitalize each word manually even though the semantics match name.

This is an issue when mapping in Countries like Cyprus, where street signs are written in Greek and English – and I only know how to writhe English :)

Implementation notes (by Cursor)

  • Added TagKey (src/Shared/PresetsDisplay/TagKey.swift):
    • isNameLike(_:) — exact keys name, alt_name, old_name; prefix name: (avoids false positives like namesake / name_source).
    • applyNameLikeTraits — copies autocapitalization/autocorrect from the current feature’s name PresetDisplayKey when present, otherwise defaults to .words / .no.
  • All Tags (POIAllTagsViewController): applies name-like traits to the value field when configuring rows.
  • Common Tags (POICommonTagsViewController): when a preset field is name-like but the schema supplies .none, overrides to match name on the same feature.
  • PresetValueTextField: same override on edit for preset-backed and free-form keys (covers All Tags value editing).
  • KeyValueTableCell: name-like keys using the multi-line UITextView path get the same traits.
  • Unit tests (TagKeyTests): positive/negative cases for isNameLike.

Testing notes (@tordans)

Automated (on macOS / Xcode):

  • Run GoMapTests target; TagKeyTests should pass.

Manual:

  1. All Tags: add row name:de → type a multi-word value → keyboard autocapitalization should match name on Common Tags.
  2. Common Tags: localized / alternate name preset fields (if shown) should use word caps like name. – Not tested, assumed to work
  3. Regression: non-name keys unchanged (e.g. ref, operator). – Not tested, assumed to work
  4. False positives: keys like namesake or name_source should not get word caps. – Not tested, assumed to work
BeforeAfter
name-cap--before.min.mov
name-cap--after.min.mov

Treat alt_name, old_name, and name:* keys like the primary name field
for keyboard autocapitalization in All Tags and Common Tags. Add TagKey
helper and unit tests for isNameLike detection.

Co-authored-by: Tobias <t@tobiasjordans.de>
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.

2 participants