Skip to content

Reveal files from chat links and search artifacts by name/path - #529

Open
Rexarrior wants to merge 5 commits into
alphaXiv:mainfrom
Rexarrior:codex/file-links-524
Open

Rexarrior wants to merge 5 commits into
alphaXiv:mainfrom
Rexarrior:codex/file-links-524

Conversation

@Rexarrior

@Rexarrior Rexarrior commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes #524

Summary

  • Add context-menu actions to local file citations and recognized Markdown file links: open in the right-hand panel, copy the absolute path, and reveal in the OS file manager.

  • Bind filesystem actions to the source that actually supplied the preview (worktree, clone, artifacts, or absolute path). Preserve Git provenance; historical versions have no live filesystem actions, remote files have no local reveal, and a vanished selected worktree cannot silently fall back to another checkout.

  • Add artifact filename/relative-path search independent of the 2,000-entry tree cap, with cursor pagination. Selecting a result reveals it in the tree and opens its preview.

  • Show artifact root and selected-file paths with copy/reveal controls; add reveal to artifact file and folder menus. Search does not read file contents. No new dependencies.

  • Make slow searches resumable: pause after 5 seconds, ask before another 15 minutes, then ask again before removing the time limit. Keep traversal position, cancel obsolete searches, and limit physical search workers to two.

Test plan

  • cargo fmt --all --check and cargo clippy --all-targets --locked -- -D warnings.

  • cargo test --locked: 1,061 passed, 3 ignored (macOS; re-run after merging current main).

  • pnpm build (including i18n lint/typecheck), pnpm lint:styles, and pnpm test: 224 passed. Regenerated committed ui/dist.

  • Added 8 frontend tests and 6 Rust tests for preview-source mapping/menu wiring, tree insertion, remote/workspace guards, async clipboard timing, search beyond the listing cap, pagination, and symlink/worktree confinement.

  • Local browser smoke test on an isolated synthetic demo: citation and Markdown-link menus resolve different correct roots; historical links omit OS actions; artifact name search, result selection/preview, root/file path controls, and file/folder menus (including Shift+F10).

  • Confirmed a fixture absent from the truncated API listing (qa-524/bulk/entry-0044.txt) is found by UI search, selected in the tree, and previewed.

  • Review regressions: externally removing a selected search hit clears its row/preview; metadata failures mark results incomplete. In the real local UI, verified a timed pause over a large synthetic tree, continue-to-completion, and cancel without an automatic restart.

  • Automated tests cover both budget transitions, saved traversal state, lease expiry, and cancellation of late/in-flight responses. The 15-minute-to-unlimited transition was tested without waiting 15 minutes in the browser.

  • Merged upstream main at 951700e: preserved project-root reveal and source-aware file guards, added the new feature strings to the Japanese and Korean catalogs, and rebuilt committed ui/dist from the merged sources. A second build produced identical assets. Re-ran the full Rust/UI suites and verified artifact search, result selection/preview, path resolution, and the artifact file menu in the isolated dev UI. The copy-path action completed successfully in the embedded browser. Initial search budget remains 5 seconds.

Verification limits: remote behavior is covered by mocked frontend tests, not a new SSH end-to-end run. Finder's actual file-selection behavior was not verified because macOS automation permissions prevented observing it. Clipboard tests verify invocation timing, not browser-specific permission behavior. Windows/Linux OS integration was not run locally. Cancellation is cooperative: an already blocked filesystem syscall cannot be interrupted; no faulty network filesystem was exercised.

Screenshots

Captured from the isolated demo with synthetic files. In order: chat file menu; artifact search; artifact path details; artifact file menu; artifact folder menu.
chat-file-menu
artifact-search
artifact-path-details
artifact-file-menu
artifact-folder-menu

@greptile-apps

greptile-apps Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Adds file search and location resolution for artifacts.

The PR appears safe to merge, with non-blocking follow-ups for artifact search.

Findings

  1. P2 Deleted files stay visible ▶
  2. P2 Partial searches look complete ▶
  3. P2 Old searches keep running ▶
Fix with agent prompt
### Issue 1
ui/src/components/ArtifactsTab.tsx:550
After another process deletes or renames a file selected through search, `entries` keeps adding `selectedHit` back into the tree. The disappearance check then finds that saved entry even after the live listing refreshes, leaving the row and missing-file preview selected.

Check the saved hit against fresh file metadata and clear it when it no longer exists. Absence from the capped listing alone is not enough.

### Issue 2
src/local/files.rs:370-372
`search_dir` skips entries when `followed_metadata` returns `None`, but leaves `incomplete` false. That helper also hides failed metadata reads, not just intentionally excluded links. If an entry disappears during the walk or its metadata cannot be read, users get partial results without the warning.

Distinguish excluded links from read failures and mark the latter incomplete.

### Issue 3
src/local/files.rs:378-379
Every search walks the entire artifact tree, and abandoning the request does not stop that walk. The input starts another search after each 250 ms pause, so large folders can accumulate obsolete walks while users keep typing.

Add a cancellation or time budget to the walk and report unfinished searches through `incomplete`.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR adds file-link menus, absolute-path copy/reveal controls, and paginated artifact search beyond the tree's listing cap.

  • Filesystem actions follow the source that supplied the preview.
  • Historical files omit live filesystem actions, and remote files omit local reveal.
  • Non-blocking follow-ups concern stale search hits, hidden read failures, and searches that keep running after users change the query.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Link["Chat citation or recognized file link"] --> Preview["Resolve preview source"]
  Preview --> Checkout["Checkout"]
  Preview --> Artifact["Artifact"]
  Preview --> Absolute["Absolute path"]
  Preview --> History["Historical Git file"]
  Checkout --> Location["Resolve filesystem path"]
  Artifact --> Location
  Absolute --> Location
  History --> NoActions["No live filesystem actions"]
  Location --> Copy["Copy absolute path"]
  Location --> Reveal["Reveal locally only"]
  Search["Search artifact names and paths"] --> Page["Sorted page and cursor"]
  Page --> Select["Insert selected hit into tree"]
  Select --> Open["Open preview"]
Loading

Reviews (1) · Last reviewed commit: "Add source-aware file actions and artifa..."

Comment thread ui/src/components/ArtifactsTab.tsx Outdated
Comment thread src/local/files.rs Outdated
Comment thread src/local/files.rs Outdated

This branch has not been deployed

No deployments
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.

Reveal files from chat links and search artifacts by name

1 participant