POI: hide Attributes tab for pending local geometry#19
Draft
tordans wants to merge 1 commit into
Draft
Conversation
Extract Attributes-tab behavior from bryceco#959 (closed combined PR). Hide the third tab when selection is nil or ident < 0; clamp saved index 2 to 0. Co-authored-by: Tobias <t@tobiasjordans.de>
|
It looks like this is forked from the 5.6.3 version rather than from the latest version on master which includes the tab switch control built into the keyboard toolbar. Since tab selection occurs in two places now (three if we add the keyboard toolbar to Common Tags, TBD) this PR should be rebased onto the latest master. One side effect of this change is it leads to the keyboard toolbar tab selector being reduced to a single usable button: since Attributes is removed and All Tags is disabled (because it's the current tab). |
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.

Context
This PR extracts only the Attributes-tab behavior from the closed combined PR bryceco/GoMap#959. That PR mixed two goals (Attributes visibility + All Tags header tap targets). Per upstream discussion, those are being split into separate PRs. The All Tags / keyboard navigation work is out of scope here.
Problem / user story
The POI editor has three tabs: Common Tags (0), All Tags (1), Attributes (2).
POITabBarControllerrestores the last-used tab fromUserPrefs.poiTabIndex.For a new standalone node (
selectedPrimary == nil), the Attributes tab is already removed and a saved index of 2 is clamped to 0 — so you never land on a missing third tab.For a new way, area, or relation that already exists in memory (
ident < 0until upload),selectedPrimaryis non-nil, so Attributes used to stay visible and index 2 could still be restored — even though that tab has no useful server-backed metadata yet.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 the new-node behavior: only Common Tags and All Tags. Attributes returns once the object has a positive server id.
Implementation notes (Cursor)
POITabBarController.swiftshouldHideAttributesTab(for:)—truewhenselection == nilorident < 0.resolvedTabBar(savedIndex:selection:)— resolves tab count (2 vs 3) and clamps saved index 2 → 0 when Attributes is hidden.viewDidLoadusesresolvedTabBar;removeAttributesTabFromViewControllers()strips the Attributes nav stack.updatePOIAttributesTabBarItemVisibilityhelper (logic consolidated inviewDidLoad).POITabBarControllerTestCase.swiftUnit tests for
shouldHideAttributesTabandresolvedTabBaracross nil selection, pending node/way, and uploaded node.Out of scope: Refreshing tabs if selection goes from pending → uploaded while POI stays open.
Testing notes (manual — @tordans)
ident < 0) → POI → Attributes hidden; index 2 does not select a missing third tab.ident > 0) → three tabs; index 2 restores normally.Automated: Run
GoMapTests—POITabBarControllerTestCase.