You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by as...@apache.org on 2026/09/23 02:14:48 UTC
(maka) branch main updated: fix(desktop): remove the global Back to WorkHub bar (#5604)
This is an automated email from the ASF dual-hosted git repository.
Astro-Han 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 811e45fc54 fix(desktop): remove the global Back to WorkHub bar (#5604)
811e45fc54 is described below
commit 811e45fc5409c1e17d5266da57cbd645a1ca837f
Author: AstroHan <le...@outlook.com>
AuthorDate: Wed Sep 23 10:14:43 2026 +0800
fix(desktop): remove the global Back to WorkHub bar (#5604)
Every ordinary Session rendered a full-width "Back to WorkHub" button
above its composer whenever WorkHub was enabled, whether or not the
Session had anything to do with WorkHub. Users reported it as a stray,
misplaced strip. The sidebar already has a WorkHub entry, so the bar was
redundant navigation.
Remove the control, its style and copy. Drop the E2E that asserted the
bar's geometry; returning to WorkHub through the sidebar with the draft
preserved is already covered by workhub-layout.spec.ts. The remaining
pending-question test moves to workhub-pending-question.spec.ts.
Generated-by: Claude Code
---
apps/desktop/e2e-budget.json | 6 +-
apps/desktop/e2e/workhub-pending-question.spec.ts | 45 +++++++++
apps/desktop/e2e/workhub-return-rail.spec.ts | 101 ---------------------
apps/desktop/renderer-architecture.json | 2 +-
apps/desktop/src/renderer/app-shell.tsx | 6 +-
.../desktop/src/renderer/features/workhub/index.ts | 1 -
.../renderer/features/workhub/ui/return-button.tsx | 34 -------
apps/desktop/src/renderer/locales/shell-copy.ts | 7 +-
apps/desktop/src/renderer/styles/composer.css | 9 --
docs/astryx-surface-file-inventory.md | 3 +-
docs/astryx-surface-file-inventory.paths | 1 -
11 files changed, 54 insertions(+), 161 deletions(-)
diff --git a/apps/desktop/e2e-budget.json b/apps/desktop/e2e-budget.json
index 42fe0efc73..4099c08f45 100644
--- a/apps/desktop/e2e-budget.json
+++ b/apps/desktop/e2e-budget.json
@@ -77,9 +77,9 @@
"tests": 1,
"electron": "the same WebContentsView and unsent draft survive reparenting between native main and floating windows, shared appearance changes and the explicit return-from-picture-in-picture button"
},
- "workhub-return-rail.spec.ts": {
- "tests": 2,
- "electron": "WorkHub lives in a separate native WebContentsView: open a Session and return through the shell while retaining the same WorkHub draft; a Host-backed pending question survives renderer reload and native detach/dock with its selection and focus"
+ "workhub-pending-question.spec.ts": {
+ "tests": 1,
+ "electron": "a Host-backed pending question survives renderer reload and native detach/dock with its selection and focus"
},
"zh-tw-locale.spec.ts": {
"tests": 1,
diff --git a/apps/desktop/e2e/workhub-pending-question.spec.ts b/apps/desktop/e2e/workhub-pending-question.spec.ts
new file mode 100644
index 0000000000..c8e40da6a4
--- /dev/null
+++ b/apps/desktop/e2e/workhub-pending-question.spec.ts
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { FAKE_ASK_USER_QUESTION_PROMPT } from '@maka/runtime/test-only/fake-backend';
+import { awaitSendReady, COMPOSER_INPUT, expect, test, getWorkHubPage } from './fixtures';
+
+test('a pending WorkHub question preserves docked placement, choices and focus across window transitions', async ({ sessionLocalWindow: { page, app } }) => {
+ await page.evaluate(() => window.maka.settings.updateClient({ workHub: { enabled: true } }));
+ const hub = await getWorkHubPage(app);
+ await hub.locator(COMPOSER_INPUT).fill(FAKE_ASK_USER_QUESTION_PROMPT);
+ await awaitSendReady(hub);
+ await hub.locator(COMPOSER_INPUT).press('Enter');
+ await expect(hub.getByRole('option', { name: /公开测试/ })).toBeVisible();
+ await expect(hub.locator('.workHubLive')).toHaveAttribute('data-placement', 'docked');
+ // Reload rehydrates the pending question through Host interaction queries.
+ await hub.reload();
+ const choice = hub.getByRole('option', { name: /公开测试/ });
+ await expect(choice).toBeVisible();
+ await expect(hub.locator('.workHubLive')).toHaveAttribute('data-placement', 'docked');
+ await choice.click();
+ await app.evaluate(async ({ app }) => { if (process.platform === 'darwin') await app.dock!.show(); });
+ await hub.evaluate(() => window.maka.workHubPresentation.detach());
+ await expect(hub.locator('.workHubLive')).toHaveAttribute('data-placement', 'floating');
+ await expect(choice).toHaveAttribute('aria-selected', 'true');
+ await expect.poll(() => hub.locator('.maka-choice-panel').evaluate((panel) => panel.contains(document.activeElement))).toBe(true);
+ await hub.evaluate(() => window.maka.workHubPresentation.dock());
+ await expect(hub.locator('.workHubLive')).toHaveAttribute('data-placement', 'docked');
+ await expect(choice).toHaveAttribute('aria-selected', 'true');
+});
diff --git a/apps/desktop/e2e/workhub-return-rail.spec.ts b/apps/desktop/e2e/workhub-return-rail.spec.ts
deleted file mode 100644
index 4f3201aa98..0000000000
--- a/apps/desktop/e2e/workhub-return-rail.spec.ts
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { FAKE_ASK_USER_QUESTION_PROMPT } from '@maka/runtime/test-only/fake-backend';
-import type { Page } from '@playwright/test';
-import { awaitSendReady, COMPOSER_INPUT, expect, test, getWorkHubPage } from './fixtures';
-
-async function sendPrompts(page: Page, prefix: string) {
- for (let index = 1; index <= 3; index++) {
- const text = `${prefix} ${index}`;
- await page.locator(COMPOSER_INPUT).fill(text);
- await awaitSendReady(page);
- await page.locator(COMPOSER_INPUT).press('Enter');
- await expect(page.getByText(`Fake backend received: ${text}`, { exact: true })).toBeVisible();
- await expect(page.getByRole('button', { name: '停止', exact: true })).toHaveCount(0);
- }
- await expect(page.locator('.maka-prompt-rail [data-prompt-turn-id]')).toHaveCount(3);
- await expect(page.locator('.maka-prompt-rail')).toBeVisible();
-}
-
-test('Session keeps a return to WorkHub control when the sidebar is collapsed', async ({ sessionLocalWindow: { page, app } }, testInfo) => {
- await page.setViewportSize({ width: 1600, height: 900 });
- await sendPrompts(page, 'Return navigation');
- await page.evaluate(() => window.maka.settings.updateClient({ workHub: { enabled: true } }));
- const workhub = await getWorkHubPage(app);
- await workhub.locator(COMPOSER_INPUT).fill('Keep my WorkHub draft');
- const sessionName = await workhub.locator('.workhub-navigation-label').first().innerText();
- await workhub.locator('.workhub-navigation-item').first().click();
- await expect(page.locator('.workHubDock')).toBeVisible();
- const expand = page.getByRole('button', { name: '展开侧边栏', exact: true });
- if (await expand.isVisible()) await expand.click();
- await page.getByRole('button').filter({ has: page.getByText(sessionName, { exact: true }) }).click();
- await expect(page.locator('.workHubDock')).toBeHidden();
- const collapse = page.getByRole('button', { name: '收起侧边栏', exact: true });
- if (await collapse.isVisible()) await collapse.click();
- await page.screenshot({ path: testInfo.outputPath('session-return.png'), scale: 'css' });
- const back = page.getByRole('button', { name: '返回 WorkHub', exact: true });
- await expect(back).toBeVisible();
- const alignment = await back.evaluate((button) => {
- const composer = document.querySelector('.maka-composer-astryx')!;
- const body = Array.from(composer.children).find((child) => child.querySelector('[contenteditable]'))!;
- const a = button.getBoundingClientRect();
- const b = composer.getBoundingClientRect();
- return {
- left: Math.abs(a.left - b.left), right: Math.abs(a.right - b.right),
- above: a.bottom <= b.top,
- radius: getComputedStyle(button).borderRadius,
- composerRadius: getComputedStyle(body).borderRadius,
- textAlign: getComputedStyle(button).textAlign,
- };
- });
- expect(alignment.left).toBeLessThanOrEqual(1);
- expect(alignment.right).toBeLessThanOrEqual(1);
- expect(alignment.above).toBe(true);
- expect(alignment.radius).toBe(alignment.composerRadius);
- expect(alignment.textAlign).toBe('center');
- await back.click();
- await expect(page.locator('.workHubDock')).toBeVisible();
- await expect(workhub.locator(COMPOSER_INPUT)).toHaveText('Keep my WorkHub draft');
-});
-
-
-test('a pending WorkHub question preserves docked placement, choices and focus across window transitions', async ({ sessionLocalWindow: { page, app } }) => {
- await page.evaluate(() => window.maka.settings.updateClient({ workHub: { enabled: true } }));
- const hub = await getWorkHubPage(app);
- await hub.locator(COMPOSER_INPUT).fill(FAKE_ASK_USER_QUESTION_PROMPT);
- await awaitSendReady(hub);
- await hub.locator(COMPOSER_INPUT).press('Enter');
- await expect(hub.getByRole('option', { name: /公开测试/ })).toBeVisible();
- await expect(hub.locator('.workHubLive')).toHaveAttribute('data-placement', 'docked');
- // Reload rehydrates the pending question through Host interaction queries.
- await hub.reload();
- const choice = hub.getByRole('option', { name: /公开测试/ });
- await expect(choice).toBeVisible();
- await expect(hub.locator('.workHubLive')).toHaveAttribute('data-placement', 'docked');
- await choice.click();
- await app.evaluate(async ({ app }) => { if (process.platform === 'darwin') await app.dock!.show(); });
- await hub.evaluate(() => window.maka.workHubPresentation.detach());
- await expect(hub.locator('.workHubLive')).toHaveAttribute('data-placement', 'floating');
- await expect(choice).toHaveAttribute('aria-selected', 'true');
- await expect.poll(() => hub.locator('.maka-choice-panel').evaluate((panel) => panel.contains(document.activeElement))).toBe(true);
- await hub.evaluate(() => window.maka.workHubPresentation.dock());
- await expect(hub.locator('.workHubLive')).toHaveAttribute('data-placement', 'docked');
- await expect(choice).toHaveAttribute('aria-selected', 'true');
-});
diff --git a/apps/desktop/renderer-architecture.json b/apps/desktop/renderer-architecture.json
index 95fe2dce0d..0a0e71f496 100644
--- a/apps/desktop/renderer-architecture.json
+++ b/apps/desktop/renderer-architecture.json
@@ -830,7 +830,7 @@
"react": 1
},
"importSpecifiers": 98,
- "nonTriviaTokens": 12728
+ "nonTriviaTokens": 12703
},
"src/renderer/use-app-shell-composer-quotes.ts": {
"importDeclarations": 0,
diff --git a/apps/desktop/src/renderer/app-shell.tsx b/apps/desktop/src/renderer/app-shell.tsx
index da084005ed..7c4178e70d 100644
--- a/apps/desktop/src/renderer/app-shell.tsx
+++ b/apps/desktop/src/renderer/app-shell.tsx
@@ -17,7 +17,7 @@
* under the License.
*/
-import { WorkHubControlOverlay, WorkHubDock, WorkHubMainNavigation, WorkHubReturnButton } from './features/workhub';
+import { WorkHubControlOverlay, WorkHubDock, WorkHubMainNavigation } from './features/workhub';
import { RuntimeHostHandoffOverlay } from './features/runtime-host-management/index.js';
import {
useCallback,
@@ -2347,10 +2347,6 @@ function AppShellContent({
/>
) : null}
{!sharedSessionActive && sessionsSelected ? <PlanExecutionPanel planMode={planMode} /> : null}
- <WorkHubReturnButton
- visible={workHubEnabled && Boolean(activeId) && !onboardingComposerHidden}
- onReturn={openWorkHub}
- />
{sharedSessionActive && activeId ? (
<SessionCollaboration.SessionTurnRequestComposer
sessionId={activeId}
diff --git a/apps/desktop/src/renderer/features/workhub/index.ts b/apps/desktop/src/renderer/features/workhub/index.ts
index d62e842c1b..92a82840aa 100644
--- a/apps/desktop/src/renderer/features/workhub/index.ts
+++ b/apps/desktop/src/renderer/features/workhub/index.ts
@@ -36,4 +36,3 @@ export {
WorkHubModelConfigurationRequiredError,
type WorkHubCoordinationHostChange,
} from '../../application/contracts/workhub-workspace/coordination-lifecycle.js';
-export { WorkHubReturnButton } from './ui/return-button.js';
diff --git a/apps/desktop/src/renderer/features/workhub/ui/return-button.tsx b/apps/desktop/src/renderer/features/workhub/ui/return-button.tsx
deleted file mode 100644
index cb779b4053..0000000000
--- a/apps/desktop/src/renderer/features/workhub/ui/return-button.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { Button } from '@astryxdesign/core/Button';
-import { useUiLocale } from '@maka/ui';
-import { getShellCopy } from '../../../locales/shell-copy.js';
-
-export function WorkHubReturnButton({ visible, onReturn }: { visible: boolean; onReturn(): void }) {
- const locale = useUiLocale();
- return visible ? (
- <Button
- className="maka-return-workhub"
- label={getShellCopy(locale).navigation.backToWorkHub}
- variant="secondary"
- onClick={onReturn}
- />
- ) : null;
-}
diff --git a/apps/desktop/src/renderer/locales/shell-copy.ts b/apps/desktop/src/renderer/locales/shell-copy.ts
index 9cf8d4bd84..f575c60325 100644
--- a/apps/desktop/src/renderer/locales/shell-copy.ts
+++ b/apps/desktop/src/renderer/locales/shell-copy.ts
@@ -149,7 +149,6 @@ const STATIC_COMMAND_KEYWORDS: Record<StaticCommandId, readonly string[]> = {
type ShellCopy = {
navigation: {
settings: string;
- backToWorkHub: string;
};
actions: {
retry: string;
@@ -751,7 +750,7 @@ const EN_SETTINGS_SECTIONS: Record<SettingsSection, string> = {
const SHELL_COPY_BY_LOCALE = {
'zh-CN': {
- navigation: { settings: '设置', backToWorkHub: '返回 WorkHub' },
+ navigation: { settings: '设置' },
actions: { retry: '重试' },
paths: {
workspace: '工作区文件夹',
@@ -1277,7 +1276,7 @@ const SHELL_COPY_BY_LOCALE = {
},
},
'zh-TW': {
- navigation: { settings: '設定', backToWorkHub: '返回 WorkHub' },
+ navigation: { settings: '設定' },
actions: { retry: '重試' },
paths: {
workspace: '工作區資料夾',
@@ -1803,7 +1802,7 @@ const SHELL_COPY_BY_LOCALE = {
},
},
en: {
- navigation: { settings: 'Settings', backToWorkHub: 'Back to WorkHub' },
+ navigation: { settings: 'Settings' },
actions: { retry: 'Retry' },
paths: {
workspace: 'workspace',
diff --git a/apps/desktop/src/renderer/styles/composer.css b/apps/desktop/src/renderer/styles/composer.css
index daa61b17dc..b0af3e8866 100644
--- a/apps/desktop/src/renderer/styles/composer.css
+++ b/apps/desktop/src/renderer/styles/composer.css
@@ -40,15 +40,6 @@
max-width: var(--maka-reading-measure);
}
-.maka-return-workhub {
- --_button-radius: var(--radius-chat);
- display: flex;
- width: min(var(--maka-reading-measure), calc(100% - 2 * var(--space-6)));
- min-height: var(--space-10);
- margin: 0 auto;
- text-align: center;
-}
-
/* Reaching the transcript tail fades the scroll-to-bottom control while the
composer below it stays still. Both otherwise share the dock's filtered
compositing surface, so Chromium may re-raster the thin context-gauge paths
diff --git a/docs/astryx-surface-file-inventory.md b/docs/astryx-surface-file-inventory.md
index 474b0bb1cd..c7987bda73 100644
--- a/docs/astryx-surface-file-inventory.md
+++ b/docs/astryx-surface-file-inventory.md
@@ -6,7 +6,7 @@ Generated against `@astryxdesign/core@0.6.2` (195 component exports).
Wiki bar: Design Conventions · API Use-the-System · Theming · Container Padding.
-**Totals:** 293 files — blocker 0, reimplementation 0, polish 4, aligned 289.
+**Totals:** 292 files — blocker 0, reimplementation 0, polish 4, aligned 288.
## Exclusions (explicit)
@@ -125,7 +125,6 @@ Wiki bar: Design Conventions · API Use-the-System · Theming · Container Paddi
| `apps/desktop/src/renderer/features/workhub/ui/control-overlay.tsx` | other | none | aligned — no raw controls; no Astryx JSX usage | aligned |
| `apps/desktop/src/renderer/features/workhub/ui/cursor.tsx` | other | none | aligned — no raw controls; no Astryx JSX usage | aligned |
| `apps/desktop/src/renderer/features/workhub/ui/main-navigation.tsx` | other | none | aligned — no raw controls; no Astryx JSX usage | aligned |
-| `apps/desktop/src/renderer/features/workhub/ui/return-button.tsx` | other | Button | aligned — uses Astryx (Button) | aligned |
| `apps/desktop/src/renderer/features/workhub/ui/workhub-composer.tsx` | shell-chrome-or-panel | none | aligned — no raw controls; no Astryx JSX usage | aligned |
| `apps/desktop/src/renderer/features/workhub/ui/workhub-conversation.tsx` | other | Button, Link, Text | aligned — uses Astryx (Button, Link, Text) | aligned |
| `apps/desktop/src/renderer/features/workhub/ui/workhub-dock.tsx` | other | Button | aligned — uses Astryx (Button) | aligned |
diff --git a/docs/astryx-surface-file-inventory.paths b/docs/astryx-surface-file-inventory.paths
index d95fae7299..0053e4fd7a 100644
--- a/docs/astryx-surface-file-inventory.paths
+++ b/docs/astryx-surface-file-inventory.paths
@@ -96,7 +96,6 @@ apps/desktop/src/renderer/features/workbar/ui/workbar-toggle.tsx
apps/desktop/src/renderer/features/workhub/ui/control-overlay.tsx
apps/desktop/src/renderer/features/workhub/ui/cursor.tsx
apps/desktop/src/renderer/features/workhub/ui/main-navigation.tsx
-apps/desktop/src/renderer/features/workhub/ui/return-button.tsx
apps/desktop/src/renderer/features/workhub/ui/workhub-composer.tsx
apps/desktop/src/renderer/features/workhub/ui/workhub-conversation.tsx
apps/desktop/src/renderer/features/workhub/ui/workhub-dock.tsx
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org