Skip to content

ExtensionNode string params always open folder picker, ignoring pickerIntent: image #155

Description

@lucasromanomr

Bug

ExtensionNode always opens a folder picker for params with type: "string", ignoring the pickerIntent field that extension manifests use to request an image file picker.

Repro

Any extension manifest with a param like:

{
  "id": "front_image_path",
  "type": "string",
  "pickerIntent": "image",
  "filters": [{ "name": "Images", "extensions": ["png", "jpg", "jpeg", "webp"] }]
}

renders a text input with a folder-icon button. Clicking the button opens selectDirectory() regardless of pickerIntent or filters.

Source

src/areas/workflows/nodes/ExtensionNode.tsx lines 91-108:

if (param.type === "string") {
  return (
    <div className="flex items-center gap-1">
      <input ... />
      <button onClick={async () => {
        const p = await window.electron.fs.selectDirectory()
        if (p) onChange(p)
      }}>...</button>
    </div>
  )
}

The handler unconditionally calls selectDirectory(). There is no branch that consults param.pickerIntent.

Suggested fix

Honor pickerIntent: "image" (and other intents) by routing to an image picker. An image dialog already exists at electron/main/ipc-handlers.ts:197 (filters: [{ name: "Images", extensions: ["jpg","jpeg","png","webp"] }], properties: ["openFile"]).

const handler =
  param.pickerIntent === "image"
    ? window.electron.fs.selectImage   // expose the existing image dialog via preload
    : window.electron.fs.selectDirectory

<button onClick={async () => { const p = await handler(); if (p) onChange(p) }}>
  {param.pickerIntent === "image" ? <ImageIcon/> : <FolderIcon/>}
</button>

Impact

Affects every model/process extension that wants a file path param for an image (e.g. multi-view shape-gen extensions where the front/back/side images need explicit file paths). Without the fix, users must paste paths manually or rely on plugin-side workarounds (e.g. "if user picked a folder, scan for first image inside") -- both poor UX.

Happy to submit a PR if the direction looks right.

Activity

  1. Lorchie commented on May 26, 2026

    @Lorchie
    Collaborator

    +1 on the fix as proposed

  2. Lorchie commented on Oct 9, 2026

    @Lorchie
    Collaborator

    Fixed in #258 (shipped in v0.4.2). ExtensionNode now honors pickerIntent, so pickerIntent: "image" opens an image file picker instead of a folder picker.

    If you hit a case where the wrong picker still opens, feel free to reopen this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions