fix: reslove issue of not showing file and dirs list in the opencode … - #34894
fix: reslove issue of not showing file and dirs list in the opencode …#34894jashandeep31 wants to merge 1 commit into
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
…code web
Issue for this PR
Fixes #34675
Type of change
What does this PR do?
In the current version of the web package, in the file (https://github.com/anomalyco/opencode/blob/dev/packages/app/src/components/dialog-select-directory.tsx), it uses/home as the default directory to fetch all the directories under it. But due to the large number of subfiles, folder search.ts (https://github.com/anomalyco/opencode/blob/dev/packages/core/src/filesystem/search.ts) throws a "too many files" error.
So instead of using the /home dir as the default, I have moved the opencode serve dir as the default by simply changing the order. Now by default it looks for the opecode serving project dir, not the /home dir
What is the issue?
When we start the opencode web command and try to open up the new project from the directory explorer dialog. It doesn't show any file or folder to select. The request fails silently, no error, nothing, just a blank response from the backend.
How did I fix it?
The reason for the blank response is the search.ts file tagged above. It has a function
fffWhich simply doesn't run when the list of subfolders and files is too rich. Infact there is flag to disable beharvious which fixes this issue.OPENCODE_DISABLE_FFF=1 npm run dev -- serve --port 4096, but then it reduces the performance.To keep up with the performance, I have made a tweak in the directory list dialog. Now, instead of asking for the directories in the /home, it asks for directories and files from the path in which the
opencode webcommand was used.How did you verify your code works?
By testing it manually locally, as there are no test cases that cover this issue.
Screenshots / recordings
Working screenshot with no query input in the affected version shows an empty list, which you can check in the issue.

Searching from the /root or /home dir still works

Checklist