Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task list component #2261

Merged
merged 1 commit into from
Jun 19, 2023
Merged

Task list component #2261

merged 1 commit into from
Jun 19, 2023

Conversation

frankieroberto
Copy link
Contributor

@frankieroberto frankieroberto commented Jun 24, 2021

This adds a new component for the existing Task list pattern, which is widely in use by services. (At the moment, this requires custom code, such as is included in the GOV.UK Prototyping Kit).

The component can be used to create a single task list. Multiple task lists can be added, with headings, to create a task list page, where there are groups of related tasks.

This component was developed collaboratively by the cross-government Task list group, based upon the research and experience of teams using the pattern in live services.

Some changes were made based upon feedback from service teams:

  • the whole 'row' of the task is clickable, as in research some users have been observed clicking the status text
  • the status tag was redesigned to no longer user uppercase text, and to use lighter colours - this was done separately in PR #3502
  • there is an option to use plain text instead of a tag component for a task status - this is intended for 'completed' tasks, as they don't need as much attention drawn to them
  • tasks can be made non-clickable – this is intended for tasks with a status of 'Cannot start yet'.

Thanks to

@ImranH-GDS @owenatgov @MK-NG @steve-oconnor @Dawdre @lfdebrux @frankieroberto @christopherthomasdesign @calvin-lau-sig7 @36degrees @timpaul @paulrobertlloyd and many others!

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 July 2, 2021 11:03 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 July 2, 2021 11:08 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 July 2, 2021 11:14 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 July 5, 2021 09:36 Inactive
@frankieroberto
Copy link
Contributor Author

One of the questions for this component is what do we call the param that holds the array of things with statuses?

Our initial instinct was to use rows to match Summary List and because they look like rows (horizontally divided).

However I've done a quick check of what existing components use:

Accordion: items
Breadcrumbs: items
Checkboxes: items
Error summary: errorList
Footer: items, navigation
Header: navigation
Radios: items
Summary List: rows, actions
Table: rows, head
Tabs: items

Based on this, I wonder whether it would be more consistent to use items instead? That would also not tie us to a particular visual style, should the component evolve in future to render differently.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 July 15, 2021 19:24 Inactive
@frankieroberto
Copy link
Contributor Author

GDS wrote a summary back in 2017 of some of the pros and cons of using Tables, Definition lists and Lists.

@frankieroberto
Copy link
Contributor Author

We might want to add role=list to the <ul>, see alphagov/govuk-prototype-kit#1009 cc: @edwardhorsford

@frankieroberto
Copy link
Contributor Author

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 August 17, 2021 19:10 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 August 17, 2021 19:55 Inactive
@frankieroberto
Copy link
Contributor Author

frankieroberto commented Aug 17, 2021

One of the questions for this component is what do we call the param that holds the array of things with statuses?
[...]
Based on this, I wonder whether it would be more consistent to use items instead? That would also not tie us to a particular visual style, should the component evolve in future to render differently.

I've switched to items as the param name in 181273d, based on the following rationale:

  • 6 components use items vs 2 that use rows
  • Consistency with the HTML tag name (<li> - "list item") and CSS class name (govuk-task-list__item)
  • More generic, not tied to visual appearance

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 November 25, 2021 13:55 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 December 8, 2021 13:14 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 December 8, 2021 13:40 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 December 8, 2021 14:01 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 December 8, 2021 14:06 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 March 4, 2022 15:42 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 March 4, 2022 16:25 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 March 4, 2022 16:40 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 March 10, 2022 16:59 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 March 14, 2022 17:03 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 March 14, 2022 17:06 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 March 14, 2022 17:10 Inactive
@lfdebrux lfdebrux requested a review from owenatgov March 25, 2022 10:11
@frankieroberto
Copy link
Contributor Author

@36degrees I think I’ve made all the changes - thanks for spotting them all! 👏

Would you mind approving the test workflows, and checking and re-reviewing the code? Thanks!

Copy link
Contributor

@36degrees 36degrees left a comment

Choose a reason for hiding this comment

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

This looks good – thanks for all your hard work on this @frankieroberto 🙌🏻

A few final things to sort:

  • We need to add a changelog entry to tell users know about this exciting new component!
  • Ideally we'd improve the commit structure, ideally reducing to a small number of meaningful commits and removing the merges. Is that something you'd be comfortable doing? I'm happy to do this for you if you'd prefer.
  • It'd be good to add some more tests to cover the various different macro options to ensure they're working as intended. This is a little laborious, so I'm happy to create an issue for our team to do this in a follow up PR unless you're particularly keen to be involved?

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 June 19, 2023 12:17 Inactive
@frankieroberto frankieroberto changed the title Task list component (x-gov collaboration) Task list component Jun 19, 2023
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 June 19, 2023 12:42 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 June 19, 2023 12:57 Inactive
@36degrees
Copy link
Contributor

It'd be good to add some more tests to cover the various different macro options to ensure they're working as intended. This is a little laborious, so I'm happy to create an issue for our team to do this in a follow up PR unless you're particularly keen to be involved?

Discussed this with @frankieroberto and have raised an issue for us to do this (#3828).

I believe the other points have been addressed. This just needs a second review and then we can get it merged – @owenatgov would you be happy to take another look?

@36degrees 36degrees requested a review from owenatgov June 19, 2023 12:59
Copy link
Contributor

@owenatgov owenatgov left a comment

Choose a reason for hiding this comment

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

My final extremely pedantic review comment is that the hint param still needs a description. Once that's done then I'm more than happy to approve this.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-2261 June 19, 2023 14:21 Inactive
@frankieroberto
Copy link
Contributor Author

@owenatgov:

My final extremely pedantic review comment is that the hint param still needs a description. Once that's done then I'm more than happy to approve this.

Fixed (squashed the commit and force-pushed) - thanks for spotting.

Copy link
Contributor

@owenatgov owenatgov left a comment

Choose a reason for hiding this comment

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

Well done everyone 🎉

@36degrees 36degrees merged commit be71a7a into alphagov:main Jun 19, 2023
20 checks passed
@frankieroberto frankieroberto deleted the task-list-component branch June 19, 2023 15:35
@romaricpascal romaricpascal mentioned this pull request Dec 8, 2023
github-merge-queue bot pushed a commit to x-govuk/govuk-components that referenced this pull request Dec 8, 2023
Following the release of [GOV.UK Design System
v5.0](https://github.com/alphagov/govuk-design-system/milestone/16),
govuk-components v5.0.0 will be released. The headline features are:

* support for GOV.UK Design System v5.0
* inclusion of [the task list
component](alphagov/govuk-frontend#2261) #425
* all new link helpers #419
* update header to use new SVG which combines the crown and the GOV.UK
test #466

Release notes will be drafted in #469.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design task list Task list pages
Projects
Development

Successfully merging this pull request may close these issues.

10 participants