From 39fc45afc78c1aa93dbb52f26de46614537b2129 Mon Sep 17 00:00:00 2001 From: Madraka <8898640+Madraka@users.noreply.github.com> Date: Thu, 19 Nov 2026 02:15:56 +0300 Subject: [PATCH 1/7] fix(app): the general settings use Kumo's select and radios The page-size select is Kumo's Select, and every choice of the tab is Kumo's Radio.Group through Choice in settings/Row.tsx, its legend kept for assistive technology. The tab's controls and its button use Kumo's default size, whose 13 px type is the type of the radio labels and the row names beside them. The language choice gives the focus back to the checked radio by its role. Two lines of the controls check's debt go. The browser tests change with the roles. They choose a page size as a person does, through a helper in the fixtures: the select is now a combobox with a listbox, and its value is its text. They find a radio by its role and name inside its group: Kumo's radio is a span with the role radio, and its label also names the hidden input beside it, so finding it by its label finds two. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com> --- app/components/settings/GeneralSettings.tsx | 36 +++++++-------------- app/components/settings/Row.tsx | 21 ++++-------- scripts/checks/controls.ts | 2 -- test/e2e/bulk.spec.ts | 8 ++--- test/e2e/choices.spec.ts | 5 ++- test/e2e/fixtures.ts | 17 +++++++++- test/e2e/language.spec.ts | 16 +++++++-- test/e2e/mailbox.spec.ts | 21 ++++++------ test/e2e/remembered.spec.ts | 16 ++++----- test/e2e/sending.spec.ts | 6 ++-- 10 files changed, 78 insertions(+), 70 deletions(-) diff --git a/app/components/settings/GeneralSettings.tsx b/app/components/settings/GeneralSettings.tsx index 41d8844..92119db 100644 --- a/app/components/settings/GeneralSettings.tsx +++ b/app/components/settings/GeneralSettings.tsx @@ -1,7 +1,7 @@ // Copyright 2026 Cloudhal and the Podbay contributors // Licensed under the Apache 2.0 license found in the LICENSE file. -import { Button } from "@cloudflare/kumo"; +import { Button, Select } from "@cloudflare/kumo"; import { useEffect, useRef, useState } from "react"; import { UNDO_SECONDS, type UndoSeconds } from "shared/sending"; import { PAGE_SIZES, type PageSize, useDisplay } from "~/hooks/useDisplay"; @@ -35,7 +35,9 @@ export default function GeneralSettings() { useEffect(() => { if (!languageJustChosen) return; languageJustChosen = false; - languageChoice.current?.querySelector("input:checked")?.focus(); + languageChoice.current + ?.querySelector('[role="radio"][aria-checked="true"]') + ?.focus(); }, []); /** Turning notifications on asks the browser first; a no leaves them off and says why. */ @@ -60,22 +62,13 @@ export default function GeneralSettings() { name={t("Conversations on a page")} about={t("How many lines a list shows before it pages.")} > - + onChange(option)} - /> - {t(label)} - + ))} - + ); } diff --git a/scripts/checks/controls.ts b/scripts/checks/controls.ts index 1ad062b..40c0428 100644 --- a/scripts/checks/controls.ts +++ b/scripts/checks/controls.ts @@ -89,8 +89,6 @@ export const TO_MOVE: Readonly>>> "app/components/rules/FilterDialog.tsx": { input: 4, select: 2 }, "app/components/settings/AssistantSettings.tsx": { textarea: 1 }, "app/components/settings/AutoReplySettings.tsx": { input: 3, textarea: 1 }, - "app/components/settings/GeneralSettings.tsx": { select: 1 }, - "app/components/settings/Row.tsx": { input: 1 }, "app/components/settings/SignatureSettings.tsx": { input: 1 }, "app/routes/home.tsx": { button: 1 }, "app/routes/mailbox.tsx": { button: 1 }, diff --git a/test/e2e/bulk.spec.ts b/test/e2e/bulk.spec.ts index db75879..43189f9 100644 --- a/test/e2e/bulk.spec.ts +++ b/test/e2e/bulk.spec.ts @@ -8,7 +8,7 @@ * own count; every deed can be taken back from its note; a line is a whole conversation. */ import type { Page } from "@playwright/test"; -import { expect, mime, test } from "./fixtures.ts"; +import { choose, expect, mime, test } from "./fixtures.ts"; const row = (page: Page, subject: string) => page.getByRole("button", { name: new RegExp(subject) }); @@ -95,7 +95,7 @@ test("everything in a place or a search is chosen from a line, asked with its co } const base = `/mailbox/${encodeURIComponent(app.account.mailbox)}`; await page.goto(`${base}/settings`); - await page.getByLabel("Conversations on a page").selectOption("10"); + await choose(page.getByRole("combobox", { name: "Conversations on a page" }), "10"); // Everything a search finds. A page that is only partly ticked offers nothing. await page.goto(`${base}/search?q=${encodeURIComponent('subject:"Bulk: many"')}`); @@ -221,8 +221,8 @@ test("a person puts unread conversations first, and the choice stays", async ({ await place; await page.goto(`${base}/settings`); const choice = page.getByRole("radiogroup", { name: "Order of a list" }); - await expect(choice.getByLabel("Unread first")).toBeChecked(); - await choice.getByLabel("Newest first").check(); + await expect(choice.getByRole("radio", { name: "Unread first", exact: true })).toBeChecked(); + await choice.getByRole("radio", { name: "Newest first", exact: true }).check(); await page.goto(search); await expect.poll(order).toEqual(["newer", "older"]); expect(app.watch.errors).toEqual([]); diff --git a/test/e2e/choices.spec.ts b/test/e2e/choices.spec.ts index a087eec..e3651e6 100644 --- a/test/e2e/choices.spec.ts +++ b/test/e2e/choices.spec.ts @@ -11,7 +11,10 @@ import { expect, mime, SENT_WITHIN, test } from "./fixtures.ts"; const row = (page: Page, subject: string) => page.getByRole("button", { name: new RegExp(subject) }); const choose = (page: Page, group: string, option: string) => - page.getByRole("radiogroup", { name: group }).getByLabel(option).check(); + page + .getByRole("radiogroup", { name: group }) + .getByRole("radio", { name: option, exact: true }) + .check(); test.beforeEach(async ({ page, app }) => { await app.signIn(); diff --git a/test/e2e/fixtures.ts b/test/e2e/fixtures.ts index e70ad61..64ab84a 100644 --- a/test/e2e/fixtures.ts +++ b/test/e2e/fixtures.ts @@ -12,7 +12,7 @@ */ import { readFileSync } from "node:fs"; import { fileURLToPath } from "node:url"; -import { test as base, expect, type Frame, type Page } from "@playwright/test"; +import { test as base, expect, type Frame, type Locator, type Page } from "@playwright/test"; import type { Account } from "./global-setup.ts"; import { PROXY } from "./proxy-address.ts"; @@ -24,6 +24,21 @@ export const BASE = "http://localhost:4174"; * app says "sent" when the mailbox does, not at the press. */ export const SENT_WITHIN = { timeout: 30_000 } as const; + +/** + * Chooses an option of one of Kumo's selects, as a person does: the trigger (role `combobox`) + * opens a list (role `listbox`), and the option is pressed by its name. A native ` onChange(event.target.value === "is" ? "is" : "contains")} - > - - - + onValueChange={(chosen) => onChange(chosen === "is" ? "is" : "contains")} + items={{ contains: t("contains"), is: t("is exactly") }} + /> ); } @@ -112,6 +107,8 @@ export default function FilterDialog({ }) { const { data: labels = [] } = useLabels(mailboxId); const saveRules = useSaveRules(); + const senderField = useId(); + const recipientField = useId(); const [form, setForm] = useState
(formOf()); const [error, setError] = useState(null); const set = (change: Partial) => setForm((held) => ({ ...held, ...change })); @@ -162,104 +159,91 @@ export default function FilterDialog({ {t("When a message arrives and all of this is true")} -
- set({ fromMatch })} - /> -
- set({ from: event.target.value })} + {/* The row's label stands at its left edge, above the comparison and the field both. */} +
+ +
+ set({ fromMatch })} /> +
+ set({ from: event.target.value })} + /> +
-
- set({ toMatch })} - /> -
- set({ to: event.target.value })} + {/* The row's label stands at its left edge, above the comparison and the field both. */} +
+ +
+ set({ toMatch })} /> +
+ set({ to: event.target.value })} + /> +
set({ subject: event.target.value })} /> set({ words: event.target.value })} /> - + set({ hasAttachment: checked === true })} + />
{t("Do this")} -
- - -
- - + = RULE_LIMITS.labels} - onChange={(event) => toggleLabel(label.id, event.target.checked)} - /> -
diff --git a/app/index.css b/app/index.css index b0148a3..7f9d946 100644 --- a/app/index.css +++ b/app/index.css @@ -35,6 +35,15 @@ body { z-index: 50; } +/* + * The list of a select opens over what it was opened from in the same way, a dialog too: in + * the filter dialog the list of "Where it goes" lay under the dialog, which took the click. + * Kumo gives a select's positioner no part of its own, so it is found by the list it holds. + */ +[data-base-ui-portal] > [data-side]:has([role="listbox"]) { + z-index: 50; +} + /* * A dialog lies over whatever it was opened from, the compose window too (z-40): "Send later" * and the link of the editor are asked from inside it. A menu of a dialog stays above the diff --git a/scripts/checks/controls.ts b/scripts/checks/controls.ts index 40c0428..3e49b3d 100644 --- a/scripts/checks/controls.ts +++ b/scripts/checks/controls.ts @@ -86,7 +86,6 @@ export const TO_MOVE: Readonly>>> "app/components/SignInSteps.tsx": { button: 1 }, "app/components/email-panel/MessageHeader.tsx": { button: 4 }, "app/components/email-panel/ThreadMessage.tsx": { button: 1 }, - "app/components/rules/FilterDialog.tsx": { input: 4, select: 2 }, "app/components/settings/AssistantSettings.tsx": { textarea: 1 }, "app/components/settings/AutoReplySettings.tsx": { input: 3, textarea: 1 }, "app/components/settings/SignatureSettings.tsx": { input: 1 }, diff --git a/test/e2e/rules.spec.ts b/test/e2e/rules.spec.ts index 1b5cf94..9d77a4e 100644 --- a/test/e2e/rules.spec.ts +++ b/test/e2e/rules.spec.ts @@ -19,7 +19,7 @@ import { readFileSync } from "node:fs"; import { fileURLToPath } from "node:url"; import type { Page } from "@playwright/test"; -import { BASE, expect, test } from "./fixtures.ts"; +import { BASE, choose, expect, test } from "./fixtures.ts"; const MAILBOX = "rules@example.com"; const box = encodeURIComponent(MAILBOX); @@ -115,8 +115,8 @@ test("a filter made in the settings files mail that arrives from then on, and is await expect(dialog.getByRole("button", { name: "Create filter" })).toBeDisabled(); await dialog.getByLabel("The subject contains").fill(word.toUpperCase()); await expect(dialog.getByText("Say at least one thing the filter does.")).toBeVisible(); - await dialog.getByLabel("Where it goes").selectOption({ label: "Skip the Inbox" }); - await dialog.getByLabel("Star it").check(); + await choose(dialog.getByRole("combobox", { name: "Where it goes" }), "Skip the Inbox"); + await dialog.getByRole("checkbox", { name: "Star it" }).check(); await dialog.getByRole("button", { name: "Create filter" }).click(); await expect(dialog).toBeHidden(); @@ -219,9 +219,11 @@ test("“Filter messages like this” starts a new filter with the sender of the await page.getByRole("menuitem", { name: "Filter messages like this" }).click(); const dialog = page.getByRole("dialog", { name: "New filter" }); await expect(dialog.getByLabel("The sender", { exact: true })).toHaveValue(sender); - await expect(dialog.getByLabel("How the sender is compared")).toHaveValue("is"); - await dialog.getByLabel("Mark as read").check(); - await dialog.getByLabel("Where it goes").selectOption({ label: "Move to Trash" }); + await expect(dialog.getByRole("combobox", { name: "How the sender is compared" })).toHaveText( + "is exactly", + ); + await dialog.getByRole("checkbox", { name: "Mark as read" }).check(); + await choose(dialog.getByRole("combobox", { name: "Where it goes" }), "Move to Trash"); await dialog.getByRole("button", { name: "Create filter" }).click(); await expect(dialog).toBeHidden(); From ef6892c954418ed98176cd1689ffe9b1063e4b5c Mon Sep 17 00:00:00 2001 From: Madraka <8898640+Madraka@users.noreply.github.com> Date: Thu, 19 Nov 2026 02:15:57 +0300 Subject: [PATCH 3/7] fix(app): the automatic reply uses Kumo's checkbox and text area, and saves where its fields are The on and off box is Kumo's Checkbox, the subject Kumo's Input at the default size and the width of its column, and the message Kumo's InputArea, grown to its text from eight rows. "Save automatic reply" stands in the column of the fields, not under the names of the rows. The two ends of "Between" stay the browser's own date-and-time field: Kumo's DatePicker is a calendar with no time of day, so a field for both is a wrapper to decide (#82). Their height and type are those of Kumo's default size, and they stay in the controls check's debt. The browser tests find "Answer mail that arrives" by its role and name, as Kumo's checkbox is found twice by its label. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com> --- app/components/settings/AutoReplySettings.tsx | 92 ++++++++++--------- scripts/checks/controls.ts | 2 +- test/e2e/rules.spec.ts | 4 +- 3 files changed, 51 insertions(+), 47 deletions(-) diff --git a/app/components/settings/AutoReplySettings.tsx b/app/components/settings/AutoReplySettings.tsx index aeff170..bb316d2 100644 --- a/app/components/settings/AutoReplySettings.tsx +++ b/app/components/settings/AutoReplySettings.tsx @@ -1,7 +1,7 @@ // Copyright 2026 Cloudhal and the Podbay contributors // Licensed under the Apache 2.0 license found in the LICENSE file. -import { Button, Input, useKumoToastManager } from "@cloudflare/kumo"; +import { Button, Checkbox, Input, InputArea, useKumoToastManager } from "@cloudflare/kumo"; import { type FormEvent, useEffect, useState } from "react"; import { AUTO_REPLY } from "shared/rules"; import { useFreshProof } from "~/components/FreshProof"; @@ -11,8 +11,13 @@ import { fieldValue } from "~/lib/sending-words"; import { useAutoReply, useSaveAutoReply } from "~/queries/rules"; import Row from "./Row"; +/** + * Kumo has no field for a date with a time of day (its DatePicker is a calendar without a time): + * the two ends stay the browser's own field, at the height and type of Kumo's default size, + * until a wrapper is decided (issue #82). + */ const NATIVE_FIELD = - "h-9 w-full rounded-lg border border-kumo-line bg-kumo-control px-3 text-sm text-kumo-default"; + "h-9 w-full rounded-lg border border-kumo-line bg-kumo-control px-3 text-base text-kumo-default"; /** An instant as the date and time field of this device shows it; empty for none. */ const shown = (instant: string | null): string => @@ -105,15 +110,11 @@ export default function AutoReplySettings({ )}
- + setEnabled(checked === true)} + /> -
-
- setSubject(event.target.value)} - /> -
+
+ setSubject(event.target.value)} + />
@@ -172,13 +171,16 @@ export default function AutoReplySettings({ )}

)} -