Commit 3bf96c3
Port #1084 (part) to dtq-dev-9-base: accessible labels and per-component ids for the search boxes
Card X-02a, part B of three. Seven templates that the v9 upgrade took wholesale from vanilla 9.3, so
the accessibility hunks of 5a92fdf were never applied. Every one of these inputs is either
unnamed for a screen reader or named in hardcoded English regardless of the UI language.
What changes:
* a visually-hidden <label> is added for each control - two in eperson-search-box (the scope select
and the query input), three in starts-with-date (year, month, free-text date), one each in
group-search-box, members-list, subgroups-list, groups-registry and search-navbar;
* aria-label="Search input" and aria-label="Search scope", which were hardcoded English strings even
in the Czech UI, become bindings on the keys that already exist unreferenced in en.json5:
labelPrefix + 'search.input', labelPrefix + 'search.scope' and messagePrefix + '.search.input'.
No i18n key is added, removed or renamed;
* the hardcoded id="query" is replaced by a per-component id in all five components that carry it in
this set. formControlName and name stay "query"/"scope"; only the DOM id changes.
Three fork mistakes are ported fixed rather than literally, each for a reason that is checkable on
this branch:
1. class="sr-only" does not exist in Bootstrap 5 and 9-base defines it nowhere
(git grep -nE '^[[:space:]]*\.sr-only' -- src => 0 hits, "bootstrap": "^5.3"). A literal port would
render a visible label in the middle of every search form. The class used is visually-hidden,
which is defined at src/styles/_global-styles.scss:280 and is position:absolute, so it adds
nothing to the input-group layout.
2. <label for="startsWith + 'input'"> and <label for="'query' + '-input'"> are static attributes, not
bindings: they emit those characters literally and pair with nothing. The ids here are static, so
the labels use plain static for= values that match the real id.
3. The group edit page renders ds-members-list and ds-subgroups-list side by side
(group-form.component.html:60 and :65) and both hardcoded id="query". Adding <label for="query">
without disambiguating first would have bound both labels to the first input.
The fork also gave starts-with-date [id]="startsWith + 'input'". startsWith is mutated as the user
types (starts-with-date.component.ts:123), so the id would change on every keystroke and the label
association would break. A static id="startsWith-input" is used instead.
Tests: 5a92fdf ships none. eperson-search-box.component.spec.ts gains cases asserting that each
control's label resolves to that control (label.htmlFor === input.id, id non-empty) and that the
accessible name is the translated key rather than the literal "Search input". Proven load-bearing
with negative controls - see the PR description.
Source: 5a92fdf (dtq-dev PR #1084), partial - the suggestion inputs from the same commit are in
the sibling PR for card X-02a part C.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 8ac588e commit 3bf96c3
10 files changed
Lines changed: 79 additions & 12 deletions
File tree
- src/app
- access-control/group-registry
- group-form
- members-list
- subgroup-list
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
202 | 215 | | |
203 | 216 | | |
204 | 217 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
220 | 233 | | |
221 | 234 | | |
222 | 235 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | | - | |
13 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
98 | 128 | | |
99 | 129 | | |
100 | 130 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
0 commit comments