OSM notes: autolink comment URLs in dismissible web panel#14
Conversation
Detect URLs in note history text and present them in a dismissible sheet web view instead of leaving links non-interactive. 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 5825743. Configure here.
| } | ||
| PanelWebViewController.present(url: url, from: self) | ||
| return false | ||
| } |
There was a problem hiding this comment.
All link interactions open panel, including long-press
Low Severity
The textView(_:shouldInteractWith:in:interaction:) delegate method presents the PanelWebViewController for all UITextItemInteraction types without checking the interaction parameter. This means a long-press (.presentActions) — which normally shows a context menu with "Copy Link", "Share", etc. — instead immediately opens the web panel. Users lose the ability to copy a URL from a note comment without fully loading the page.
Reviewed by Cursor Bugbot for commit 5825743. Configure here.
Improve link tap reliability in note cells, add web panel loading/error states, and centralize detected-link configuration for reuse. Co-authored-by: Cursor <cursoragent@cursor.com>


Problem
Go Map!! can display OpenStreetMap notes from the OSM Notes API. Note comments often contain plain-text URLs—for example links to StreetComplete photos or other mapping resources—but today those strings are shown as non-interactive text in the note history.
As a mapper, when I read an OSM note that includes a link, I want to tap the URL and view the page inside the app in a panel I can open and dismiss quickly, so I can check referenced photos or documentation without leaving the note context or switching to Safari for every link.
Implementation notes (by Cursor)
cursor/osm-notes-autolink-webview-panelNotesTableViewController.swiftUITextViewcells usedataDetectorTypes = [.link]sohttp/httpsURLs in comment text are detected and styled as tappable links (autolinker viaNSDataDetector).textView(_:shouldInteractWith:in:interaction:)intercepts link taps on history comments only and opens the URL in a panel instead of the system browser.PanelWebViewController.swift(new)WKWebViewpresented as.pageSheet.setUserAgent()on the initial request.SFSafariViewController; new-comment text field behavior is unchanged.Testing notes (@tordans)
https://…(e.g. a StreetComplete image URL). The URL should appear as a link-colored, tappable string in the comment bubble.Made with Cursor
Note
Low Risk
Scoped UI change on the notes screen with http/https-only interception; WKWebView loads user-supplied note URLs but mirrors existing external browsing risk with an in-app escape hatch to Safari.
Overview
OSM note history comments now auto-detect
http/httpsURLs and open them in a dismissible in-app sheet instead of leaving plain text or jumping straight to the system browser.NotesTableViewControllerwires historyUITextViewcells through a newUITextView+DetectedLinkshelper (configureForDetectedLinks/clearDetectedLinkson reuse), setsdelaysContentTouches = falseso links respond reliably in the table, and handlestextView(_:shouldInteractWith:…)only for history cells:http/httpstaps go toPanelWebViewController; other schemes and the new-comment field keep default behavior. Mapper username taps still useSFSafariViewController.PanelWebViewControlleris new:WKWebViewin a.pageSheetwith medium/large detents (iOS 15+), loading/error UI, Done, and Open in Safari, using the app’ssetUserAgent()on the initial load.URL.isHttpURLsupports the tap filter. Xcode project entries add the new sources.Reviewed by Cursor Bugbot for commit 762a583. Bugbot is set up for automated code reviews on this repo. Configure here.