From 6f748ad16696a3cb73e42e85b830b6717d98d465 Mon Sep 17 00:00:00 2001 From: QAyong Date: Thu, 8 Oct 2026 00:44:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(buddy):=20=E6=96=B0=E5=BB=BA=E7=A9=BA?= =?UTF-8?q?=E9=97=B4=E9=BB=98=E8=AE=A4=E4=BD=BF=E7=94=A8=E6=89=80=E9=80=89?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__tests__/useSpaceEditor.spec.ts | 23 +++++++++++++++++++ .../widgets/task-index/useSpaceEditor.ts | 2 ++ apps/website/src/en/guide/files-and-spaces.md | 2 ++ apps/website/src/guide/files-and-spaces.md | 2 ++ 4 files changed, 29 insertions(+) diff --git a/apps/buddy/src/modules/tasks/widgets/task-index/__tests__/useSpaceEditor.spec.ts b/apps/buddy/src/modules/tasks/widgets/task-index/__tests__/useSpaceEditor.spec.ts index c195e518..b759ffc9 100644 --- a/apps/buddy/src/modules/tasks/widgets/task-index/__tests__/useSpaceEditor.spec.ts +++ b/apps/buddy/src/modules/tasks/widgets/task-index/__tests__/useSpaceEditor.spec.ts @@ -24,6 +24,29 @@ function fixture() { } describe('space editing session', () => { + it('uses the selected folder name for a new space when the name is blank', async () => { + const f = fixture() + f.target.value = null + f.selectDirectory.mockResolvedValueOnce('C:\\work\\my-project\\') + + await f.editor.selectPrimaryDirectory() + + expect(f.editor.form.name).toBe('my-project') + expect(f.editor.form.primaryDirectory?.root).toBe('C:\\work\\my-project\\') + expect(f.editor.canSave.value).toBe(true) + }) + + it('keeps a manually entered new space name when selecting a folder', async () => { + const f = fixture() + f.target.value = null + f.editor.form.name = 'My workspace' + f.selectDirectory.mockResolvedValueOnce('/work/my-project') + + await f.editor.selectPrimaryDirectory() + + expect(f.editor.form.name).toBe('My workspace') + }) + it('preserves local input across a refresh of the same Space', () => { const f = fixture() f.editor.form.name = 'unsaved' diff --git a/apps/buddy/src/modules/tasks/widgets/task-index/useSpaceEditor.ts b/apps/buddy/src/modules/tasks/widgets/task-index/useSpaceEditor.ts index 56969c9c..acef33f6 100644 --- a/apps/buddy/src/modules/tasks/widgets/task-index/useSpaceEditor.ts +++ b/apps/buddy/src/modules/tasks/widgets/task-index/useSpaceEditor.ts @@ -56,6 +56,8 @@ export function useSpaceEditor(options: SpaceEditorOptions) { return const existing = options.space()?.additionalDirectories.find(directory => directory.root === selected) form.primaryDirectory = { id: existing?.id ?? null, root: selected } + if (!options.space() && !form.name.trim()) + form.name = selected.replace(/[\\/]+$/, '').split(/[\\/]/).pop() ?? '' } catch { if (current === session) diff --git a/apps/website/src/en/guide/files-and-spaces.md b/apps/website/src/en/guide/files-and-spaces.md index 4105b3c5..aacfb858 100644 --- a/apps/website/src/en/guide/files-and-spaces.md +++ b/apps/website/src/en/guide/files-and-spaces.md @@ -6,6 +6,8 @@ A space organizes related tasks. A local working directory is where files are ac Create spaces for writing, research, or personal projects, and keep related tasks together. Select a suitable working directory when a task needs local files. +When creating a space, if you select a working directory and leave the space name blank, Lexora uses the selected folder's name. You can also enter a different name. + A space is not a file permission, and it does not mean files have been uploaded to a cloud service. Access still depends on the task context and permissions you grant. ## Prepare the right material diff --git a/apps/website/src/guide/files-and-spaces.md b/apps/website/src/guide/files-and-spaces.md index 05d2711d..e84fcffa 100644 --- a/apps/website/src/guide/files-and-spaces.md +++ b/apps/website/src/guide/files-and-spaces.md @@ -6,6 +6,8 @@ 可以为写作、研究或个人项目建立空间,把相关任务放在一起。需要使用本地文件时,为任务选择适合的工作目录。 +新建空间时,如果选择了工作目录但没有填写空间名,Lexora 会使用所选文件夹的名称作为空间名;也可以自行填写其他名称。 + 空间不等于文件权限,也不代表文件已经上传到某个在线服务。访问哪些内容,仍取决于任务上下文与授权范围。 ## 给任务准备合适的材料 From d8d8f01d8aea1522d53e64bdd73761625bc3f6b8 Mon Sep 17 00:00:00 2001 From: shanyuhai123 <864299347@qq.com> Date: Thu, 8 Oct 2026 15:31:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20=E6=B8=85=E7=90=86=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/website/src/en/guide/files-and-spaces.md | 2 -- apps/website/src/guide/files-and-spaces.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/apps/website/src/en/guide/files-and-spaces.md b/apps/website/src/en/guide/files-and-spaces.md index aacfb858..4105b3c5 100644 --- a/apps/website/src/en/guide/files-and-spaces.md +++ b/apps/website/src/en/guide/files-and-spaces.md @@ -6,8 +6,6 @@ A space organizes related tasks. A local working directory is where files are ac Create spaces for writing, research, or personal projects, and keep related tasks together. Select a suitable working directory when a task needs local files. -When creating a space, if you select a working directory and leave the space name blank, Lexora uses the selected folder's name. You can also enter a different name. - A space is not a file permission, and it does not mean files have been uploaded to a cloud service. Access still depends on the task context and permissions you grant. ## Prepare the right material diff --git a/apps/website/src/guide/files-and-spaces.md b/apps/website/src/guide/files-and-spaces.md index e84fcffa..05d2711d 100644 --- a/apps/website/src/guide/files-and-spaces.md +++ b/apps/website/src/guide/files-and-spaces.md @@ -6,8 +6,6 @@ 可以为写作、研究或个人项目建立空间,把相关任务放在一起。需要使用本地文件时,为任务选择适合的工作目录。 -新建空间时,如果选择了工作目录但没有填写空间名,Lexora 会使用所选文件夹的名称作为空间名;也可以自行填写其他名称。 - 空间不等于文件权限,也不代表文件已经上传到某个在线服务。访问哪些内容,仍取决于任务上下文与授权范围。 ## 给任务准备合适的材料