From 4728af3658116f58776a70843e5fc85b4820ac1f Mon Sep 17 00:00:00 2001 From: fairy <3054158379@qq.com> Date: Wed, 30 Sep 2026 15:39:27 +0800 Subject: [PATCH 1/2] feat(workspace): allow creating a folder in the directory dialog macOS hides New Folder unless the open dialog sets createDirectory. Co-authored-by: Cursor --- src/main/index.ts | 2 +- test/directory-picker.test.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/index.ts b/src/main/index.ts index 8e109e0d3..7bb8487d4 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -3320,7 +3320,7 @@ async function bootstrap(): Promise { const result = await dialog.showOpenDialog(mainWindow, { title: harnessLocale() === 'zh' ? '选择工作区目录' : 'Select Workspace Directory', - properties: ['openDirectory'] + properties: ['openDirectory', 'createDirectory'] }) return result.canceled ? null : result.filePaths[0] ?? null }) diff --git a/test/directory-picker.test.ts b/test/directory-picker.test.ts index e024611c8..f37aaa89a 100644 --- a/test/directory-picker.test.ts +++ b/test/directory-picker.test.ts @@ -54,4 +54,12 @@ describe('desktop Electron directory picker', () => { expect(controller).toContain('static inject = ["directoryPicker"]') expect(controller).toContain('"directoryPickerController"') }) + + it('lets the workspace directory dialog create a folder on macOS', async () => { + const main = await readFile('src/main/index.ts', 'utf8') + const handlerStart = main.indexOf("ipcMain.handle('directory-picker:open'") + const handler = main.slice(handlerStart, main.indexOf('ipcMain.handle(', handlerStart + 1)) + + expect(handler).toContain("properties: ['openDirectory', 'createDirectory']") + }) }) From 43b9704a41e6d025fe349a1b8bd58489230280d2 Mon Sep 17 00:00:00 2001 From: fairy <3054158379@qq.com> Date: Wed, 30 Sep 2026 15:51:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(ci):=20=E7=94=A8=20UTF-8=20=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E7=AD=BE=E5=90=8D=E6=B5=8B=E8=AF=95=E6=91=98=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows 上 Path.read_text() 默认按 cp1252 解码,摘要里的中文会直接失败。 Co-authored-by: Cursor --- test/signed-test-build.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/signed-test-build.test.ts b/test/signed-test-build.test.ts index 6578e2395..654f894f6 100644 --- a/test/signed-test-build.test.ts +++ b/test/signed-test-build.test.ts @@ -58,7 +58,7 @@ with tempfile.TemporaryDirectory() as work: assert [e[0] for e in events] == ['upload', 'verify', 'notify'] assert events[0][1] == 'test/1.0.0-test.1/42/dsh-desktop-windows-x64-setup.exe' assert events[2][1] == {'test_build': True} - assert 'Windows x64' in (directory / 'summary').read_text() + assert 'Windows x64' in (directory / 'summary').read_text(encoding='utf-8') notify.reset_mock() api.upload_file.side_effect = RuntimeError('upload failed') try: