Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions apps/desktop/e2e/sidebar-project-row.spec.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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();
Expand Down
8 changes: 6 additions & 2 deletions apps/desktop/src/renderer/styles/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
Loading