Commit 6ee6fbf
fix: add name attributes to generated settings-UI form controls (a11y) (#1497)
* fix: add name attributes to generated settings-UI form controls (a11y)
The settings UI generates its form controls (tool toggles, group masters,
feature-flag / advanced / backup / code-mode fields, policy inputs) in JS
without an id or name, tripping the accessibility rule "form field should
have an id or name attribute" (~100 warnings on a populated page).
Add a derived, additive `name` to each generator (e.g. `tool:<tool>:enabled`,
`adv:<field>`, `feature:<field>`, `backup:<field>`, `policy:<purpose>`). No
selector or event handler reads `name` (selection is via `data-*`), so
behaviour — including the toggle / disabled / gate logic — is unchanged. A
holistic JS-harness test asserts every rendered <input> carries a name or id.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: address PR #1497 Gemini review — <select> a11y + format
- Add `name` to the 4 generated <select> controls the input-only pass
missed: the 3 policy predicate selects (path / op / value) and the
advanced choices dropdown. The "id or name" a11y rule covers <select>
too.
- Expand the holistic a11y guard to scan <select> as well as <input>,
and add a choices field to its fixture so the advanced dropdown
actually renders and is verified.
- Drop the redundant local `import re` from the new tests (re is already
imported at module level).
- Run `ruff format` — the red CI step was `ruff format --check`, not the
lint check; the new test file was not canonically formatted.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test: cover tool-group + policy form-control names (#1497 step-5.5)
Pre-mark-ready adversarial pass surfaced two generators the holistic
guard didn't reach:
- group-master toggle: added a `name="tool-group:"` sanity assert to the
holistic test (it already renders in that fixture).
- policy predicate controls: new test drives policyLoadConfig() with one
rule so renderPolicyCard emits the predicate form, asserting name= on
the path/op/custom selects + the remember-minutes input. The predicate
value control is op-change/async-gated; its name is set at both
generator sites and covered by review.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test: also cover the int feature-flag input in the holistic a11y guard
tool_search_max_results is an int-typed feature flag, so it exercises the
number-input branch of the feature-flag generator. Add it to the holistic
fixture (+ sanity assert) so that generator's name= is render-tested too.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* test: close predicate-value render gap + address PR #1497 review (4 items)
Adds a render test for the policy predicate *value* control — the one
touched surface that had no coverage — and applies the three optional
review nits.
- New test_policy_predicate_value_control_carries_name_attribute drives
both generator sites through the JS harness: a tool-schema 503 -> the
renderFreeTextValue <input> branch; a schema enum on the chosen path ->
the renderChoiceSelect <select> branch. Each asserts the control
carries name="policy:predicate-value".
- Reword the test_policy_predicate_controls_carry_name_attribute
docstring: the value control renders on form-open (not only op-change)
and now has its own dedicated test.
- Element-scope the name asserts in test_backup_config_inputs_* and
test_policy_predicate_controls_* (regex against a single <input>/<select>
tag instead of a whole-DOM substring).
- Soften the code_mode_max_duration sanity comment: the name is emitted
by both the advanced-field generator and renderCodeModeSubRows, so the
assert only proves a control with that name rendered.
- Precise the holistic-guard docstring: "every form surface present at
default page init" (the ?tab= deep-link can auto-activate backup/policy).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 9443446 commit 6ee6fbf
2 files changed
Lines changed: 510 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1618 | 1618 | | |
1619 | 1619 | | |
1620 | 1620 | | |
1621 | | - | |
| 1621 | + | |
1622 | 1622 | | |
1623 | 1623 | | |
1624 | 1624 | | |
| |||
1722 | 1722 | | |
1723 | 1723 | | |
1724 | 1724 | | |
1725 | | - | |
| 1725 | + | |
1726 | 1726 | | |
1727 | 1727 | | |
1728 | 1728 | | |
1729 | 1729 | | |
1730 | 1730 | | |
1731 | | - | |
| 1731 | + | |
1732 | 1732 | | |
1733 | 1733 | | |
1734 | 1734 | | |
1735 | 1735 | | |
1736 | 1736 | | |
1737 | 1737 | | |
1738 | | - | |
| 1738 | + | |
1739 | 1739 | | |
1740 | 1740 | | |
1741 | 1741 | | |
| |||
1926 | 1926 | | |
1927 | 1927 | | |
1928 | 1928 | | |
1929 | | - | |
| 1929 | + | |
1930 | 1930 | | |
1931 | 1931 | | |
1932 | | - | |
| 1932 | + | |
1933 | 1933 | | |
1934 | 1934 | | |
1935 | 1935 | | |
1936 | 1936 | | |
1937 | 1937 | | |
1938 | | - | |
| 1938 | + | |
1939 | 1939 | | |
1940 | 1940 | | |
1941 | 1941 | | |
| |||
2396 | 2396 | | |
2397 | 2397 | | |
2398 | 2398 | | |
| 2399 | + | |
2399 | 2400 | | |
2400 | 2401 | | |
2401 | 2402 | | |
| |||
2444 | 2445 | | |
2445 | 2446 | | |
2446 | 2447 | | |
| 2448 | + | |
2447 | 2449 | | |
2448 | 2450 | | |
2449 | 2451 | | |
| |||
2514 | 2516 | | |
2515 | 2517 | | |
2516 | 2518 | | |
| 2519 | + | |
2517 | 2520 | | |
2518 | 2521 | | |
2519 | 2522 | | |
| |||
2605 | 2608 | | |
2606 | 2609 | | |
2607 | 2610 | | |
| 2611 | + | |
2608 | 2612 | | |
2609 | 2613 | | |
2610 | 2614 | | |
| |||
2817 | 2821 | | |
2818 | 2822 | | |
2819 | 2823 | | |
2820 | | - | |
| 2824 | + | |
2821 | 2825 | | |
2822 | 2826 | | |
2823 | | - | |
| 2827 | + | |
2824 | 2828 | | |
2825 | 2829 | | |
2826 | 2830 | | |
2827 | 2831 | | |
2828 | | - | |
| 2832 | + | |
2829 | 2833 | | |
2830 | 2834 | | |
2831 | 2835 | | |
| |||
2850 | 2854 | | |
2851 | 2855 | | |
2852 | 2856 | | |
2853 | | - | |
| 2857 | + | |
2854 | 2858 | | |
2855 | 2859 | | |
2856 | 2860 | | |
| |||
3084 | 3088 | | |
3085 | 3089 | | |
3086 | 3090 | | |
3087 | | - | |
| 3091 | + | |
3088 | 3092 | | |
3089 | 3093 | | |
3090 | 3094 | | |
| |||
3114 | 3118 | | |
3115 | 3119 | | |
3116 | 3120 | | |
3117 | | - | |
| 3121 | + | |
3118 | 3122 | | |
3119 | 3123 | | |
3120 | 3124 | | |
| |||
3643 | 3647 | | |
3644 | 3648 | | |
3645 | 3649 | | |
3646 | | - | |
| 3650 | + | |
3647 | 3651 | | |
3648 | 3652 | | |
3649 | 3653 | | |
3650 | 3654 | | |
3651 | 3655 | | |
3652 | | - | |
| 3656 | + | |
3653 | 3657 | | |
3654 | | - | |
| 3658 | + | |
3655 | 3659 | | |
3656 | 3660 | | |
3657 | 3661 | | |
3658 | 3662 | | |
3659 | 3663 | | |
3660 | 3664 | | |
3661 | | - | |
| 3665 | + | |
3662 | 3666 | | |
3663 | 3667 | | |
3664 | 3668 | | |
| |||
0 commit comments