Skip to content

fix(web): 拆分 Electron 工作区目录选择与全局工作目录切换#699

Open
Yumiue wants to merge 1 commit into
1024XEngineer:mainfrom
Yumiue:codex/gateway-plan-approval-rpc
Open

fix(web): 拆分 Electron 工作区目录选择与全局工作目录切换#699
Yumiue wants to merge 1 commit into
1024XEngineer:mainfrom
Yumiue:codex/gateway-plan-approval-rpc

Conversation

@Yumiue
Copy link
Copy Markdown
Collaborator

@Yumiue Yumiue commented May 26, 2026

Summary

  • 新增 pickWorkspaceDirectory(),作为 Electron 新建工作区弹窗专用的无副作用目录选择入口
  • 新建工作区弹窗改用 pickWorkspaceDirectory(),不再复用会修改全局 workdirselectWorkdir()
  • 补齐浏览器模式、Electron 选择目录、取消选择、提交创建工作区的回归测试

Changes

  • RuntimeProvider

    • 新增 pickWorkspaceDirectory(): Promise<string | null>
    • Electron 模式下调用 window.electronAPI.pickDirectory()
    • 选择成功返回路径;取消、异常、浏览器模式返回 null
    • 不修改全局 workdir,不调用 selectWorkdir()
  • Sidebar

    • 新建工作区弹窗改用 runtime.pickWorkspaceDirectory
    • Electron 取消目录选择时保持输入框原值并保持弹窗打开
    • Electron 选择目录时只填充弹窗本地路径输入框
    • “浏览”按钮补充 type="button"
  • Tests

    • 覆盖浏览器模式不展示“浏览”按钮
    • 覆盖 Electron 选择目录后填入路径
    • 覆盖 Electron 取消选择后不回填旧路径
    • 覆盖创建工作区时才调用 createWorkspace

Validation

  • npm test -- RuntimeProvider.lifecycle.test.tsx Sidebar.test.tsx
  • npm test
  • npm run verify:electron-preload
  • npm run build

Notes

  • 不改 Electron preload API,继续复用 window.electronAPI.pickDirectory()
  • 不新增 Gateway RPC
  • 不改 internal/gatewayinternal/runtimeinternal/toolsinternal/session

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@fennoai
Copy link
Copy Markdown

fennoai Bot commented May 26, 2026

Review completed. No noteworthy issues found across code quality, performance, security, and documentation accuracy passes.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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