Skip to content

Clip a shared page when its address arrives as text beside the link. - #486

Merged
cdeutsch merged 3 commits into
mainfrom
cursor/critical-bug-remediation-2766
Nov 12, 2026
Merged

cdeutsch merged 3 commits into
mainfrom
cursor/critical-bug-remediation-2766

Conversation

@cursor

@cursor cursor Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Some iOS apps share a page as a link and send its address again as text, sometimes a different host for the same article. The share extension drops that second address so the share stays a page to clip. It already did when the text item also registers public.url, which is what NSItemProvider(object: NSString) does: kind(of:) takes that item for a link, and the offeredLinks filter drops it. An app whose item registers only plain text slipped past: that item is text, its address landed in the body beside the link, and two links is not a lone web address, so the share was saved as a plain note instead of being clipped.

Drop a line that is itself a lone address when a link is present. Words beside a link still stay as the note's body. Two links both offered as links still stay.

testAnAddressOfferedOnlyAsPlainTextBesideTheLinkIsTheSamePage builds a provider that registers only UTF-8 plain text, and fails without the new line. The two tests the first commit cites (testAnAddressSharedAsTextBesideTheLinkIsTheSamePage, testTheSameLinkSharedThriceBesideAnotherAddressIsOneLink) build their text with NSItemProvider(object:), so they passed before this change too. The first commit's message gives the cause the old way; the comment in the code and the commits after it are the accurate account.

swift test --package-path apps/ios/Packages/UnbentCore: 197 tests pass on the Mac. They are not run in CI.

Open in Web View Automation 

Note

Medium Risk
Changes share-extension staging rules that decide page clip vs note; behavior is user-visible but limited to iOS capture intake.

Overview
Fixes iOS share intake so a link plus a duplicate URL sent only as plain text still counts as a single page to clip, instead of a two-link note.

When a share includes a link, CaptureStager.stage now drops any text line that is only a lone http(s) address (lines.removeAll { CaptureNaming.isLonePageUrl($0) }), in addition to the existing offeredLinks dedupe. URLs that arrive as .text (plain-text–only providers) were previously left in the body; mixed text with a URL or two distinct link items are unchanged.

Adds testAnAddressOfferedOnlyAsPlainTextBesideTheLinkIsTheSamePage, using a provider registered only for UTF-8 plain text to assert the intake still exposes one URL and pageUrl.

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

cursoragent and others added 3 commits November 12, 2026 11:10
Some apps share a page as a link and send its address again as plain text, sometimes a different host for the same article. The share extension was meant to drop the text address so the share stayed a page to clip. It only filtered `links`, and a string item is classified as text, so the address stayed in the body. Two links is not a lone web address, and the share was saved as a plain note.

Drop a line that is itself a lone address when a link is present. Words beside a link still stay. Two links both offered as links still stay. The tests in CaptureIntakeTests already describe this case; they are not run in CI.

Co-authored-by: git <git@cdeutsch.com>
… for.

The comment over the new filter said a string item is never a `public.url` and is classified as text. That is not so: `NSItemProvider(object: NSString)` registers `public.url` beside the plain text, `kind` returns `.link` for it, and the `offeredLinks` filter already dropped it. The comment also contradicted the one at the top of `stage`. A reader trusting it would have taken `offeredLinks` for redundant and removed it.

The filter is still right, for the case it really covers: a provider that registers only plain text holding an address, which is a `.text` and lands in `lines`, out of `offeredLinks`' reach. The comment now says that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two tests the lone-address filter was written for build their text item with `NSItemProvider(object: NSString)`, which registers `public.url` too and is a `.link`, so they passed before the filter existed and would pass if it were removed. A provider that registers only plain text is the case the filter changes: without it the body is both addresses and the share is not clipped. This test builds that provider and fails without the filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cdeutsch
cdeutsch merged commit 0dde966 into main Nov 12, 2026
7 checks passed
@cdeutsch
cdeutsch deleted the cursor/critical-bug-remediation-2766 branch November 12, 2026 18:43
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.

2 participants