Skip to content

fix(tui): search files inside reference directory with @alias/#34173

Open
dsy122 wants to merge 4 commits into
anomalyco:devfrom
dsy122:fix/tui-reference-file-autocomplete
Open

fix(tui): search files inside reference directory with @alias/#34173
dsy122 wants to merge 4 commits into
anomalyco:devfrom
dsy122:fix/tui-reference-file-autocomplete

Conversation

@dsy122

@dsy122 dsy122 commented Jun 27, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #34106

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Configured references (like @docs) can't search files inside the reference directory — typing @docs/xxx shows "No matching results". The @ autocomplete was skipping file search entirely whenever a reference alias matched.

This PR removes the early return, and when the user has typed / after a reference alias, scopes the file search to the reference directory (via the existing fs.find API). @docs without / still attaches the reference root as before.

This behavior is described in the references documentation (docs: References) but was not yet implemented.

How did you verify your code works?

Configured "docs": "./packages/web/src/content/docs" in opencode.jsonc and ran bun dev . to test:

  • @docs → alias shown, selecting attaches the reference root directory
  • @docs/ with typed characters → file results from within the reference
  • @docs/references → fuzzy-searches references.mdx
  • @packages/ normal file search → unchanged
  • @agent names and /commands → unaffected

Screenshots / recordings

2026-06-27.12-48-46.mp4

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate PRs Found:

  1. PR fix(tui): autocomplete files inside references #34037 - fix(tui): autocomplete files inside references

    • Very closely related; addresses autocomplete for files inside references, which is the same feature area as this PR.
  2. PR fix(tui): search files inside references #33658 - fix(tui): search files inside references

    • Directly related; appears to be an earlier attempt at implementing file search within reference directories.

Both PRs address the same core issue: enabling file search/autocomplete inside reference directories (like @docs/). Check if #34037 or #33658 already resolve issue #34106, or if they take a different approach than this PR.

@dsy122

dsy122 commented Jun 27, 2026

Copy link
Copy Markdown
Author

#33658 and #34037 are addressing the same area. This PR takes a minimal, single-file approach — reuses existing referenceMatch() and fs.find API without adding new functions or changing backend code.

@dsy122 dsy122 marked this pull request as ready for review June 27, 2026 05:20
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.

Local directories is not working

1 participant