You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by zh...@apache.org on 2026/09/15 07:16:46 UTC

(maka) branch main updated: fix(desktop): exit WorkHub for project new task (#5195)

This is an automated email from the ASF dual-hosted git repository.

me2seeks pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/maka.git


The following commit(s) were added to refs/heads/main by this push:
     new 4409c28966 fix(desktop): exit WorkHub for project new task (#5195)
4409c28966 is described below

commit 4409c28966685873fcd72cd8341f1ff0423404a0
Author: Zhang <96...@users.noreply.github.com>
AuthorDate: Tue Sep 15 15:16:42 2026 +0800

    fix(desktop): exit WorkHub for project new task (#5195)
    
    Generated-by: OpenAI Codex
---
 apps/desktop/e2e-budget.json                              |  4 ++--
 apps/desktop/e2e/workhub-layout.spec.ts                   | 15 +++++++++++++++
 .../session-navigation/ui/session-navigation-provider.tsx |  5 ++++-
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/apps/desktop/e2e-budget.json b/apps/desktop/e2e-budget.json
index 03f9b87150..891da92d9e 100644
--- a/apps/desktop/e2e-budget.json
+++ b/apps/desktop/e2e-budget.json
@@ -78,8 +78,8 @@
       "electron": "a real Host history batch crosses preload during a native scrollbar drag; cold content must remain readable while held and after release, then return to latest reads the Host tail"
     },
     "workhub-layout.spec.ts": {
-      "tests": 2,
-      "electron": "WorkHub model configuration and attachment sending cross the Host boundary; the compact native window grows only with the inline composer wheel and keeps its bottom anchor, and pointer dragging scrolls the no-drag wheel instead of moving the frameless window; native floating preserves macOS Dock visibility; a held-open Host Turn verifies immediate prompt visibility, durable transcript handoff and persistence after renderer reload"
+      "tests": 3,
+      "electron": "WorkHub model configuration and attachment sending cross the Host boundary; the Project New task action must dismiss the native dock owned by a separate WebContentsView; the compact native window grows only with the inline composer wheel and keeps its bottom anchor, and pointer dragging scrolls the no-drag wheel instead of moving the frameless window; native floating preserves macOS Dock visibility; a held-open Host Turn verifies immediate prompt visibility, durable tr [...]
     },
     "workhub-reconstruction.spec.ts": {
       "tests": 1,
diff --git a/apps/desktop/e2e/workhub-layout.spec.ts b/apps/desktop/e2e/workhub-layout.spec.ts
index ed953639a8..85bba7036d 100644
--- a/apps/desktop/e2e/workhub-layout.spec.ts
+++ b/apps/desktop/e2e/workhub-layout.spec.ts
@@ -442,3 +442,18 @@ test('WorkHub keeps the submitted prompt visible while its agent is still runnin
   await workhub.getByRole('button', { name: /发送|Send/, exact: true }).click();
   await expect(workhub.getByText('Fake backend received: Reply after renderer recovery')).toBeVisible();
 });
+
+test('project menu exits WorkHub before starting a new task', async ({ projectSidebarWindow: page }) => {
+  await page.keyboard.press('Escape');
+  await page.evaluate(() => window.maka.settings.updateClient({ workHub: { enabled: true } }));
+  await expect(page.locator('.workHubDock')).toBeVisible();
+
+  const sidebar = page.getByRole('navigation', { name: '任务列表' });
+  await sidebar.getByRole('radio', { name: '按项目', exact: true }).click();
+  await page.getByRole('button', { name: '示例项目 项目操作', exact: true }).click();
+  await page.getByRole('menuitem', { name: '新建任务', exact: true }).click();
+
+  await expect(page.locator('.workHubDock')).toBeHidden();
+  await expect(page.locator(COMPOSER_INPUT)).toBeFocused();
+  await expect(page.locator('[data-turn-id]')).toHaveCount(0);
+});
diff --git a/apps/desktop/src/renderer/features/session-navigation/ui/session-navigation-provider.tsx b/apps/desktop/src/renderer/features/session-navigation/ui/session-navigation-provider.tsx
index f9e0799b89..ccee20a31b 100644
--- a/apps/desktop/src/renderer/features/session-navigation/ui/session-navigation-provider.tsx
+++ b/apps/desktop/src/renderer/features/session-navigation/ui/session-navigation-provider.tsx
@@ -135,7 +135,10 @@ export function SessionNavigationProvider(props: SessionNavigationProviderProps)
     () =>
       hasProjectActions
         ? {
-            onNew: (projectId) => chromeRef.current.projectActions?.onNew(projectId),
+            onNew: (projectId) => {
+              chromeRef.current.onExitWorkHub();
+              return chromeRef.current.projectActions?.onNew(projectId);
+            },
             onRename: (projectId, name) =>
               chromeRef.current.projectActions?.onRename(projectId, name),
             onArchive: (projectId) => chromeRef.current.projectActions?.onArchive(projectId),


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org