Keep recently closed OSM notes visible for 24 hours#15
Conversation
Closed notes remain as faded gray markers so mappers can reopen them to add a follow-up comment or undo an accidental close. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d55aefb. Configure here.
| return date | ||
| } | ||
| return nil | ||
| } |
There was a problem hiding this comment.
Wrong date formatter makes feature completely inoperative
High Severity
dateForClosedStatus() uses OsmBaseObject.rfc3339DateFormatter(), which expects dates in yyyy-MM-ddTHH:mm:ssZ format (e.g. 2019-06-15T08:26:04Z). However, the OSM Notes API returns dates in yyyy-MM-dd HH:mm:ss UTC format (e.g. 2019-06-15 08:26:04 UTC). Because of this mismatch, both parsing attempts always fail, so dateForClosedStatus() always returns nil. This causes shouldHide() to always return true for closed notes (via the guard let closedDate = dateForClosedStatus() else { return true } fallback), making isRecentlyClosed always false. The entire 24-hour retention feature is silently broken — all closed notes are immediately hidden, just like before.
Reviewed by Cursor Bugbot for commit d55aefb. Configure here.


Problem
User story: Als Mapper:in in GoMap möchte ich, dass gerade geschlossene OSM-Hinweise noch einen Tag lang als dezente graue Punkte auf der Karte sichtbar bleiben, damit ich nach dem Schließen noch einen Kommentar hinzufügen oder ein versehentliches Schließen rückgängig machen kann.
Bisher verschwinden Hinweise sofort von der Karte, sobald sie über die OSM Notes API geschlossen werden. Das erschwert Nachbearbeitung und Korrekturen direkt im Anschluss an das Schließen.
Implementation notes (by Cursor)
OsmNoteMarker.shouldHide()blendet geschlossene Hinweise nur noch aus, wenn das Schließdatum älter als 24 Stunden ist.date_closedin der OSM-API-Antwort gelesen; falls nicht vorhanden, wird das Datum des letzten Kommentars mitaction == "closed"verwendet.alpha = 0.45) dargestellt.reuseButtonFromundrefreshButtonAppearance()aktualisiert.MapMarkerDatabaseundNotesTableViewController, dieshouldHide()zum Entfernen nutzt, bleibt unverändert und profitiert automatisch von der neuen 24-Stunden-Regel.Testing notes (by @tordans)
Made with Cursor
Note
Low Risk
Map marker visibility and styling only; no changes to auth, uploads, or core map data handling beyond note display rules.
Overview
Recently closed OSM notes stay on the map for 24 hours instead of disappearing as soon as their status is
closed.OsmNoteMarker.shouldHide()now compares the close time (fromdate_closedin the API XML, or the lastclosedcomment) against a one-day retention window; notes without a parseable close date are still hidden immediately.Those notes are shown as the same “N” pin but gray and at 45% opacity; open notes stay blue at full opacity. Appearance is applied when buttons are created or reused, and
MapMarkersViewcallsrefreshButtonAppearance()whenever marker positions update so styling stays correct after resolve/reopen.Existing
MapMarkerDatabasecleanup that usesshouldHide()picks up the new rule without further changes.Reviewed by Cursor Bugbot for commit d55aefb. Bugbot is set up for automated code reviews on this repo. Configure here.