Skip to content

Improve how we display long lists of options for Welsh translations - #3175

Open
stephencdaly wants to merge 6 commits into
mainfrom
improve-how-we-display-long-lists-for-welsh-translations
Open

stephencdaly wants to merge 6 commits into
mainfrom
improve-how-we-display-long-lists-for-welsh-translations

Conversation

@stephencdaly

@stephencdaly stephencdaly commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this pull request solve?

Trello card: https://trello.com/c/s14o3lPs/

If a selection question has >30 options:

  • Don't show input fields for the selection options
  • Show a paragraph telling the user to upload a CSV of translations if there are no translations
  • Show added translations in a details component

Continue showing input fields if there are errors with any of the selection options, so the user can fix any problems.

When no translations have been added:

Screenshot 2026-10-06 at 13 29 17

When translations have been added and there are no errors:

Screenshot 2026-10-06 at 13 28 43

When translations have been added and there are errors:

Screenshot 2026-10-06 at 13 30 36

When answering "Yes" to "Have you finished adding your Welsh version?" and translations haven't been added:

Screenshot 2026-10-06 at 13 31 25

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

@stephencdaly
stephencdaly force-pushed the improve-how-we-display-long-lists-for-welsh-translations branch 10 times, most recently from b094f55 to 4763e3f Compare October 5, 2026 15:23
@stephencdaly
stephencdaly requested a balanced review from Copilot October 5, 2026 16:17

This comment was marked as resolved.

@stephencdaly
stephencdaly force-pushed the improve-how-we-display-long-lists-for-welsh-translations branch 2 times, most recently from b7546d2 to ed7cc48 Compare October 5, 2026 17:48
@stephencdaly
stephencdaly requested a balanced review from Copilot October 5, 2026 17:49

This comment was marked as resolved.

@stephencdaly
stephencdaly force-pushed the improve-how-we-display-long-lists-for-welsh-translations branch 3 times, most recently from 66ff22e to 8fa8568 Compare October 6, 2026 10:50
@stephencdaly
stephencdaly requested a balanced review from Copilot October 6, 2026 11:02

This comment was marked as resolved.

@stephencdaly
stephencdaly force-pushed the improve-how-we-display-long-lists-for-welsh-translations branch 2 times, most recently from ce0c6bf to 6f6bccb Compare October 6, 2026 11:31
@stephencdaly
stephencdaly requested a balanced review from Copilot October 6, 2026 11:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Reused caption IDs create ambiguous accessibility references when multiple selection questions are rendered.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (2)

Comment thread app/components/welsh_translation/selection_options_component/view.html.erb Outdated
@stephencdaly
stephencdaly force-pushed the improve-how-we-display-long-lists-for-welsh-translations branch from 6f6bccb to dd8fd0c Compare October 6, 2026 11:59
stephencdaly and others added 6 commits October 6, 2026 13:13
When there are >30 selection options for a question, don't display
the individual fields. Instead display translated options in a
details component, or a paragraph of text instructing the user to
upload a CSV of translations if none of the options have been
translated.

If there are errors with any of the translated options, display the
input fields for these options below the details component.

Include hidden fields for the selection options we aren't displaying
so that translations added by uploading a CSV will be saved when the
page is submitted.

Move the HTML for displaying selection options on the Welsh
translation page into a ViewComponent as this is now quite complex.

Co-Authored-By: Claude
For long lists of options, we show the completed translations in a
details component with hidden fields to store the values to submit.

If there are translations with errors, we show the input field for
these. We show the hidden fields after any fields that are not hidden
meaning they appear out of order on the page. When the form is
submitted, ensure we sort the selection options by their index when
storing the translations so that they will be stored and displayed in
the same order as the English options.
When there is a long list (>30) selection options for a questions, we
don't show the inputs and tell the user to upload a CSV.

Ensure that if the page is submitted with marked_complete set to true,
we validate that the selection options are present in this case and
show errors if they are not.
If there are duplicates in the translations of the selection options,
the error only appears in the error summary on the page and deos not
apply to individual inputs.

Ensure that if there is a long list of selection options for a
question, we display all the inputs if duplicates are detected so that
the user can fix the error.
Include a selection question with a long list of options in the form
used by the test so we can check these are displayed properly on the
translations page when the CSV is uploaded, and are saved as expected.
The fieldset's aria-describedby references the table's caption. Because the caption ID wasn't unique per question it might have resolved the wrong caption for assistive technology

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@stephencdaly
stephencdaly force-pushed the improve-how-we-display-long-lists-for-welsh-translations branch from a34a0a8 to 43c74d3 Compare October 6, 2026 12:13
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-3175.admin.review.forms.service.gov.uk/

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

@stephencdaly
stephencdaly marked this pull request as ready for review October 6, 2026 12:24
@stephencdaly stephencdaly changed the title Improve how we display long lists for welsh translations Improve how we display long lists of options for Welsh translations Oct 6, 2026
@stephencdaly

Copy link
Copy Markdown
Contributor Author

@william-castoncook could you check the content for this please? You can just look at the screenshots I've attached

@stephencdaly
stephencdaly requested a review from a team October 6, 2026 14:33

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants