Skip to content

Keep recently closed OSM notes visible for 24 hours#15

Open
tordans wants to merge 1 commit into
masterfrom
feature/recently-closed-osm-notes
Open

Keep recently closed OSM notes visible for 24 hours#15
tordans wants to merge 1 commit into
masterfrom
feature/recently-closed-osm-notes

Conversation

@tordans
Copy link
Copy Markdown
Owner

@tordans tordans commented May 31, 2026

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.
  • Das Schließdatum wird aus date_closed in der OSM-API-Antwort gelesen; falls nicht vorhanden, wird das Datum des letzten Kommentars mit action == "closed" verwendet.
  • Kürzlich geschlossene Hinweise behalten das bestehende „N“-Icon, werden aber mit grauem Hintergrund und reduzierter Deckkraft (alpha = 0.45) dargestellt.
  • Beim Aktualisieren eines Markers (z. B. direkt nach dem Schließen) wird das Erscheinungsbild über reuseButtonFrom und refreshButtonAppearance() aktualisiert.
  • Die bestehende Logik in MapMarkerDatabase und NotesTableViewController, die shouldHide() zum Entfernen nutzt, bleibt unverändert und profitiert automatisch von der neuen 24-Stunden-Regel.

Testing notes (by @tordans)

  • Hinweis auf der Karte öffnen, schließen (Resolve) und prüfen, dass der Marker als grauer, halbtransparenter Punkt sichtbar bleibt.
  • Auf den grauen Marker tippen und prüfen, dass der Hinweis erneut geöffnet werden kann (Kommentar hinzufügen / Reopen).
  • Karte verschieben/zoomen und prüfen, dass der kürzlich geschlossene Hinweis weiterhin angezeigt wird.
  • Prüfen, dass ältere geschlossene Hinweise (> 24 h) nicht mehr auf der Karte erscheinen.
  • Prüfen, dass offene Hinweise weiterhin normal (blau, volle Deckkraft) dargestellt werden.

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 (from date_closed in the API XML, or the last closed comment) 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 MapMarkersView calls refreshButtonAppearance() whenever marker positions update so styling stays correct after resolve/reopen.

Existing MapMarkerDatabase cleanup that uses shouldHide() 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.

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>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d55aefb. Configure here.

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.

1 participant