Name-like tags: same autocapitalization as name in POI editor#956
Open
tordans wants to merge 1 commit into
Open
Name-like tags: same autocapitalization as name in POI editor#956tordans wants to merge 1 commit into
name in POI editor#956tordans wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the POI editor (All Tags and Common Tags), the primary
namefield gets word-style autocapitalization while typing. Other human-readable name tags—alt_name,old_name, and localized names such asname:en/name:de(name:+ language suffix)—behave like plain text, so mappers must capitalize each word manually even though the semantics matchname.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)
TagKey(src/Shared/PresetsDisplay/TagKey.swift):isNameLike(_:)— exact keysname,alt_name,old_name; prefixname:(avoids false positives likenamesake/name_source).applyNameLikeTraits— copies autocapitalization/autocorrect from the current feature’snamePresetDisplayKeywhen present, otherwise defaults to.words/.no.POIAllTagsViewController): applies name-like traits to the value field when configuring rows.POICommonTagsViewController): when a preset field is name-like but the schema supplies.none, overrides to matchnameon 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-lineUITextViewpath get the same traits.TagKeyTests): positive/negative cases forisNameLike.Testing notes (@tordans)
Automated (on macOS / Xcode):
TagKeyTestsshould pass.Manual:
name:de→ type a multi-word value → keyboard autocapitalization should matchnameon Common Tags.Common Tags: localized / alternate name preset fields (if shown) should use word caps like– Not tested, assumed to workname.Regression: non-name keys unchanged (e.g.– Not tested, assumed to workref,operator).False positives: keys like– Not tested, assumed to worknamesakeorname_sourceshould not get word caps.name-cap--before.min.mov
name-cap--after.min.mov