Commit f38dbb6
authored
refactor(admin): group the settings page into sections (#178)
* refactor(admin): group the settings page into sections
The admin page was one long list of fields. It is now split into
"Etherpad server", "Pad types and behaviour", "External pads and
embedding" and "Diagnostics", with the pad type toggles at the top of
their section and the field hints tied to their inputs.
Saving and the diagnostic tools report next to their own buttons instead
of into a single shared status line, so feedback appears where the action
was triggered. The two areas update independently – a late response no
longer clears the other one's result.
Hints are linked with aria-describedby, the dynamic "no pad type enabled"
hint announces itself via role="status", and spacing is set with explicit
row classes rather than negative margins.
Adds tests/js/admin-settings.test.js, the first coverage for
src/admin-settings.js.
* Address PR review comments
- The Playwright health-check helper still read the save status node, so
the admin health check spec would have failed against the new markup.
- Diagnostics fall back to the save status area when the diagnostics area
is absent, instead of silently dropping the feedback.
- The new unit tests mocked responses without `ok: true`, so they ran
through the error path; they now assert the success path explicitly.
* Make the pad type hint announce, prefix its sibling hint ids
role="status" was set on an element toggled via `display`, so the text
arrived as initial content rather than a change and screen readers
commonly stayed silent. The element is now always rendered and the script
writes or clears its text, which is what a live region reacts to; an
empty hint collapses via `.ep-field-hint:empty`, so nothing moves
visually. Re-rendering identical text is skipped so a server-rendered
message is not announced on load.
The six new hint ids gain the app's `epnc-` prefix, matching every other
id in the template.
* Trim the comments added while reviewing
The explanations were written for the review and read as heavy in the
final code. Kept only the reasoning that is not visible from the code
itself, at roughly a third the length.1 parent 04ef397 commit f38dbb6
14 files changed
Lines changed: 424 additions & 79 deletions
File tree
- css
- js
- l10n
- lib/Settings
- src
- templates
- tests
- e2e/fixtures
- js
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
14 | | - | |
| 20 | + | |
15 | 21 | | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
17 | 25 | | |
18 | | - | |
19 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
20 | 30 | | |
21 | 31 | | |
22 | | - | |
23 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
24 | 36 | | |
25 | 37 | | |
26 | | - | |
27 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
28 | 46 | | |
29 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
30 | 75 | | |
31 | 76 | | |
32 | 77 | | |
33 | 78 | | |
| 79 | + | |
34 | 80 | | |
35 | 81 | | |
36 | 82 | | |
| |||
42 | 88 | | |
43 | 89 | | |
44 | 90 | | |
| 91 | + | |
45 | 92 | | |
46 | 93 | | |
47 | 94 | | |
48 | 95 | | |
49 | | - | |
| 96 | + | |
| 97 | + | |
50 | 98 | | |
51 | 99 | | |
52 | 100 | | |
| |||
55 | 103 | | |
56 | 104 | | |
57 | 105 | | |
58 | | - | |
59 | | - | |
| 106 | + | |
| 107 | + | |
60 | 108 | | |
61 | 109 | | |
62 | 110 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments