From b97723c7195c3bb201ddb12ac0e92a70a9fc7dea Mon Sep 17 00:00:00 2001 From: AstroHan Date: Sun, 16 Aug 2026 17:50:49 +0800 Subject: [PATCH] fix(desktop): keep task menu interactive while open Keep the task row action host pointer-interactive for the native popover's full open lifetime so the chat surface cannot intercept menu item clicks. Add an Electron pointer regression covering the rename action. Generated-by: Codex --- apps/desktop/e2e/sidebar-project-row.spec.ts | 21 ++++++++++++++++++++ apps/desktop/src/renderer/styles/sidebar.css | 8 ++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/apps/desktop/e2e/sidebar-project-row.spec.ts b/apps/desktop/e2e/sidebar-project-row.spec.ts index c8bf75c2c7..d76e417704 100644 --- a/apps/desktop/e2e/sidebar-project-row.spec.ts +++ b/apps/desktop/e2e/sidebar-project-row.spec.ts @@ -1,6 +1,7 @@ import { LONG_SIDEBAR_PROJECT_ID, LONG_SIDEBAR_PROJECT_NAME, + LONG_SIDEBAR_SESSION_PREFIX, } from '../src/main/e2e-fixture/seed-helpers'; import { expect, test } from './fixtures'; @@ -63,6 +64,26 @@ test('project navigation and actions remain adjacent keyboard controls', async ( await expect(action).toBeFocused(); }); +test('task row action menu accepts pointer selection', async ({ + projectSidebarWindow: page, +}) => { + await page.keyboard.press('Escape'); + await expect(page.locator('[data-maka-contract="search-modal"]')).not.toBeVisible(); + + const sidebar = page.getByRole('navigation', { name: '任务列表' }); + const taskRow = sidebar.locator( + `[data-session-id="${LONG_SIDEBAR_SESSION_PREFIX}00"]`, + ); + await taskRow.hover(); + await taskRow.getByRole('button', { name: '任务操作', exact: true }).click(); + + const rename = page.getByRole('menuitem', { name: '重命名', exact: true }); + await expect(rename).toBeVisible(); + await rename.click(); + + await expect(page.getByRole('dialog', { name: '重命名任务' })).toBeVisible(); +}); + test('rail grouping survives a renderer reload', async ({ projectSidebarWindow: page }) => { await page.keyboard.press('Escape'); await expect(page.locator('[data-maka-contract="search-modal"]')).not.toBeVisible(); diff --git a/apps/desktop/src/renderer/styles/sidebar.css b/apps/desktop/src/renderer/styles/sidebar.css index a7a15ab7a1..ebe24d7685 100644 --- a/apps/desktop/src/renderer/styles/sidebar.css +++ b/apps/desktop/src/renderer/styles/sidebar.css @@ -284,7 +284,10 @@ * five things wide. * * :focus-within covers the keyboard: focus on the row's own button reveals the - * menu, and focus moving into the menu keeps it revealed. + * menu. The native popover's own open state covers the pointer handoff into the + * top layer: once the pointer leaves the row, :hover drops before the item can + * receive its click, and pointer-events: none on this ancestor otherwise makes + * the page underneath the visible popover win hit testing. */ .maka-session-row-time { display: inline-flex; @@ -312,7 +315,8 @@ } .maka-session-row:hover > .maka-session-row-action, -.maka-session-row:focus-within > .maka-session-row-action { +.maka-session-row:focus-within > .maka-session-row-action, +.maka-session-row > .maka-session-row-action:has([popover]:popover-open) { opacity: 1; pointer-events: auto; }