nhsuk / nhsuk-frontend

NHS.UK frontend contains the code you need to start building user interfaces for NHS websites and services.
https://nhsuk.github.io/nhsuk-frontend/
MIT License
606 stars 106 forks source link

DRAFT: WIP task-list component #969

Open edwardhorsford opened 1 month ago

edwardhorsford commented 1 month ago

Description

This PR adds the Task list component from the GOV.UK Design system. It's a WIP for discussion.

The template and sass are copied from GOV.UK's task list with minor changes:

Here's what it looks like: task-list

Tags

The main thing to resolve is what to do about tags. On the GOV.UK task list, completed and cannot start yet statuses are not tags - they are plain text. The tags are the same size as body copy. On NHSUK, tag text is a smaller size.

We could:

  1. Leave as is - completed and cannot start yet have larger size.
  2. Use tags for 'completed' and 'cannot start yet' instead of text.
  3. Make the statuses the same text size as tags, but no other styling
  4. Increase the font size of tags (like GOV.UK did).

I'm hesitant that adjusting tags might be a can of worms, and was one of the main reasons the GOV.UK component took so long to be released - so doing the minimal changes for this component would be preferred.

Checklist

edwardhorsford commented 1 month ago

Option 2: Use tags for all statuses

Screenshot 2024-06-12 at 15 56 51

Option 3: Make the statuses closer to tags, but no other styling

Screenshot 2024-06-12 at 15 54 51

Option 4 With tags adjusted to increase font size and remove bold

Screenshot 2024-06-12 at 15 52 47

anandamaryon1 commented 1 month ago

This is great, thanks @edwardhorsford

I agree that for this component, it'd be best to not have to redo tags (though I do like option 4).

For now, my preference is Option 3, as it avoid redesigning tags, doesn't look broken like Option 1, and it improves readability / scanning by reducing the number of tag colours used.

edwardhorsford commented 1 month ago

First revision after chatting with @frankieroberto and @anandamaryon1

Changes:

task-list-multiple-tasks

cjforms commented 1 month ago

Is there any chance that we could test a version where the statuses are given as:

The addition of tags has always seemed like an unnecessary complication to me, and your discussion of the options for the text in them just seems to me to add even more complication.

(Possibly related: I discovered today that the Probate Service is using a thing that looks rather like a task list, but where they have removed any option to view or start to complete sections in the order that the user prefers - which negates the entire purpose of the thing).

edwardhorsford commented 1 month ago

plain text when there is no action that you can take

We're hoping to release this initially without requiring changes to tags - primarily copying the GOV.UK task list component as reference - but intend to come back and look at tags in a follow-up bit of work.

Assuming we don't want to use tags for 'completed' and 'cannot start yet', that leaves us with a choice: We can leave non-tag statuses as body text, but then they look visually inconsistent next to the tags; Or else we can give them styling to make them more consistent with tags, but they will be smaller. It sounds like your preference is to the former (option 1).

a link where there is an action that you can take, and that works the same as clicking on the substantive task

I'm not entirely sure what you're describing here - could you say more? Users can click the entirety of the task to open it. Clicking anywhere in the row or the link does the same thing (same as GOV.UK).

cjforms commented 1 month ago

We're hoping to release this initially without requiring changes to tags - primarily copying the GOV.UK task list component as reference - but intend to come back and look at tags in a follow-up bit of work.

Great, happy to hear that.

Assuming we don't want to use tags for 'completed' and 'cannot start yet', that leaves us with a choice: We can leave non-tag statuses as body text, but then they look visually inconsistent next to the tags; Or else we can give them styling to make them more consistent with tags, but they will be smaller. It sounds like your preference is to the former (option 1).

Yes.

a link where there is an action that you can take, and that works the same as clicking on the substantive task

I'm not entirely sure what you're describing here - could you say more? Users can click the entirety of the task to open it. Clicking anywhere in the row or the link does the same thing (same as GOV.UK).

I know that we know that users can click anywhere in the row, but it doesn't give much affordance for clicking. I mean: have (say) 'Incomplete' look like a link that goes to the same place that clicking on the tag would take you to.

I do realise that there's a link on the left (in this example, 'Declaration') that goes to the same destination as the current tag/ suggested 'link' on the right (in this example, 'Incomplete') but we - and users - don't care that the whole panel is clickable but only the word 'Destination' looks like a link.

It's very similar to the problem we had some time ago with the GDS elements that styled the clickable area around small-target radios / checkboxes with a grey background to try to tell users that it was clickable - but lots of them didn't realise (irrespective of web-savviness) so that's why I proposed having the large-target radios/checkboxes, Joe Lanman tried it in a service, and then loads of people had to work hard to make it happen (hooray).

In the task list, I know there's the grey band that's meant to show the whole panel is clickable but I don't think it's enough. The tags are ambiguous - they look a bit buttony, so some folks may interpret them as buttons, but they don't look exactly like actual buttons so I think they are not buttony enough to appear reliably clickable. Whereas 'link' is a true Internet basic that pretty much everyone has to learn.

anandamaryon1 commented 1 month ago

Thanks @cjforms, interesting points.

The main affordance that the task can be clicked is its title which is a standard link, the hover effect and the fact you can click the whole row just adds additional backup to this, in my view. I'm not convinced that replacing the tags with links would necessarily be an improvement.

My main concerns with having two links would be:

cjforms commented 3 weeks ago

@anandamaryon1

Perhaps I wasn't entirely cleat that I'm requesting that my suggestions get tested?

The underlying principle here is to see whether the more complex item (the task list) can work with the simplest possible building blogs - that is, no tags.

I accept your point that in general we avoid having two links that go to the same place, but then in general we avoid introducing less familiar components.

We would also be increasing the amount of tabbing when using the keyboard alone, but we are only using a task list in the context of a highly complex form where a bit of tabbing is going to be minor compared to the overall workload of understanding the task list and dealing with the many entries that it includes.

That's why I'm suggesting testing the task list made from the simplest possible components.