fix(windows): preserve Unicode workspace picker paths - #619
Conversation
JunkaiWang-TheoPhy
left a comment
There was a problem hiding this comment.
Reviewed the Unicode picker fallback against #522. The implementation keeps the normal Electron picker, detects inaccessible non-ASCII results, falls back to an isolated PowerShell/WinForms picker, carries the path through an ASCII Base64 UTF-16LE channel, and reuses the Unicode-safe picker afterward. Local focused tests: 72 passed; typecheck, build, and runtime-closure verification passed. CI is being run separately before merge.
|
Code review approved. I verified the focused Windows Unicode/workspace/Electron tests (72 passed), Desktop typecheck, build, and runtime-closure locally. The repository has not created a CI run for this fork PR yet; please approve/run the fork workflow from the PR page (or ask a maintainer to do so). I will recheck the required CI results before merge. |
Fixes #522.
Supersedes #616 after renaming the source branch to match the
fix/convention.Summary
dialog.showOpenDialogas the normal Windows workspace pickerNo upstream submodule files are changed, and the fix does not attempt to guess or reverse mojibake.
Flow
flowchart LR Electron[Electron folder picker] --> Check{Selected path exists?} Check -->|yes| Workspace[Workspace admission] Check -->|no, non-ASCII| Fallback[PowerShell / WinForms picker] Fallback --> Carrier[UTF-16LE Base64 carrier] Carrier --> WorkspaceReproduction evidence
The screenshots from #522 show
迅雷下载becomingѸ������before workspacerealpathand then failing withENOENT:The fallback was manually verified on Windows with both PowerShell 7 and the built-in Windows PowerShell 5.1. Both returned the exact path:
Verification
corepack yarn workspace dsh-plugin-desktop test tests/workspace-admission.spec.ts tests/windows-unicode-directory-picker.spec.ts tests/electron-runtime.spec.ts— 72 passedcorepack yarn workspace dsh-plugin-desktop typecheck— passedcorepack yarn workspace dsh-plugin-desktop build— passedcorepack yarn workspace dsh-plugin-desktop verify:closure— 201-node runtime graph passedA local full-suite run completed with 777 passed and 9 skipped. Seven existing symlink-fixture cases could not run because this Windows session lacks the
CreateSymbolicLinkprivilege; the focused and Electron runtime suites pass.