diff --git a/packages/alert-dashboard/e2e/incidents.spec.ts b/packages/alert-dashboard/e2e/incidents.spec.ts index 37e7594262..1c8544b984 100644 --- a/packages/alert-dashboard/e2e/incidents.spec.ts +++ b/packages/alert-dashboard/e2e/incidents.spec.ts @@ -110,12 +110,12 @@ test("Take on an unowned, eligible incident makes the viewer commander", async ( }) => { await page.setViewportSize(DESKTOP); await gotoLoadedPage(page, "/incidents/INC-5"); - const command = page.locator(".inc-command-panel"); + const command = page.getByRole("region", { name: "Command", exact: true }); await expect(command).toContainText("Unowned — takeover eligible now"); await command.getByRole("button", { name: "Take command" }).click(); await expect(page.getByRole("alert")).toHaveText( - "You hold command of INC-5.", + /You hold command of INC-5\.$/u, ); await expect(command).toContainText("Owned by Hub browser"); await expect( @@ -137,7 +137,7 @@ test("maintenance shows its owner without takeover language", async ({ }) => { await page.setViewportSize(DESKTOP); await gotoLoadedPage(page, "/incidents/INC-2"); - const owner = page.locator(".inc-command-panel"); + const owner = page.getByRole("region", { name: "Owner", exact: true }); await expect(owner.getByRole("heading", { name: "Owner" })).toBeVisible(); await expect(owner).toContainText("No owner"); await expect(owner).not.toContainText("eligible"); @@ -165,7 +165,7 @@ test("declaring onto a held system offers to join the existing incident", async ); await notice.getByRole("button", { name: "Join it instead" }).click(); await expect(page).toHaveURL(/\/incidents\/INC-4$/u); - await expect(page.locator(".inc-detail")).toContainText("Hub browser"); + await expect(page.getByRole("main")).toContainText("Hub browser"); }); test("incident pages fit a phone without sideways scrolling", async ({ diff --git a/packages/console-ui/src/styles/components/description-list.css b/packages/console-ui/src/styles/components/description-list.css index 29c4663354..090e706b00 100644 --- a/packages/console-ui/src/styles/components/description-list.css +++ b/packages/console-ui/src/styles/components/description-list.css @@ -10,6 +10,7 @@ .ui-dl[data-layout="grid"] { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--ui-space-4) var(--ui-space-6); + align-items: start; padding: var(--ui-space-3) var(--ui-gutter) var(--ui-space-4); } .ui-dl[data-layout="rail"] { @@ -24,6 +25,7 @@ } .ui-dl-item { display: grid; + align-content: start; gap: var(--ui-space-1); min-width: 0; } diff --git a/packages/incidents/src/client/client.test.tsx b/packages/incidents/src/client/client.test.tsx index 5be976d0b6..2a1030983f 100644 --- a/packages/incidents/src/client/client.test.tsx +++ b/packages/incidents/src/client/client.test.tsx @@ -159,7 +159,7 @@ describe("incident list", () => { it("shows id, severity, status, systems, command, signals, affected, and age per row", () => { const html = render( { it("says so when nothing matches", () => { expect( - render(), + render(), ).toContain("No incidents match these filters."); }); diff --git a/packages/incidents/src/client/conformance-allowlist.json b/packages/incidents/src/client/conformance-allowlist.json index a38fcc3949..fe51488c70 100644 --- a/packages/incidents/src/client/conformance-allowlist.json +++ b/packages/incidents/src/client/conformance-allowlist.json @@ -1,8 +1 @@ -[ - { - "rule": "bare-element-selector", - "file": "src/client/incidents.css", - "count": 37, - "reason": "Baseline for the layer rule: move element defaults into @layer ui.app and drop other app layer names." - } -] +[] diff --git a/packages/incidents/src/client/data-status.tsx b/packages/incidents/src/client/data-status.tsx index 6604df0380..070f70eccd 100644 --- a/packages/incidents/src/client/data-status.tsx +++ b/packages/incidents/src/client/data-status.tsx @@ -1,4 +1,4 @@ -import { Button, State } from "@shepherdjerred/console-ui"; +import { Banner, Button, State } from "@shepherdjerred/console-ui"; import { Loaded, type LoadedMeta } from "@shepherdjerred/loaded/index.ts"; export function IncidentLoadError({ @@ -32,9 +32,9 @@ export function IncidentRefreshWarning({ const error = errors[0]; if (error === undefined) return null; return ( -

+ Showing the last available data. Refresh failed.{" "} {Loaded.messageOf(error.error)} -

+ ); } diff --git a/packages/incidents/src/client/declare-page.tsx b/packages/incidents/src/client/declare-page.tsx index 59f7e7ebfb..0b890ba7f8 100644 --- a/packages/incidents/src/client/declare-page.tsx +++ b/packages/incidents/src/client/declare-page.tsx @@ -1,9 +1,22 @@ -import { Button, State } from "@shepherdjerred/console-ui"; +import { + Banner, + Button, + ButtonLink, + Checkbox, + DescriptionList, + Field, + Fieldset, + FormActions, + RadioGroup, + Section, + State, + Textarea, +} from "@shepherdjerred/console-ui"; import { Loaded } from "@shepherdjerred/loaded/index.ts"; import { LoadingBlock } from "@shepherdjerred/loaded/react.tsx"; import { useQuery, useQueryClient } from "@tanstack/react-query"; -import { SirenIcon, UsersRoundIcon } from "lucide-react"; -import { useCallback, useId, useState } from "react"; +import { UsersRoundIcon } from "lucide-react"; +import { useCallback, useState } from "react"; import { Link, useNavigate } from "react-router"; import { INCIDENT_SYSTEMS, @@ -42,7 +55,7 @@ import { IncidentsBackLink, IncidentsHeading, Notice, - SeverityBadge, + SeverityGlyph, StatusBadge, SystemList, } from "#client/ui.tsx"; @@ -109,91 +122,60 @@ export function DuplicateNotice({ heading?.scrollIntoView({ block: "center" }); }, []); return ( -
-

+ + + }> + Open {existing.identifier} + + + } > - {existing.identifier} already covers{" "} - {duplicate.systems.map((system) => systemLabel(system)).join(", ")} -

-

+

+ {existing.identifier} already covers{" "} + {duplicate.systems.map((system) => systemLabel(system)).join(", ")} +

+ {existing.title} +
One open incident holds each system, so agents coordinate on a single owner. Join it as affected instead of declaring another. -

-
- - {existing.identifier} - {existing.title} - -
- - - -
- +
+ , + }, + { + label: "Status", + value: , + }, + { + label: "Systems", + value: , + }, + { + label: "Command", + value: ( + + ), + }, + ]} /> -
-
- - - Open {existing.identifier} - -
-
- ); -} - -function Choice({ - name, - value, - label, - hint, - type, - checked, - defaultChecked, - onChange, -}: { - readonly name: string; - readonly value: string; - readonly label: React.ReactNode; - readonly hint?: string; - readonly type: "radio" | "checkbox"; - readonly checked?: boolean; - readonly defaultChecked?: boolean; - readonly onChange?: () => void; -}): React.JSX.Element { - const id = useId(); - return ( -
- - -
+ + ); } @@ -214,34 +196,25 @@ function TextField({ readonly minLength?: number; readonly maxLength?: number; }): React.JSX.Element { - const id = useId(); - const hintId = `${id}-hint`; - const shared = { - id, - name, - required, - className: "ui-field-control", - ...(hint === undefined ? {} : { "aria-describedby": hintId }), - }; return ( -
-
- - {multiline ? ( -