Skip to content

feat(browse): return files alongside directories in /api/browse - #546

Open
RonenMars wants to merge 1 commit into
mainfrom
feat/browse-return-files
Open

feat(browse): return files alongside directories in /api/browse#546
RonenMars wants to merge 1 commit into
mainfrom
feat/browse-return-files

Conversation

@RonenMars

Copy link
Copy Markdown
Owner

What

listDirectories filtered readdir to isDirectory, so /api/browse never surfaced files and the mobile Explorer could only ever show folders.
This adds a sibling listFiles helper and includes its result as a files array in the /api/browse response, read in parallel with directories.

Why

The mobile Explorer wants to display files (view-only) so a user can see a folder's contents before starting a session.
Directories alone were not enough context.

Shape

/api/browse now returns { path, directories, files }.
The files field is additive, so existing directories-only clients keep working unchanged.

Tests

__tests__/browse.test.ts gains listFiles coverage (sorted, excludes directories, empty case) plus an assertion that listDirectories excludes files.
vitest run __tests__/browse.test.ts — 21/21 pass; tsc --noEmit — 0 errors.

listDirectories filtered readdir to isDirectory, so the browse endpoint never surfaced files and the mobile Explorer could only show folders.
Add a sibling listFiles helper and include its result as a `files` array in the /api/browse response, read in parallel with directories.
The field is additive, so existing directories-only clients keep working unchanged.
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