alphagov / govuk-design-system

One place for service teams to find styles, components and patterns for designing government services.
https://www.gov.uk/design-system
MIT License
512 stars 232 forks source link

WCAG 2.2: File upload || Redundant entry #2664

Closed dav-idc closed 1 year ago

dav-idc commented 1 year ago

What

Investigate whether there's a technical method for storing uploaded files for the duration of a service journey, to ensure that people don't need to re-upload or re-submit a file partway through the journey.

Scenarios to consider:

I have a feeling a lot of the solutions we come up with to meet 'Redundant entry' for files will be content / guidance, but I'm hoping we can do a technical investigation first, to see what's feasible and possible.

Resources

Why

The new WCAG 2.2 criterion 'Redundant entry' says:

Information previously entered by or provided to the user that is required to be entered again in the same process is either:

  • auto-populated, or
  • available for the user to select.

File uploads and the information contained within the files would presumably be within scope, for the duration of the 'process' (service journey).

Who needs to work on this

Developer

Who needs to review this

Accessibility specialist, content designer or technical writer

Done when

querkmachine commented 1 year ago

The method of uploading and managing files is going to be specific to the service's infrastructure and code. Doing anything client-side would be difficult as security rules prevent us from programatically setting the value of a file input to anything other than empty.

There might be something possible in using JavaScript to read and encode a selected file to localstorage and somehow re-populating that if a user returns afterwards, but it would likely come with a bunch of other caveats (JS dependency, smaller maximum file size, potential security issues) and likely require changes to service's backend implementations to make it work nicely. It starts veering into the high technical complexity for not much benefit zone, I feel.

I think this realistically would need to be a guidance change rather than something we can provide or enforce through our code.

dav-idc commented 1 year ago

This has been added to the 'WCAG 2.2 content updates' document.

calvin-lau-sig7 commented 1 year ago

Closing issue – content has been drafted, reviewed and added to pull request #3090 as part of https://github.com/alphagov/govuk-design-system/issues/3276.