Attributes tab: Done dismisses POI editor when tags unchanged#3
Closed
tordans wants to merge 1 commit into
Closed
Conversation
When the tag dictionary matches the map object, Done now dismisses without calling commitChanges(). When tags changed, behavior is unchanged: dismiss then commit. Removed viewWillAppear logic that disabled Done when there were no edits. Fix Done dismiss when tags unchanged on Common/All Tags tabs Disabled UIBarButtonItem does not invoke done:, so gray checkmark could highlight without closing. Keep Done enabled and use tint for gray/blue; only commit when isTagDictChanged(). Shared updateSaveButton on POITabBarController. Co-Authored-By: Tobias <t@tobiasjordans.de>
3b1ef73 to
b74adc3
Compare
Owner
Author
|
Now managed at bryceco#955 |
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 / user story
On POI editor tabs (Common Tags, All Tags, Attributes), the navigation Done (checkmark) was disabled when tags were unchanged (
saveButton.isEnabled = false). A disabled bar button does not rundone(_:), so the checkmark could highlight but the sheet stayed open. With edits, Done was enabled (blue) and dismissed + saved as expected.Expected: Gray checkmark when unchanged, but tap still dismisses without saving. Blue checkmark when there are edits: save and dismiss.
Implementation notes (by Cursor)
Root cause:
UIBarButtonItem.isEnabled = falseblocks the action selector.Fix:
POITabBarController.updateSaveButton(_:hasUnsavedTagChanges:)— Done stays enabled (tappable); tint is gray (.tertiaryLabel) when unchanged, default accent when changed;isModalInPresentationstill tracks unsaved changes.done(_:)on Common Tags, All Tags, and Attributes: alwaysdismiss, callcommitChanges()only whenisTagDictChanged().saveButton.isEnabled = isTagDictChanged()call sites in those controllers withupdateSaveButton.Note: New objects hide the Attributes tab; the behavior you see on “tags panel” is Common Tags (first tab).
Automated testing: Not covered by XCTest in this PR.
Testing notes (manual — maintainer)
ok-dismiss--before.min.mov
ok-dismiss--after.min.mov