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.

Commit
2cefd4907bba8fb345139d3c9ef108a0d3369df4
Author
Marius Peter <dev@marius-peter.com>
Author date
Committer
Marius Peter <dev@marius-peter.com>
Committer date
Changed files
lib/web/pages.ml
index 85ff4d81..d27efe7f 100644..100644
@@ -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
index 9effb8f8..6c63a9c2 100644..100644
@@ -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);