From 04a00a20044854379ca054d79ca426c93404703a Mon Sep 17 00:00:00 2001 From: 404ARE <936233544@qq.com> Date: Mon, 24 Aug 2026 01:11:21 +0800 Subject: [PATCH 1/2] fix(desktop): prevent WorkHub result overlap Allow WorkHub target buttons to grow beyond the fixed medium control height so Session metadata stays clear of the result text. Add an Electron layout regression test. Generated-by: Codex --- apps/desktop/e2e/workhub-layout.spec.ts | 64 ++++++++++++++++++++ apps/desktop/src/renderer/styles/workhub.css | 2 + 2 files changed, 66 insertions(+) create mode 100644 apps/desktop/e2e/workhub-layout.spec.ts diff --git a/apps/desktop/e2e/workhub-layout.spec.ts b/apps/desktop/e2e/workhub-layout.spec.ts new file mode 100644 index 0000000000..271fd2fc8f --- /dev/null +++ b/apps/desktop/e2e/workhub-layout.spec.ts @@ -0,0 +1,64 @@ +/* + * 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 { expect, test, COMPOSER_INPUT } from './fixtures'; + +test('WorkHub target metadata does not overlap the submitted Session result', async ({ + window: page, +}) => { + const composer = page.locator(COMPOSER_INPUT); + await composer.fill('支付回调幂等性'); + await composer.press('Enter'); + await expect(page.getByRole('button', { name: '重新生成' })).toHaveCount(1, { + timeout: 20_000, + }); + + const sessionName = await page.evaluate(async () => + (await window.maka.sessions.list())[0]?.name, + ); + expect(sessionName).toBeTruthy(); + await page.evaluate(async () => { + await window.maka.settings.updateClient({ workHub: { enabled: true } }); + }); + await expect(page.getByRole('main', { name: 'WorkHub' })).toBeVisible(); + + const workHubComposer = page.locator( + '.workhub-surface .maka-composer-editor [contenteditable="true"]', + ); + await workHubComposer.fill(`继续${sessionName},补充重复投递测试点。`); + await workHubComposer.press('Enter'); + await expect(page.locator('.workhub-result')).toBeVisible(); + + const geometry = await page.evaluate(() => { + const button = document.querySelector('.workhub-submitted > button')!; + const project = button.querySelector('.workhub-submitted-session small')!; + const result = document.querySelector('.workhub-result')!; + const buttonBox = button.getBoundingClientRect(); + const projectBox = project.getBoundingClientRect(); + const resultBox = result.getBoundingClientRect(); + return { + buttonContainsProject: buttonBox.bottom >= projectBox.bottom, + overlapHeight: + Math.min(projectBox.bottom, resultBox.bottom) - Math.max(projectBox.top, resultBox.top), + }; + }); + + expect(geometry.buttonContainsProject).toBe(true); + expect(geometry.overlapHeight).toBeLessThanOrEqual(0); +}); diff --git a/apps/desktop/src/renderer/styles/workhub.css b/apps/desktop/src/renderer/styles/workhub.css index 0aadc342ae..9ccdbce201 100644 --- a/apps/desktop/src/renderer/styles/workhub.css +++ b/apps/desktop/src/renderer/styles/workhub.css @@ -149,6 +149,8 @@ align-items: flex-start; justify-content: space-between; width: 100%; + height: auto; + min-height: var(--h-control-md, 32px); padding: 10px 0; gap: 16px; border: 0; From 6082ad353a1ae852f975cd6fb2413c972b1fea63 Mon Sep 17 00:00:00 2001 From: 404ARE <936233544@qq.com> Date: Mon, 24 Aug 2026 01:31:54 +0800 Subject: [PATCH 2/2] fix(desktop): address WorkHub layout review --- apps/desktop/src/renderer/styles/workhub.css | 1 - docs/astryx-surface-file-inventory.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/desktop/src/renderer/styles/workhub.css b/apps/desktop/src/renderer/styles/workhub.css index 9ccdbce201..369a71c038 100644 --- a/apps/desktop/src/renderer/styles/workhub.css +++ b/apps/desktop/src/renderer/styles/workhub.css @@ -150,7 +150,6 @@ justify-content: space-between; width: 100%; height: auto; - min-height: var(--h-control-md, 32px); padding: 10px 0; gap: 16px; border: 0; diff --git a/docs/astryx-surface-file-inventory.md b/docs/astryx-surface-file-inventory.md index 3544e3cde0..e602268358 100644 --- a/docs/astryx-surface-file-inventory.md +++ b/docs/astryx-surface-file-inventory.md @@ -5,7 +5,7 @@ Each row is one on-disk product surface file. Regenerated inventory must stay in Wiki bar: Design Conventions · API Use-the-System · Theming · Container Padding. -**Totals:** 204 files — blocker 0, polish 0, aligned 204. +**Totals:** 206 files — blocker 0, polish 0, aligned 206. ## Exclusions (explicit)