Skip to content

fix(desktop): 修复粘贴附件保存到错误的工作区目录#3600

Merged
esengine merged 1 commit into
esengine:main-v2from
Li-Charles-One:fix/pasted-attachment-workspace-path
Jun 8, 2026
Merged

fix(desktop): 修复粘贴附件保存到错误的工作区目录#3600
esengine merged 1 commit into
esengine:main-v2from
Li-Charles-One:fix/pasted-attachment-workspace-path

Conversation

@Li-Charles-One

@Li-Charles-One Li-Charles-One commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

, \attachments, name))。cwd 在启动时从 \desktop-workspace\ 设置一次,当用户切换到不同项目的标签页时不会更新。

当前活动标签页的正确工作区根目录可以通过 \App.activeWorkspaceRoot()\ 获取(已被 \LoadConfig\ 等多个方法使用),但这两个方法没有使用它。

修复方案

在写入附件前,先 \os.Chdir\ 到活动标签页的 \WorkspaceRoot\,然后通过 defer 恢复原始 cwd。有优雅降级处理——如果 \�ctiveWorkspaceRoot()\ 返回 \\ 或 \.\,或者 chdir 失败,会保留原有行为。

@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) and removed v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 8, 2026
@Li-Charles-One Li-Charles-One force-pushed the fix/pasted-attachment-workspace-path branch from c777f52 to 9db6228 Compare June 8, 2026 14:05
@Li-Charles-One Li-Charles-One changed the title fix: pasted attachments saved to wrong workspace directory fix(desktop): 修复粘贴附件保存到错误的工作区目录 Jun 8, 2026
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 8, 2026
@esengine esengine merged commit d4422b6 into esengine:main-v2 Jun 8, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants