diff --git a/CLAUDE.md b/CLAUDE.md
index b9c36f0..74c8667 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -198,6 +198,9 @@ driving the installed build:
- **An accessible name is assembled without spaces.** Inline spans join as `Updates(5)`; put a
literal `{' '}`. A browser *adds* one before visually-hidden text, so `: numpy` in an `sr-only`
span read "Remove packages : numpy" — use `aria-label` for a name with punctuation in it.
+- **`sr-only` text needs a positioned parent.** It is `position: absolute`, so with no positioned
+ ancestor it is laid out against the viewport, outside every scroller: a list of pin chips on
+ Pins made the whole window scroll. Put `relative` on whatever holds the hidden text.
- **`ACCESSIBILITY.md` is hand-kept and says who tested what.** A change to keyboard, focus,
names or contrast is a change to it, the way a behaviour change is a change to `legal/`. It
currently says Narrator was not re-run on 1.5.0, and only a person can change that sentence.
diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md
index 972248a..955bd47 100644
--- a/docs/ROADMAP.md
+++ b/docs/ROADMAP.md
@@ -1588,6 +1588,22 @@ was clipped, and it was — on three sides, in normal mode, fixed here. The forc
carried that exact fix since M2, with a comment saying why: the knowledge was in the stylesheet,
scoped to the one mode someone had looked at.
+**And what a second reader found**, in the diff, after the smoke had passed — an independent review
+run while CI was going:
+
+- **`sr-only` text needs a positioned parent.** It is `position: absolute`; with no positioned
+ ancestor it is laid out against the viewport and escapes every scroller above it. A pin chip's
+ new hidden sentence did exactly that on Pins, where nothing between the chip and `` is
+ positioned: a long list made the whole window scroll and took the header with it. Package rows
+ hid it, because a row is `absolute`. Every parent of hidden text is `relative` now.
+- **An error-only summary had no `
`**, so the new focus rule had nothing to land on — on the
+ one screen where a run had just failed.
+- **A drawer that mounts already open has no opener.** `consoleOpen` outlives a run; closing the
+ drawer in the next one dropped focus as it had before the fix. It falls back to the *Console*
+ button.
+- Under forced-colors, the selection outline followed the focus ring at equal specificity, so a
+ focused current tab got a 1 px line in place of its 2 px ring.
+
**What it did not establish.** The assistant cannot run a screen reader. Everything above about
what assistive technology receives is the accessibility tree, which is what is *exposed*, not what
is *said*. Narrator on 1.5.0, NVDA, JAWS and each contrast theme by hand are backlog A7 and are
diff --git a/ui/src/components/PdBadge.tsx b/ui/src/components/PdBadge.tsx
index 169ff01..65e914d 100644
--- a/ui/src/components/PdBadge.tsx
+++ b/ui/src/components/PdBadge.tsx
@@ -39,7 +39,10 @@ export function PdBadge({ tone, label, glyph, title }: PdBadgeProps) {
const explained = title !== undefined && title !== label
return (
{glyph === undefined ? null : {glyph}}
diff --git a/ui/src/components/PdConsoleDrawer.test.tsx b/ui/src/components/PdConsoleDrawer.test.tsx
index 999c797..4908491 100644
--- a/ui/src/components/PdConsoleDrawer.test.tsx
+++ b/ui/src/components/PdConsoleDrawer.test.tsx
@@ -69,6 +69,35 @@ describe('PdConsoleDrawer', () => {
expect(toggle).toHaveFocus()
})
+ it('finds the console button when nothing opened it', () => {
+ function AlreadyOpen() {
+ const [open, setOpen] = useState(true)
+ return (
+ <>
+ {
+ setOpen(false)
+ }}
+ />
+
+ >
+ )
+ }
+ render()
+ const close = screen.getByRole('button', { name: 'Close console' })
+ close.focus()
+
+ fireEvent.keyDown(close, { key: 'Escape' })
+
+ expect(screen.getByRole('button', { name: 'Console' })).toHaveFocus()
+ })
+
it('leaves focus alone when it was never inside', () => {
// Toggled shut from the button that opened it: focus is already where it should be.
const toggle = openDrawer()
diff --git a/ui/src/components/PdConsoleDrawer.tsx b/ui/src/components/PdConsoleDrawer.tsx
index be315c6..d87df74 100644
--- a/ui/src/components/PdConsoleDrawer.tsx
+++ b/ui/src/components/PdConsoleDrawer.tsx
@@ -63,7 +63,14 @@ export function PdConsoleDrawer({ lines, open, onClose, done, total }: PdConsole
return () => {
const active = document.activeElement
if (active !== null && active !== document.body && active.isConnected) return
- if (opener !== null && opener !== document.body && opener.isConnected) opener.focus()
+ if (opener !== null && opener !== document.body && opener.isConnected) {
+ opener.focus()
+ return
+ }
+ // **Nothing opened it.** `consoleOpen` outlives a run, so the next run mounts the drawer
+ // already open, with focus on nothing to remember. The button that toggles it is the
+ // nearest thing to an opener there is.
+ document.querySelector('[data-console-toggle]')?.focus()
}
}, [open])
diff --git a/ui/src/components/PdHealthReport.tsx b/ui/src/components/PdHealthReport.tsx
index 41533f8..e70cee8 100644
--- a/ui/src/components/PdHealthReport.tsx
+++ b/ui/src/components/PdHealthReport.tsx
@@ -260,7 +260,7 @@ export function PdHealthReport({
// be selected is already in the document to take focus.
document.getElementById(`health-tab-${next}`)?.focus()
}}
- className={`rounded-t-pd px-3 py-1.5 font-mono text-data ${
+ className={`relative rounded-t-pd px-3 py-1.5 font-mono text-data ${
tab === key
? 'border-b-2 border-accent text-text'
: 'text-text-dim hover:bg-surface-2'
diff --git a/ui/src/components/PdPackageTable.test.tsx b/ui/src/components/PdPackageTable.test.tsx
index 16173ce..b620022 100644
--- a/ui/src/components/PdPackageTable.test.tsx
+++ b/ui/src/components/PdPackageTable.test.tsx
@@ -223,8 +223,12 @@ describe('grid structure', () => {
.getAllByRole('row')
.find((row) => row.getAttribute('data-pinned') === 'true')
if (pinned === undefined) throw new Error('the fixture has no pinned row')
- expect(within(pinned).getByText(/kept at this version|left out of every update/)).toHaveClass(
- 'sr-only',
- )
+ const explained = within(pinned).getByText(/kept at this version|left out of every update/)
+ expect(explained).toHaveClass('sr-only')
+ // `sr-only` is `position: absolute`. Without a positioned ancestor it is laid out against the
+ // viewport and escapes every scroller above it — on Pins, where nothing between the chip and
+ // is positioned, a long list of these made the whole window scroll and took the header
+ // with it. The chip is the containing block.
+ expect(explained.parentElement).toHaveClass('relative')
})
})
diff --git a/ui/src/components/PdPackageTable.tsx b/ui/src/components/PdPackageTable.tsx
index 9641061..98ba2fc 100644
--- a/ui/src/components/PdPackageTable.tsx
+++ b/ui/src/components/PdPackageTable.tsx
@@ -108,7 +108,7 @@ export function PdPackageTable({
{/* The checkbox and action columns have no visible heading, and are still columns: the
header had five headings over six cells, so moving by column read "Status" above the
action buttons. Named for whoever cannot see which column they are in. */}
-
+ {t('packages.column.select')}
@@ -126,7 +126,7 @@ export function PdPackageTable({
{t('packages.column.status')}
-
+ {t('packages.column.actions')}
diff --git a/ui/src/screens/PdPlanPanel.test.tsx b/ui/src/screens/PdPlanPanel.test.tsx
index 8e7d658..647960b 100644
--- a/ui/src/screens/PdPlanPanel.test.tsx
+++ b/ui/src/screens/PdPlanPanel.test.tsx
@@ -61,6 +61,27 @@ describe('the summary phase', () => {
expect(screen.getAllByText('Back to packages')).toHaveLength(1)
})
+
+ it('has a heading even when there is no summary to show', () => {
+ // The shell puts focus on a screen's
when the screen is replaced. This branch had none —
+ // the sheet owns the heading and there is no sheet — so a run that failed before producing a
+ // summary left focus on , on exactly the screen where something had gone wrong.
+ usePlanStore.setState({
+ phase: 'summary',
+ outcome: null,
+ error: { code: 'PD-SNP-001', message: 'snapshot failed' },
+ })
+ render()
+
+ expect(screen.getByRole('heading', { level: 1 })).toHaveTextContent('Something went wrong')
+ })
+
+ it('has exactly one heading when the sheet is showing', () => {
+ usePlanStore.setState({ phase: 'summary', outcome: OUTCOME, kind: 'update' })
+ render()
+
+ expect(screen.getAllByRole('heading', { level: 1 })).toHaveLength(1)
+ })
})
const FORCED_STEP = flowStepForced as FlowStep
diff --git a/ui/src/screens/PdPlanPanel.tsx b/ui/src/screens/PdPlanPanel.tsx
index 6448f7c..c53b69c 100644
--- a/ui/src/screens/PdPlanPanel.tsx
+++ b/ui/src/screens/PdPlanPanel.tsx
@@ -83,6 +83,10 @@ export function PdPlanPanel({ onFinished }: PdPlanPanelProps) {
if (phase === 'summary') {
return (
+ {/* The sheet owns this screen's heading, and a run that failed before producing a summary
+ has no sheet — so this branch had no
, the shell had nothing to focus, and focus
+ stayed on on the one screen where something had gone wrong. */}
+ {outcome === null ?
{t('errors.title')}
: null}
{error === null ? null : (
@@ -245,6 +249,8 @@ export function PdPlanPanel({ onFinished }: PdPlanPanelProps) {
onClick={() => {
setConsoleOpen(!consoleOpen)
}}
+ // Where the drawer sends focus when it closes and nothing opened it.
+ data-console-toggle
className="rounded-pd border border-border px-3 py-1 text-data"
>
{t('plan.console')}
diff --git a/ui/src/screens/PdSearch.tsx b/ui/src/screens/PdSearch.tsx
index a504cb4..39229ae 100644
--- a/ui/src/screens/PdSearch.tsx
+++ b/ui/src/screens/PdSearch.tsx
@@ -108,7 +108,7 @@ export function PdSearch() {
earlier state to differ from. */}
{/* Warming is a state, not a failure: the index is 864k names and takes ~140 ms to
load, and saying so beats a field that silently returns nothing. */}
diff --git a/ui/src/styles.css b/ui/src/styles.css
index 75d64d4..d981059 100644
--- a/ui/src/styles.css
+++ b/ui/src/styles.css
@@ -161,9 +161,12 @@
/* `page` is the sidebar's active tab. The rule matched `'true'` alone, so the one thing that
* said which screen is showing was drawn like every other tab. */
- [aria-selected='true'],
- [aria-current='true'],
- [aria-current='page'] {
+ /* `:not(:focus-visible)`: this rule follows the focus ring's at equal specificity, so a
+ * focused selection — the current tab, the selected hit — got this 1px line in place of its
+ * 2px ring. */
+ [aria-selected='true']:not(:focus-visible),
+ [aria-current='true']:not(:focus-visible),
+ [aria-current='page']:not(:focus-visible) {
outline: 1px solid Highlight;
}