MCPcopy
hub / github.com/anomalyco/opencode / pick

Function pick

packages/app/src/components/prompt-input.tsx:505–518  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

503 const escBlur = () => platform.platform === "desktop" && platform.os === "macos"
504
505 const pick = () => {
506 pickAttachmentFiles({
507 picker: platform.openAttachmentPickerDialog,
508 directory: () => sdk().directory,
509 fallback: () => fileInputRef?.click(),
510 onFile: addAttachment,
511 onError: (error) =>
512 showToast({
513 variant: "error",
514 title: language.t("common.requestFailed"),
515 description: error instanceof Error ? error.message : String(error),
516 }),
517 })
518 }
519
520 const setMode = (mode: "normal" | "shell") => {
521 setStore("mode", mode)

Callers 1

handleKeyDownFunction · 0.70

Calls 3

pickAttachmentFilesFunction · 0.90
showToastFunction · 0.90
sdkFunction · 0.85

Tested by

no test coverage detected