Cut the menu's comments down to what the code does not say

- Drop the title prop: no caller passes it, and the menu's name is for screen
  readers only.
- One line each for the output options, the Default placeholder id and the
  list's height bounds.
- Keep only the two non-obvious reasons behind the focus tracking.
- Call what moved the focus its source rather than its modality.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
fkwp
2026-09-23 20:23:50 +02:00
co-authored by Claude Opus 5.5
parent cf486cf42a
commit d9ed39c7aa
5 changed files with 31 additions and 118 deletions
+5 -5
View File
@@ -111,7 +111,7 @@ test("keeps every device reachable in a small container", async ({ page }) => {
await expect(last).toHaveAttribute("aria-checked", "true");
});
test("tracks the focus modality of its own call, not the page", async ({
test("tracks the focus source of its own call, not the page", async ({
page,
}) => {
await installFakeDevices(page);
@@ -124,7 +124,7 @@ test("tracks the focus modality of its own call, not the page", async ({
timeout: 60_000,
});
await openDeviceList(page, pane);
// The menu owns the modality, because every item it can focus has to answer
// The menu owns the focus source, because every item it can focus has to answer
// to it — the device rows and the camera menu's blur toggle alike.
const menu = page.getByRole("menu");
@@ -134,7 +134,7 @@ test("tracks the focus modality of its own call, not the page", async ({
// suppresses the browser's own reaches this menu. The paint is asserted
// standalone instead — in the story and in audio-menu.spec.ts. What is on
// trial here is which call the tracking answers for.
await expect(menu).toHaveAttribute("data-focus-modality", "pointer");
await expect(menu).toHaveAttribute("data-focus-source", "pointer");
// A key pressed in the other call on this page — or anywhere in the host's
// own page — says nothing about how this menu is being used.
@@ -143,11 +143,11 @@ test("tracks the focus modality of its own call, not the page", async ({
new KeyboardEvent("keydown", { key: "ArrowDown", bubbles: true }),
),
);
await expect(menu).toHaveAttribute("data-focus-modality", "pointer");
await expect(menu).toHaveAttribute("data-focus-source", "pointer");
// A key pressed in this menu does.
await page.keyboard.press("ArrowDown");
await expect(menu).toHaveAttribute("data-focus-modality", "keyboard");
await expect(menu).toHaveAttribute("data-focus-source", "keyboard");
});
/**