Skip to content

Improve OSM note sheet actions and share link#16

Open
tordans wants to merge 2 commits into
masterfrom
feature/improve-osm-note-sheet
Open

Improve OSM note sheet actions and share link#16
tordans wants to merge 2 commits into
masterfrom
feature/improve-osm-note-sheet

Conversation

@tordans

@tordans tordans commented May 31, 2026

Copy link
Copy Markdown
Owner

Problem

Als GoMap-Nutzer/in, möchte ich im Hinweis-Fenster klar erkennbare Aktionsbuttons und eine Möglichkeit haben, den Hinweis auf openstreetmap.org zu öffnen, damit ich Kommentare zuverlässig abschicken bzw. Hinweise schließen kann und den Hinweis bei Bedarf im Browser teilen oder öffnen kann.

Aktuell wirken „Comment“ und „Comment & Resolve“ wie einfache Textlinks und sind schwer als primäre Aktionen zu erkennen. Ein Link zum Hinweis auf osm.org ist nur über das wenig sichtbare Teilen-Symbol in der Navigationsleiste erreichbar — nicht direkt auf der Seite.

Implementation notes (by Cursor)

  • Primary action buttons: Comment and Comment & Resolve in NotesTableViewController now use native iOS button styling:
    • iOS 26+: UIButton.Configuration.prominentGlass() with capsule corners (consistent with map toolbar buttons)
    • iOS 15–25: UIButton.Configuration.filled() with medium corner radius
    • Earlier: blue filled fallback with rounded corners
  • On-page share link: Added a new table row “Open on openstreetmap.org” below the comment section. Tapping it opens the system share sheet (UIActivityViewController) with the note URL ({server}/note/{id}), allowing Safari, copy link, AirDrop, etc.
  • Share availability: Share is enabled when the note has a valid OSM id (noteId > 0). Brand-new notes that have not yet been uploaded remain disabled (grayed out). The existing nav-bar share button uses the same logic.
  • Files changed: src/iOS/NotesTableViewController.swift only.

Testing notes (by @tordans)

  • Open an existing OSM note with comment history — verify Comment and Comment & Resolve look like prominent iOS buttons (filled/glass style, not plain text).
  • Type a comment — Comment button enables; tap to submit successfully.
  • Tap Comment & Resolve on an open note — note closes and disappears from map (or shows as recently closed if that feature is merged).
  • Tap Open on openstreetmap.org — share sheet appears with the correct openstreetmap.org/note/{id} URL; Open in Safari loads the note page.
  • Verify nav-bar share button (action icon) still works and shares the same URL.
  • Create a new note (long-press map) — share row and nav-bar share should be disabled/grayed until the note is uploaded.
  • Test on iOS 26 (glass buttons) and at least one older iOS version (filled buttons) if available.
  • Get Directions row still works below the share row.
  • iPad: share sheet popover anchors correctly from both the table row and nav-bar button.

Made with Cursor


Note

Low Risk
Localized UI and share-gating changes in the note sheet only; share eligibility now depends on note id rather than comment count, which is a small behavior shift for edge cases.

Overview
Improves the OSM note detail sheet so Comment / Comment & Resolve read as primary actions and sharing the note on the web is easier to discover.

Comment actions: NotesNewCommentCell now stacks full-width buttons (programmatic constraints replace the storyboard side-by-side layout) and applies filled-style button configuration on iOS 15+ (blue fallback on older OS). Resolve is hidden for brand-new notes; the comment button only enables when there is trimmed text for new notes.

Share link: Adds an Open on openstreetmap.org table row (noteShareCell in the storyboard, with EN/DE strings in MainStoryboard.xcstrings). Tapping it opens the same UIActivityViewController as the nav-bar share button via refactored presentShareSheet(from:), with popover anchoring for bar items and table cells.

Share rules: Sharing (nav bar and in-list row) is gated on note.noteId > 0 instead of requiring existing comment history, so draft/local notes stay non-shareable until persisted. The update section row model is dynamic: comment, optional share row, then directions.

Reviewed by Cursor Bugbot for commit 87beb40. Bugbot is set up for automated code reviews on this repo. Configure here.

Style Comment and Resolve as prominent iOS buttons and add an on-page row to share the note URL via the system share sheet.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tordans

tordans commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

Sorry, will create a new PR once somethings is tested and visible.

@tordans tordans closed this Jun 6, 2026
@tordans tordans reopened this Jun 6, 2026
Stack action buttons vertically, hide share row until the note has an OSM id, use filled button styling in the form context, add a storyboard share cell for localization, and fix keyboard footer padding for new notes.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 2 potential issues.

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 87beb40. Configure here.

let isNewNote = note.comments.count == 0
let trimmed = newComment?.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines) ?? ""
cell.setShowsResolveButton(!isNewNote)
cell.commentButton.isEnabled = isNewNote ? trimmed.count > 0 : false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment button stays disabled

High Severity

For notes that already have history, configureNewCommentCell keeps commentButton disabled, and textViewDidChange no longer toggles it when the user types. The Comment action (doComment) cannot be used to add a comment without resolving, which regresses behavior the PR tests expect for existing OSM notes.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 87beb40. Configure here.


func setShowsResolveButton(_ shows: Bool) {
resolveButton.isHidden = !shows
commentBottomConstraint?.isActive = !shows

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Conflicting layout when resolve hidden

Medium Severity

When setShowsResolveButton(false) for a new note, commentBottomConstraint pins the comment button to the cell bottom while the hidden resolve button still has active top, bottom, and minimum-height constraints below it. Auto Layout cannot satisfy both chains, which can break the comment cell layout for new notes.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 87beb40. 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