[OCaml] High Intensity Training Online
feat hide the exercise choice label
Keep the label associated with the exercise selector for assistive technology while removing its redundant visual presentation on the workout logging page.
Changed files
lib/web/pages.ml
@@ -767,7 +767,7 @@
767
767
tag "form" form_attrs
768
768
[
769
769
tag "label"
770
Removed:
[ Dream_html.string_attr "for" "exercise-choice" ]
770
Added:
[ Dream_html.string_attr "for" "exercise-choice"; class_ "sr-only" ]
771
771
[ txt "Exercise" ];
772
772
tag "select"
773
773
[
test/test_web.ml
@@ -440,6 +440,14 @@
440
440
Alcotest.(check bool)
441
441
"renders an exercise dropdown selector" true
442
442
(contains ~substring:"exercise-select" workout_page);
443
Added:
(* The exercise label stays for screen readers but is visually
444
Added:
hidden, so the dropdown reads without a redundant caption. *)
445
Added:
Alcotest.(check bool)
446
Added:
"keeps the exercise label for the select" true
447
Added:
(contains ~substring:"for=\"exercise-choice\"" workout_page);
448
Added:
Alcotest.(check bool)
449
Added:
"hides the exercise label visually with sr-only" true
450
Added:
(contains ~substring:"sr-only" workout_page);
443
451
Alcotest.(check bool)
444
452
"does not use the old tab strip class" false
445
453
(contains ~substring:"slot-tab" workout_page);