Skip to content

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

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

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

Conversation

@tordans
Copy link
Copy Markdown
Owner

@tordans tordans commented May 30, 2026

Problem

Hide Attributes for local / new geometry

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

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 

- 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>
@cursor cursor Bot changed the title POI: remember tab for new geometry; All Tags preset header tap targets POI: hide Attributes for local geometry; All Tags header tap targets May 30, 2026
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>
@tordans tordans force-pushed the cursor/poi-tab-remember-and-all-tags-header-a5db branch from df995b3 to e120126 Compare May 31, 2026 06:30
@tordans
Copy link
Copy Markdown
Owner Author

tordans commented May 31, 2026

This is now handled at bryceco#959

@tordans tordans closed this May 31, 2026
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