Skip to content

feat(run): pin a choice as a Quicklink with an inline argument - #12

Merged
chhoumann merged 1 commit into
mainfrom
pin-with-argument
Oct 5, 2026
Merged

chhoumann merged 1 commit into
mainfrom
pin-with-argument

Conversation

@chhoumann

Copy link
Copy Markdown
Owner

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

  • New action Pin as Quicklink with Argument next to Pin as Quicklink. Raycast asks for the text inline when you run the Quicklink.
  • The text arrives as value in the run-choice launch context. DirectChoice starts the run with quickadd:interactive vars={"value": ...}. The vault relaunch path carries it too.
  • src/lib/quicklink.ts builds 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.
  • startInteractive takes optional vars again.
  • README paragraph under Commands, one ARCHITECTURE sentence.

Scope

  • A choice with a plain {{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.
  • A choice without a plain {{VALUE}} ignores the text and prompts as usual. Checked over the CLI: e2e-template ({{VALUE:name}}) with vars={"value":"Grace Hopper"} still prompts for both fields, with nothing prefilled.
  • Pin as Quicklink and Copy Deeplink are unchanged.

Verification

  • Live in Raycast with the dev build: created the Quicklink for "Capture text" (e2e-text) from the list, ran it from root search with the argument idea & plan #tag [[Note]] "quoted" back\slash æøå 💡 100% +1 a=b. Output/Inbox.md got - text: <that text>\n, byte for byte. HUD: "Added to Output/Inbox.md".
  • Found live: {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.
  • Unit test: fills the placeholder the way Raycast does and parses the launch context back, with &, #, quotes, a backslash, and non-ASCII text. Mutation-checked: dropping the context encoding fails it.
  • pnpm e2e:protocol: new case starts e2e-text with vars={"value": ...} and asserts the exact written line. All 13 pass.
  • pnpm lint, pnpm test (74), tsc --noEmit, pnpm build pass.
  • Not verified live: the relaunch path when the vault was closed.

The argument runs as the choice's value, so a pinned capture works like
Quick Capture for any choice.
@chhoumann
chhoumann merged commit 5da2600 into main Oct 5, 2026
2 checks passed
@chhoumann
chhoumann deleted the pin-with-argument branch October 5, 2026 19:12
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