Repository navigation
feat(run): pin a choice as a Quicklink with an inline argument - #12
Merged
Merged
Conversation
The argument runs as the choice's value, so a pinned capture works like Quick Capture for any choice.
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.
Why
Quick Capture takes text inline, but only for one capture choice set in preferences. Any choice should be able to take text from root search the same way.
What changed
valuein the run-choice launch context.DirectChoicestarts the run withquickadd:interactive vars={"value": ...}. The vault relaunch path carries it too.src/lib/quicklink.tsbuilds the link. The placeholder is{argument | json-stringify}, placed as the raw JSON value inside the URL-encoded context. json-stringify quotes and escapes the text. Raycast then percent-encodes it, as it does every Quicklink argument.startInteractivetakes optionalvarsagain.Scope
{{VALUE}}gets the text and does not prompt for it. A pinned capture then runs with no window and ends with a HUD, like Quick Capture.{{VALUE}}ignores the text and prompts as usual. Checked over the CLI: e2e-template ({{VALUE:name}}) withvars={"value":"Grace Hopper"}still prompts for both fields, with nothing prefilled.Verification
idea & plan #tag [[Note]] "quoted" back\slash æøå 💡 100% +1 a=b.Output/Inbox.mdgot- text: <that text>\n, byte for byte. HUD: "Added to Output/Inbox.md".{argument | json-stringify | percent-encode}is encoded twice, because Raycast's default encoding still applies on top. The context then fails to parse and the command opens without it. The first attempt failed this way, so the link uses json-stringify alone.&,#, quotes, a backslash, and non-ASCII text. Mutation-checked: dropping the context encoding fails it.pnpm e2e:protocol: new case starts e2e-text withvars={"value": ...}and asserts the exact written line. All 13 pass.pnpm lint,pnpm test(74),tsc --noEmit,pnpm buildpass.