Fall back to copy-to-clipboard for oversized plugin deeplinks#387
Merged
Conversation
The Add to Cursor button generates cursor:// URLs that embed the entire
rule or command content in the text= query param. For content beyond a
few KB the resulting URL exceeds practical limits of OS protocol handlers
and Cursor's own URL parser, producing two failure modes the user can
hit in the wild: the protocol handler silently drops the dispatch ("no
action"), or it truncates mid %XX sequence and Cursor's decodeURIComponent
throws ("URI malformed").
Above an 8000-char URL threshold we now render the existing CopyButton
instead of a broken Add to Cursor link, with a tooltip that explains the
fallback. The threshold was picked empirically: a 4.6KB rule that produces
a ~6.5KB URL is reported to install fine, while 15KB+ rules consistently
fail. Long-term the editor side should accept either base64 (matching
the MCP install path) or token references so very large rules can install
without copy-paste.
Closes #363.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Add to Cursor button generates cursor:// URLs that embed the entire rule or command content in the text= query param. For content beyond a few KB the resulting URL exceeds practical limits of OS protocol handlers and Cursor's own URL parser, producing two failure modes the user can hit in the wild: the protocol handler silently drops the dispatch ("no action"), or it truncates mid %XX sequence and Cursor's decodeURIComponent throws ("URI malformed").
Above an 8000-char URL threshold we now render the existing CopyButton instead of a broken Add to Cursor link, with a tooltip that explains the fallback. The threshold was picked empirically: a 4.6KB rule that produces a ~6.5KB URL is reported to install fine, while 15KB+ rules consistently fail. Long-term the editor side should accept either base64 (matching the MCP install path) or token references so very large rules can install without copy-paste.
Closes #363.
Note
Low Risk
Low risk UI behavior change that only affects client-side install links; main risk is the chosen URL-length threshold potentially misclassifying edge cases.
Overview
Prevents broken “Add to Cursor” actions for very large rules/commands by introducing a
MAX_DEEPLINK_URL_LENGTH(8000) guard.When a generated
cursor://deeplink exceeds the limit, the UI now renders aCopyButton(with an explanatory tooltip) instead of the deeplink, while keeping the normal deeplink flow for smaller payloads.CopyButtonwas extended to accept an optionaltitlefor the tooltip.Reviewed by Cursor Bugbot for commit 39da865. Bugbot is set up for automated code reviews on this repo. Configure here.