[PR #8186] fix(web): open project dialog not showing directories #12650

Closed
opened 2026-02-16 18:17:33 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8186

State: closed
Merged: No


Summary

  • Fix "Open project" dialog showing "No folders found" in web mode
  • Related to #6307 (closed but fix was incomplete)

Problem

Three issues prevented the Open Project dialog from working:

  1. Server: query parameter was required but SDK sends empty string as undefined, causing 400 Bad Request
  2. Server: directory parameter was ignored, always searching current project directory instead of home
  3. UI: useFilteredList hook didn't properly handle async items function, causing Promise to be used as array

Changes

packages/opencode/src/server/server.ts

  • Make query parameter optional with default empty string
  • Add directory parameter support to /find/file endpoint
  • Implement directory scanning when directory param is provided (2 levels deep)

packages/ui/src/hooks/use-filtered-list.tsx

  • Fix createResource source function to not call async functions synchronously
  • Properly await async items function in fetcher

packages/app/src/components/dialog-select-directory.tsx

  • Add null-safety to filter.trim() call

Testing

Tested locally with opencode web - dialog now shows home directories and search works correctly.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8186 **State:** closed **Merged:** No --- ## Summary - Fix "Open project" dialog showing "No folders found" in web mode - Related to #6307 (closed but fix was incomplete) ## Problem Three issues prevented the Open Project dialog from working: 1. **Server**: `query` parameter was required but SDK sends empty string as `undefined`, causing 400 Bad Request 2. **Server**: `directory` parameter was ignored, always searching current project directory instead of home 3. **UI**: `useFilteredList` hook didn't properly handle async items function, causing Promise to be used as array ## Changes ### `packages/opencode/src/server/server.ts` - Make `query` parameter optional with default empty string - Add `directory` parameter support to `/find/file` endpoint - Implement directory scanning when `directory` param is provided (2 levels deep) ### `packages/ui/src/hooks/use-filtered-list.tsx` - Fix `createResource` source function to not call async functions synchronously - Properly await async items function in fetcher ### `packages/app/src/components/dialog-select-directory.tsx` - Add null-safety to `filter.trim()` call ## Testing Tested locally with `opencode web` - dialog now shows home directories and search works correctly.
yindo added the pull-request label 2026-02-16 18:17:33 -05:00
yindo closed this issue 2026-02-16 18:17:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12650