Repository navigation
Add directory creation to the folder picker - #981
Conversation
# Conflicts: # AGENTS.md
…g it - Creating a folder now opens it in the picker, so "Select this folder" stays the only commit point and nested folders work the same way. This drops the separate "Create and select" action. - "New directory" uses the secondary button style; the accent is reserved for selecting. - Keep the picker starting from the last validated custom path. Starting from the selected project was an unrelated behavior change that bypassed it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks @Ingress007! A "new folder" action in the picker is a small, useful addition. On a phone or a remote host it's otherwise hard to start a project in a fresh directory. The server side looks good: it goes through I pushed a few changes to keep it minimal:
Checked in the browser: create → lands in the new empty folder, a duplicate name shows the 409 message inline, and the outer picker stays open. Generated by Claude Code |
|
Thanks for the thoughtful review and refinements! I've synced the latest changes and tested them locally. The updated flow works well: creating a folder opens it in the picker, and selecting remains a separate explicit action. The styling, duplicate-name error handling, and remembered custom path all behave as expected. I have no issues with the changes—thanks again! |
6 处冲突都是"两边各加了不同东西"的纯追加,没有取舍:
- components/DirectoryPicker.tsx
import:我们加的 useMemo + 上游加的 type CSSProperties
状态:sortKey/sortDirection + createOpen/directoryName/createError/creating
- lib/directory-browser.ts
取上游新增的 isValidDirectoryName()/createDirectory()(同一插入点),
listDirectories 保留我们的返回类型 BrowsableDirectoryEntry[](多了 mtimeMs 供排序)
- lib/i18n/messages/{en,zh-CN,zh-TW}.ts
同一插入点:我们的 4 个 sort* 键 + 上游的 6 个 newDirectory* 键,两个并集
(上游的键放在前,我们的附在后面,减少以后上游再动这块时的冲突)
两块 UI 不互相遮挡:排序行在路径栏下方,上游的「新建目录」按钮在底部 footer
左侧(accent 仍只留给「选择此文件夹」)。route 的 POST 与请求校验自动合并。
验证:tsc/lint 通过;lib/directory-browser.test.mjs 6/6(含上游新增的
creates one direct child directory / new directory names cannot escape the
current directory);全量 npm test 仅剩 AGENTS.md 记录的 6 个已知失败。
解开 agegr#981 的 DirectoryPicker 冲突后,这一段(390e70f..f52fd84)实测 0 冲突: - agegr#992 移动端输入框停在键盘上方并给打字更多空间 - agegr#997 限制每客户端 SSE 积压 - agegr#1001 可配置发送键(Enter / Ctrl+Enter) - agegr#1006 从 pi 的 provider catalog 解析 discovery endpoint - agegr#1017 空闲关闭被禁用时回收 Stop 无法解除的运行 - agegr#1016 Stop 结束输出被幸存进程持住的命令 - agegr#1015 保留用户消息里输入的换行 - agegr#1019 在 Safari / iOS 16.2 上可加载(新增 browserslist,无新依赖)
* Add directory creation to the folder picker * refactor(directory-picker): open a created folder instead of selecting it - Creating a folder now opens it in the picker, so "Select this folder" stays the only commit point and nested folders work the same way. This drops the separate "Create and select" action. - "New directory" uses the secondary button style; the accent is reserved for selecting. - Keep the picker starting from the last validated custom path. Starting from the selected project was an unrelated behavior change that bypassed it. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: ingress <[email protected]> Co-authored-by: Alex Yang <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
* Add directory creation to the folder picker * refactor(directory-picker): open a created folder instead of selecting it - Creating a folder now opens it in the picker, so "Select this folder" stays the only commit point and nested folders work the same way. This drops the separate "Create and select" action. - "New directory" uses the secondary button style; the accent is reserved for selecting. - Keep the picker starting from the last validated custom path. Starting from the selected project was an unrelated behavior change that bypassed it. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: ingress <[email protected]> Co-authored-by: Alex Yang <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
Tests
node_modules/.bin/tsc --noEmit✅npm run lint✅main: 1296 passed, the same 9 failed, 2 skippedThe remaining failures are the existing Windows baseline; this change adds two passing tests and no new failures.