Skip to content

POI: hide Attributes for local geometry; All Tags header tap targets#959

Open
tordans wants to merge 2 commits into
bryceco:masterfrom
tordans:cursor/poi-tab-remember-and-all-tags-header-a5db
Open

POI: hide Attributes for local geometry; All Tags header tap targets#959
tordans wants to merge 2 commits into
bryceco:masterfrom
tordans:cursor/poi-tab-remember-and-all-tags-header-a5db

Conversation

@tordans
Copy link
Copy Markdown
Contributor

@tordans tordans commented May 31, 2026

Problem

This changes two things at once because I mixed up my instructions. But they are related, so maybe they can stay in one PR.

Hide Attributes for local / new geometry

Issue 1: The 3rd tab "Attributes" was hidden for new nodes but not for new ways/areas

POITabBarController restores UserPrefs.poiTabIndex when the POI editor opens (0 = Common Tags, 1 = All Tags, 2 = Attributes).

For a new standalone node (selectedPrimary == nil), the Attributes tab is already removed and a saved index of 2 is clamped to 0.

For a new way / area / relation in memory (ident < 0 until upload), selectedPrimary is non-nil, so Attributes used to stay visible and index 2 could still be restored—inconsistent with the new-node experience.

User story: After editing an uploaded object on Attributes, opening the editor for any not-yet-uploaded geometry (nil selection or local negative id) should match a new node: only Common Tags and All Tags; Attributes returns after the object has a positive server id.

Consolidation: PR #6 addressed the same Attributes-tab bug. This PR keeps that fix plus the All Tags header work below. PR #6 is closed as superseded; unit tests from #6 are included here (POITabBarControllerTestCase).

All Tags preset header

Issue 2a: The "change/choose preset" arrow on the "All Tags" did not look that great
Issue 2b: When the keyboard was up (which happens automatically in some flows), there is no direct way to change from "All Tags" to "Common Tags" => This is now solved by making the Preset label clickable

On All Tags, the section header shows the matched preset name and a control to open the feature picker. When the keyboard hides the tab bar, users could not easily return to Common Tags preset fields. The trailing control was plain ">" text.

User story: Tap the preset title → Common Tags; tap the chevron → change preset (unchanged behavior).


Implementation notes (Cursor)

POITabBarController.swift

  • shouldHideAttributesTab(for:)true when selection == nil or ident < 0.
  • resolvedTabBar(savedIndex:selection:) — tab count 2 vs 3; clamps saved index 2 → 0 when Attributes hidden.
  • viewDidLoad uses resolvedTabBar; removeAttributesTabFromViewControllers() strips the Attributes nav stack.

POIAllTagsViewController.swift (SectionHeaderCell)

  • Title: slideTabTo(tabIndex: 0) + updates poiTabIndex; does not open feature picker.
  • Trailing: chevron.right, accessibility “Change preset”; pushes POIFeaturePickerViewController.
  • UIButton.Configuration on iOS 15+; fallback on older OS.

Tests (from PR #6)

  • POITabBarControllerTestCase — matrix for savedIndex ∈ {0,1,2} × {nil, pending node, uploaded node, pending way}.

Out of scope: Refreshing tabs if selection goes pending → uploaded while POI stays open.


Testing notes (@tordans)

POI tab / Attributes visibility

  1. Uploaded node → Attributes → then new node (pushpin) → two tabs only; if last index was 2, land on Common Tags.
  2. Same with last session on Attributes (index 2) before new node → Common Tags, no Attributes.
  3. New way/area (ident < 0) → POI → Attributes hidden; index 2 does not select a missing third tab.
  4. After upload or existing object (ident > 0) → three tabs; index 2 restores normally.

All Tags header

  1. Tags present → All Tags → keyboard up → tap header titleCommon Tags.
  2. Tap chevron → feature picker; title must not open picker.
  3. VoiceOver: two elements; “Change preset” on chevron.
  4. iPad / Mac Catalyst: trailing control ≥ 44pt.
BeforeAfter
tags-panels--hide-attributes--switcher--before.min.mov
tags-panels--hide-attributes--switcher--after.min.mov

Automated: Run GoMapTestsPOITabBarControllerTestCase.

Open in Web Open in Cursor 

cursoragent and others added 2 commits May 30, 2026 15:50
- Treat pending geometry (ident < 0) like new nodes when restoring poiTabIndex:
  strip Attributes tab and clamp saved index 2 to Common Tags.
- All Tags preset header: title switches to Common Tags; chevron opens picker.

Co-authored-by: Tobias <t@tobiasjordans.de>
Expose resolvedTabBar for tab index clamping; adopt in viewDidLoad.
Supersedes duplicate Attributes-tab logic in draft PR #6.

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