Commit d297388
authored
fix(a11y): finish the Notice conversion in the appraise form (#137)
* fix(a11y): finish the Notice conversion in the appraise form
The last `&&`-gated Notice in the app, and the one PR #131 missed: a grep for
the pattern across server pages found six, but this one is in a client
component and reads `{state && !state.ok && <Notice/>}` rather than
`{message && <Notice/>}`.
It is the worst instance rather than an afterthought. `useActionState` keeps
this component mounted across a rejection — that is the whole reason it exists
(see the docblock) — so the surrounding tree never moves and the `&&` inserted
a fresh role="alert" node carrying its own text into an otherwise stable
document. In the server-page cases a document-less re-render at least changed
several things at once; here the region's birth IS the only change, which is
precisely the announcement AT handles least reliably.
The visible behaviour is unchanged. The comment's argument — that `state ===
null` covers both "hasn't submitted yet" and "still pending", neither of which
is a rejection worth announcing — is preserved exactly by moving the condition
into the children. Empty children render the reserved `.notice-slot`, which is
positioned out of flow, so the form-stack row gap does not open up.
Cost to a user: an operator on a screen reader who pastes a malformed loot list
into the appraise form is not reliably told the submit was rejected. The form
stays where it is and the paste survives, so nothing else on screen reports it
either.
Gates: node-version, typecheck, lint, format:check, build, npm test
(76 files / 1085 tests) all pass. docker build and test:e2e not run.
* fix(a11y): drop the seal's alt text, which repeated the heading below it (#138)
The login seal carried alt="<brand> emblem" two lines above
<h1>{brand.name}</h1>. Every other decorative image in the app already uses
alt="" — account/page.tsx:473, account/page.tsx:681, and, most directly,
ui.tsx:117, which is the same brand mark rendered immediately before the
wordmark that spells the brand out in text. /login was the one exception.
Cost to a user: a screen-reader visitor to the only page an unauthenticated
person can reach hears the brand name, then the brand name again, before
reaching the motto, the scope disclosure, or the sign-in control. The emblem
communicates nothing the h1 does not, which is the case alt="" exists for.
The EVE SSO mark below keeps its alt: that image is the control's label, not
decoration, and nothing else names it.
The eslint-disable-next-line for @next/next/no-img-element now sits directly
above the <img> again — the new comment goes above it, not between. Inserting
it between broke the directive's adjacency and reintroduced the warning #123
cleared; lint is quoted below to show it is clean.
Gates: node-version, typecheck, lint (0 warnings), format:check, build,
npm test (76 files / 1085 tests) all pass. docker build and test:e2e not run.1 parent a5294d9 commit d297388
2 files changed
Lines changed: 21 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
| |||
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
91 | | - | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
140 | 148 | | |
141 | 149 | | |
142 | 150 | | |
| |||
0 commit comments