Skip to content

fix(search): picker and drag handed out wrong paths for global search results - #23

Open
eliasfaltin wants to merge 1 commit into
Percius04:masterfrom
eliasfaltin:fix/search-result-paths
Open

fix(search): picker and drag handed out wrong paths for global search results#23
eliasfaltin wants to merge 1 commit into
Percius04:masterfrom
eliasfaltin:fix/search-result-paths

Conversation

@eliasfaltin

Copy link
Copy Markdown

Problem

A global search result (plocate/tracker3 index) lives in another folder and carries its absolute path, with name as the bare basename. Two places ignored that path and joined the basename onto NavState.currentPath instead:

  • FilePickerBar.submit() — the FileChooser portal answer.
  • ActionEngine.dragMimeDataFor() — the text/uri-list handed to a drop target.

So picking or dragging a search hit gave the receiving app a file that does not exist. Searching for clawd from ~ and picking ~/Downloads/clawd.svg answered file:///home/elias/clawd.svg. Omamail reported "That file could not be read" for every attachment chosen through search, whether by the portal picker or by drag and drop. Browsing to the folder and picking the same file worked, which hid the cause.

Solution

Both sites now resolve an entry with the existing Utils.entryPath(base, entry), which returns the absolute path for an indexed result and joinPath(base, name) for a normal listing or the recursive fallback. The rest of the code (thumbnails, open, reveal) already used it.

The picker also builds its URIs with Util.fileUrl instead of "file://" + path, so a space or # in a name is percent-encoded the way the drag source already did.

Verification

  • Reproduced with Omamail's Attach button (portal picker via omarchy-file-select) and with drag and drop from the search list; both now attach the right file.
  • Picking and dragging from a normal folder listing behave as before.
  • qmllint -I app/qml_modules on both files reports nothing.

… results

An indexed (plocate/tracker3) search result lives in another folder and
carries its absolute `path`. FilePickerBar.submit() and
ActionEngine.dragMimeDataFor() joined its basename onto currentPath
instead, so choosing or dragging a search hit gave the caller a file
that does not exist. Both now resolve entries with Utils.entryPath, and
the picker percent-encodes its URIs like the drag source already did.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T22:37:52.133148Z 5370e54 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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