Skip to content

feat(new-session): browse for the directory instead of typing it - #42

Merged
devswha merged 1 commit into
mainfrom
feat/directory-browser
Sep 25, 2026
Merged

devswha merged 1 commit into
mainfrom
feat/directory-browser

Conversation

@devswha

@devswha devswha commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Summary

The new-session dialog only took the directory as typed text. A Browse button now sits beside the field and opens a folder list:

  • Parent (↑) and home buttons
  • the current path, where a long one keeps its end in view
  • the folders inside, each opened with a click
  • Show hidden
  • Use this folder, which fills the field, in ~/… form inside home

Server: GET /api/workspace/directories?path=&hidden=1 lists the folders in one directory (server/directories.ts).

  • What counts: links to folders are included. Files, dangling links and dot-folders are left out, and dot-folders only while hidden ones aren't asked for.
  • Order and limit: folders are sorted naturally (api2 before api10) and capped at 500, with a truncated flag.
  • Paths: it takes an absolute path, ~ or ~/…. An empty path means home.
  • Memory: nothing is kept between calls. Each folder you open costs one readdir, on demand.
  • Remote PCs: the endpoint lives under /api/workspace/, so it is bridge-authorised and proxied to remote PCs (it was added to MACHINE_PROXY_PATH). An older remote bridge answers 404, and the browser then says to type the path.

Testing

  • Unit tests:
    • Folders only, in natural order, following links to folders.
    • Hidden folders appear only on request.
    • ~ and an empty path open home, and / has no parent.
    • A file or a missing path gives null.
    • The 500 cap sets truncated.
  • Browser, desktop and a 390×844 phone:
    1. Typed a temp root and opened Browse.
    2. Went into projects and back up, then turned on Show hidden (.config appeared).
    3. Went into projects/checkout-api and clicked Use this folder: the field got that path and the list closed.
    4. On desktop, Start session created the workspace in that folder.
    • No page errors.
  • bun run typecheck passes, bun test passes 315/315, and bun run test:ui passes 7/7.

🤖 Generated with Claude Code

The new-session dialog took the directory as typed text only. A Browse
button beside the field opens a folder list: parent and home buttons, the
current path (its end kept in view), the folders inside, Show hidden, and
Use this folder, which fills the field (as ~/… inside home).

GET /api/workspace/directories?path=&hidden=1 lists one directory's
folders (links to folders count; files, dangling links and, by default,
dot-folders do not), naturally sorted and capped at 500. It keeps nothing
between calls: the cost is one readdir, on demand. It lives under
/api/workspace/, so it is bridge-authorised and proxied to remote PCs; an
older remote bridge answers 404 and the browser says to type the path.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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