fix(diagnostics): deep-review round 2 — a send that claims, not one that blocks

The send no longer holds the session's row lock while it talks to the tracker:
it claims the session, gives the lock back, and checkpoints each step. A Stop
is never held behind a send, while a draft, a screenshot or a second send are
refused at once instead of queueing. The claim ages out, so a request that
died mid-send does not strand the session.

What the composer says is what happened: an attachment that went is no longer
named as one that did not (the missing body edit is its own line), and the
issue's screenshot count comes from the server when the list cannot be read,
so a failed read no longer blocks saving the draft. The zip is fetched as a
request, so its pace is a message and not a saved error page. Screenshots of a
finished report can be removed again; only one still being sent is held.

A recording's log elevation can no longer outlive it. The step prompt keeps
the keyboard (the page's keys stay quiet) and traps Tab itself. An image
pasted into a dialog opened over the composer stays that dialog's.
This commit is contained in:
2026-09-20 00:51:12 +02:00
parent 134ec9a68e
commit 3f983e6d76
17 changed files with 347 additions and 126 deletions
@@ -15,6 +15,7 @@ vi.mock("react-i18next", async (importOriginal) => {
import Toaster from "./Toaster";
import { clearAll, notify } from "../../lib/notifications";
import { dockUnderToasts } from "../../lib/toastDock";
afterEach(() => {
cleanup();
@@ -50,12 +51,21 @@ describe("Toaster — one host shows the toasts", () => {
app.unmount();
});
it("lets a click through wherever there is no toast and nothing docked, in every host", () => {
it("lets a click through where there is no toast and nothing docked, and not where there is", () => {
const Docked = () => <button>dock</button>;
const stop = dockUnderToasts(Docked);
notify({ level: "info", message: "hello" });
render(<Toaster />);
const region = document.querySelector<HTMLElement>("[data-toast-region]")!;
// The empty part of the region (beside and above a docked control) must not swallow the page's
// clicks; the cards and the dock opt back in.
// clicks — and the two things that ARE there must still take them.
expect(region.className).toContain("pointer-events-none");
const card = screen.getByText("hello").closest(".toast-card")!;
expect(card.className).toContain("pointer-events-auto");
const dock = screen.getByText("dock").parentElement!;
expect(dock.className).toContain("pointer-events-auto");
expect(dock.closest("[data-toast-region]")).toBe(region);
stop();
});
it("does not let a click on a toast reach the overlay's backdrop", () => {