Repository navigation
Cbox 文件改名/移动 + 用量条·前端:菜单两项 + 重命名/移动弹窗 + 用量条布局 - #36
Merged
todosdev[bot] merged 3 commits intoNov 19, 2026
Merged
Conversation
- add rename and move to menu items in file table - implement rename dialog with basename selection and 409 conflict handling - implement move dialog with folder hierarchy tree and root option - rework usage bar to compact width and critical red state at >=90% - update zh/en locales and pass test suite and linters Checkpoint: 9QzawQWw5r8p0eGysOwmy
…d-7a5a-962d-71e032b3643b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PATCH /api/files/:id支持文件名修改与文件所属文件夹转移。Changes
web/src/components/workbench/):file-table.tsx:行内下拉菜单增加「重命名」(PencilIcon)与「移动到」(FolderInputIcon)菜单项及触发回调。rename-file-dialog.tsx:实现重命名弹窗,自动预填文件名并默认选中扩展名前缀;提交走filesApi.patch(id, { name });同名 409 冲突在弹窗内呈现错误提示且保持弹窗打开。move-file-dialog.tsx:实现移动弹窗,包含「根目录」与嵌套文件夹树选择器;标注并禁用文件当前所在文件夹;支持根目录拉取失败错误回显,提交走filesApi.patch(id, { folderId })。usage-bar.tsx:外层宽度收紧为sm:max-w-md紧凑卡片,单文件上限并入数字行作次要展示;使用率 ≥90% 时切换为红色填充(bg-destructive)。web/src/components/ui/,web/src/lib/):progress.tsx:为Progress新增可选indicatorClassName属性,便于注入警示背景色。api-types.ts&api.ts:增加PatchFileInput接口并在filesApi中暴露通用patch方法。web/src/pages/,web/src/locales/):workbench.tsx:集成重命名与移动弹窗状态管理、操作回调与列表刷新。zh.json&en.json:增补INVALID_FILENAME错误码翻译及重命名/移动对话框中英文本。workbench.test.tsx:新增改名选区、409 冲突内联错误、文件夹移动、根目录移动与用量条红色警示测试用例。Testing
pnpm test全量通过(worker 260 项用例、web 180 项用例全部通过,覆盖改名、选区、移动、409 拦截与用量告警)。pnpm lint、pnpm format:check、pnpm typecheck及pnpm build全部零报错零警告。