WCAG 2.2 Accessibility - No Visible Labels - #540
Conversation
Context: Legends not visible in Entry Date form on Entity page Below the ‘Entry date’ section are two groups of input fields which have visually hidden legend elements. Whilst the legends are useful for screen reader users, voice activation users are unable to identify the questions being asked for each group of input fields and may be unable to make enter correct data as a result. Removing the visually hidden class enables voice activation users to understand the questions being asked related to the groups of input fields. Changes: - Remove visually hidden class
Context: Visually hidden labels on Find an area form on maps page The input fields below the h2 heading ‘Find an area’ have labels but they have been visually hidden. This issue may affect voice activation users who may be unable to reference the input fields with no visible label present. This change ensures visible labels are exposed to enable voice activation users to reference the input fields by their visible labels Changes: - Expose labels to all users - Update CSS so that the now visual labels are correctly aligned
WalkthroughThe map search form now displays its input labels and uses a wrapping flex layout. The two entry-date filter legends are also visible, while existing input associations and search behaviour remain unchanged. ChangesVisible form controls
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@application/templates/partials/search-facets.html`:
- Around line 203-205: Update the legend text in the search facets fieldset to
clearly describe the available radio options, matching the labels “Since” and
“Before” and removing the confusing “since ... or after” wording.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b5448f19-dd5a-4916-8cb7-301444aa27a0
📒 Files selected for processing (3)
application/templates/components/map-find-an-area-form/macro.jinjaapplication/templates/partials/search-facets.htmlassets/stylesheets/pages/_map.scss
| <legend class="govuk-fieldset__legend govuk-fieldset__legend--s"> | ||
| Do you want to see entries since the date or after the date? | ||
| </legend> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Correct the confusing legend text.
Now that this legend is visible, the wording "since the date or after the date?" is exposed. Since "since" and "after" are effectively synonyms in this context, and the radio buttons below are labelled Since and Before, this text is confusing.
Update the text to match the available options.
📝 Proposed fix
<fieldset class="govuk-fieldset">
<legend class="govuk-fieldset__legend govuk-fieldset__legend--s">
- Do you want to see entries since the date or after the date?
+ Do you want to see entries since the date or before the date?
</legend>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <legend class="govuk-fieldset__legend govuk-fieldset__legend--s"> | |
| Do you want to see entries since the date or after the date? | |
| </legend> | |
| <legend class="govuk-fieldset__legend govuk-fieldset__legend--s"> | |
| Do you want to see entries since the date or before the date? | |
| </legend> |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@application/templates/partials/search-facets.html` around lines 203 - 205,
Update the legend text in the search facets fieldset to clearly describe the
available radio options, matching the labels “Since” and “Before” and removing
the confusing “since ... or after” wording.
|
Both these examples are multi-step questions, so the label should be covering both input fields. I don't know if theres a way to do this? I've done some figma mock-ups of approaches we could do. I know the map work is upcoming so I think we should either hold off to save effort or do option 3 which will be reused in the map (although this would take up more space on the page). Also done 2 versions for the entry date filter - option 1 is preferable if it solves the problem. |
What type of PR is this? (check all applicable)
Description
For WCAG 2.2 Accessibility optimisation
WCAG - DAC 01 No Visible Label
Legends not visible in Entry Date form on Entity page
Below the ‘Entry date’ section are two groups of input fields which have
visually hidden legend elements. Whilst the legends are useful for
screen reader users, voice activation users are unable to identify the
questions being asked for each group of input fields and may be unable
to make enter correct data as a result. Removing the visually hidden
class enables voice activation users to understand the questions being
asked related to the groups of input fields.
Changes:
WCAG - DAC 02 No Visible Label
Visually hidden labels on Find an area form on maps page
The input fields below the h2 heading ‘Find an area’ have labels but
they have been visually hidden. This issue may affect voice activation
users who may be unable to reference the input fields with no visible
label present. This change ensures visible labels are exposed to enable
voice activation users to reference the input fields by their visible
labels
Changes:
Related Tickets & Documents
QA Instructions, Screenshots, Recordings
https://www.planning.data.gov.uk/entity/
https://www.planning.data.gov.uk/map/?
Added/updated tests?
We encourage you to keep the code coverage percentage at 80% and above. Please refer to the Digital Land Testing Guidance for more information.
have not been included
[optional] Are there any post deployment tasks we need to perform?
[optional] Are there any dependencies on other PRs or Work?
Summary by CodeRabbit
Accessibility Improvements
Style