Skip to content

Commit e6e1d71

Browse files
authored
Merge pull request #207 from alphagov/feature-long-list-autocomplete
Feature long list autocomplete
2 parents 68e7c91 + 88d3cb1 commit e6e1d71

14 files changed

Lines changed: 314 additions & 0 deletions
Lines changed: 292 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,292 @@
1+
# Create long list autocomplete
2+
3+
## Status
4+
5+
Date created: *2024-11-26*
6+
7+
## Contents
8+
9+
- [Create long list autocomplete](#create-long-list-autocomplete)
10+
- [Status](#status)
11+
- [Contents](#contents)
12+
- [What](#what)
13+
- [Our users](#our-users)
14+
- [The problem](#the-problem)
15+
- [As-is](#as-is)
16+
- [To-be](#to-be)
17+
- [Key decisions](#key-decisions)
18+
- [Measuring impact](#measuring-impact)
19+
- [Designs](#designs)
20+
- [Create a select from a list of options question journey](#create-a-select-from-a-list-of-options-question-journey)
21+
- [Form creator can select an answer type for their question](#form-creator-can-select-an-answer-type-for-their-question)
22+
- [Form creator can specify their question first](#form-creator-can-specify-their-question-first)
23+
- [How many options should people be able to select - new step](#how-many-options-should-people-be-able-to-select---new-step)
24+
- [Create a list of options pages](#create-a-list-of-options-pages)
25+
- [One only](#one-only)
26+
- [One or many](#one-or-many)
27+
- [Edit question page - how we display answer settings and lists of options](#edit-question-page---how-we-display-answer-settings-and-lists-of-options)
28+
- [Edit selection type warning messages and flows](#edit-selection-type-warning-messages-and-flows)
29+
30+
___
31+
32+
## What
33+
34+
- Epic trello card: https://trello.com/c/HV51GGDO
35+
- Mural working board: https://app.mural.co/t/gaap0347/m/gaap0347/1728565191326/4e246ebea66098d181118529effec7e8776719db?sender=u1786fa2d2029c0638a5c0139
36+
37+
### Our users
38+
39+
- **Form creator** is a person who builds a digital form using GOV.UK Forms
40+
- **Form filler** is a person who fills in the form and submits it in order to receive a service
41+
- **Form processor** is a person who receives the answers from the form submission and uses the information to provide a service
42+
43+
### The problem
44+
45+
- There are forms that require longer lists of options to select from and a lack of custom list creation is a barrier to onboarding more forms
46+
- Form creators have to manually create long list questions
47+
(up to 30 options)
48+
- There is no quicker way to creating lists of options
49+
- Long lists of options are not user-friendly for form fillers
50+
- We don't have an autocomplete support for select one only long lists
51+
52+
53+
### As-is
54+
55+
- Form creator creates a question where the answer can be selected from a list of options. The list of options is limited to 30. Form creator can set if a person can select only one option or one or more options.
56+
- Form creator uses single repeatable fields to create their list of options
57+
- Form creator can specify if the list should include 'none of the above'
58+
59+
### To-be
60+
61+
- Form creator can create a list of more than 30 options when they expect the form filler to select only one option
62+
- Form creator has an easier way for creating a list of options, like pasting the list into a text box
63+
- Form filler can use an easier way to select from a longer list of options (30 +) by typing in the input field that reveals the options and progressively narrows them down with an autocomplete
64+
65+
66+
## Key decisions
67+
68+
- For select only one option we will allow long list for up to 1000 options. When the list of options is longer than 30, we present it to the form fillers as an autocomplete field. Form fillers will be able to search and find the options by typing into an autocomplete box. When the list of options is 30 and under we present it as radios.
69+
- For select one or more (checkboxes) we keep the limit to 30 options, so to ensure that form fillers have a positive user experience, as long lists can be difficult to use.
70+
- We introduce a new step where form creators can choose how many options should people be able to select, so that we can tailor their journey for creating lists of options
71+
- We introduce an additional way of entering options. Form creators can enter all the options into one text box with each option on a new line
72+
- After form creator has made their list of options, on the Edit page we present the list of options as a bullet list and we play back the amount of options they created for reassurance. If the list is longer than 10 options we present it in a 'detail' component, so that
73+
74+
## Measuring impact
75+
We made assumptions and trade-offs when designing and implementing the long lists feature. We needed to measure how the feature is used and in what context, so that we can spot potential problems and find ways to improve it.
76+
We kept the option to include 'None of the above' for select one only longer lists (30+) as weren't sure if there would be use cases for it, but didn't have enough evidence to remove it.
77+
78+
We're measuring how many live forms and questions use the select from a list of options answer type with a specific look into specific details on
79+
80+
- how many and which forms and questions use the long list autocomplete feature and do the questions include the 'none of the above' - this can tell us if there is an actual need and use for including 'none of the above'. And allow us to drill into more details of the context of the questions and the
81+
<br>
82+
83+
## Designs
84+
85+
#### Create a select from a list of options question journey
86+
87+
```mermaid
88+
89+
flowchart LR
90+
A["Start"] --> B["Add a question"]
91+
B --> C["What kind of answer do you need to this question?"]
92+
C -- Selection from a list of options --> D@{ label: "What's your question" }
93+
F{"How many options should people be able to select?"} -- One or more options --> G["Create a list of options<br>1000 limit"]
94+
F -- One option only --> H["Create a list of options<br>30 limit"]
95+
G -.-o I@{ label: "Enter your list's options into a textbox" }
96+
G --> n3["Edit question"]
97+
D --> F
98+
H --> n3
99+
H -.-o n4@{ label: "Enter your list's options into a textbox" }
100+
n3 --> n5["Save question"]
101+
n5 --> n6["End"]
102+
n4 --> n3
103+
I --> n3
104+
105+
```
106+
The diagram outlines the journey with these steps
107+
108+
**Start**
109+
110+
Page: Add and edit your questions -> Use 'Add a question' button
111+
112+
Page: What kind of answer do you need to this question? -> user selects 'Selection from a list of options' -> Continue
113+
114+
Page: What's your question -> User types in their question -> Continue
115+
116+
Page: How many options should people be able to select? -> Presenting two radio buttons: One option only or One or more options -> Select an option -> Continue
117+
118+
*The journey splits depending on which option was selected, but the steps are the same*
119+
120+
Page: Create a list of options -> User can input options one by one or Select a link to enter options into a text box -> Select link or Continue
121+
122+
If continue go to 'Edit question' page
123+
124+
If select link:
125+
126+
Page: Enter your list's of options into a text box -> User can Type or paste a list of options in to t a textarea -> User decides if their list should include 'none of the above' option -> Continue
127+
128+
Page: Edit question -> User can add more information to their question and edit it -> Save question
129+
130+
**End**
131+
132+
<br>
133+
134+
### Form creator can select an answer type for their question
135+
!["What kind of answer do you need to this question" page. Screenshot](screenshots-v1/000-what-kind-of-answer-do-you-need.png)
136+
137+
*A page titled: "What kind of answer do you need to this question?" with a list of answer types to select from*
138+
139+
From this page a **form creator** can select one answer type from a list
140+
141+
> * Person's name
142+
> * Company or organisation’s name
143+
> * Email address
144+
> * Phone number
145+
> * National Insurance number
146+
> * Address
147+
> * Date
148+
> * Selection from a list of options - *You’ll be able to create a list of options for people to select from*
149+
> * Number - *People will only be able to enter whole or decimal numbers*
150+
> * Text
151+
152+
Selection from a list of option is the starting point of creating lists of options as answers
153+
154+
### Form creator can specify their question first
155+
156+
!["What's your question?" page. Screenshot](screenshots-v1/001-what-is-your-question.png)
157+
158+
*A page titled: "What's your question?"*
159+
160+
With a text input and Continue button
161+
162+
<hr>
163+
164+
### How many options should people be able to select - new step
165+
<br>
166+
167+
!["How many options should people be able to select" page. Screenshot](screenshots-v1/002-how-many-options-can-people-select.png)
168+
169+
*A page titled: "How many options should people be able to select"*
170+
171+
With two radio options. User can select:
172+
* One option only - *Your list can have up to 1,000 options*
173+
* One or more options - *Your list can have up to 30 options*
174+
175+
and Continue button
176+
177+
We introduced this page to then tailor the content and logic to a specific case, where we allow single selection options to be up to 1000, but we keep the limit for multiple selection to 30 options.
178+
179+
<hr>
180+
181+
## Create a list of options pages
182+
183+
### Create a list of options - One only
184+
185+
!["Create a list of options" page. Screenshot](screenshots-v1/003-create-a-list-of-options-select-one-only-single-fields.png)
186+
187+
*A page titled: "Create a list of options"*
188+
189+
On this page we:
190+
* play back that people filling in the form will be able to select one option from the list
191+
* state that the limit of options is 1000
192+
* provide a standard way of creating list of options, where user enters each option into text field and can add more or remove them
193+
* provide an alternative way to creating a list of options, where form creator can enter all their options into one text box as a link to a new page
194+
* let users decide if their list should have a 'None of the above' option
195+
196+
<br>
197+
198+
### Enter your list's options into a text box
199+
200+
!["Enter your list's of options into a text box"](screenshots-v1/006-create-a-list-of-options-select-one-only-text-box.png)
201+
202+
*A page titled: "Enter your list's options into a text box"*
203+
204+
On this page we:
205+
* play back that people filling in the form will be able to select one option from the list
206+
* state that the limit of options is 1000
207+
* tell users, that if their list is longer than 30 options, people [filling in the forms] will be able to search and find the options by typing into an autocomplete box
208+
* provide a text box where users can type or paste long lists of options, which each option on a new line
209+
* let users decide if their list should have a 'None of the above' option
210+
211+
The task of creating the list of options is the same, but the main heading of this page is different, so that is more accessible and easier to distinguish for users when the land on a new page following a link.
212+
213+
### Create a list of options - One or many
214+
215+
!["Create a list of options" page. Screenshot"](screenshots-v1/004-create-a-list-of-options-select-many-single-fields.png)
216+
217+
On this page we:
218+
* play back that people filling in the form will be able to select one option or more options from the list
219+
* state that the limit of options is 30
220+
* provide a standard way of creating list of options, where user enters each option into text field and can add more or remove them
221+
* provide an alternative way to creating a list of options, where form creator can enter all their options into one text box as a link to a new page
222+
* let users decide if their list should have a 'None of the above' option
223+
224+
*A page titled: "Create a list of options"*
225+
226+
### Enter your list's options into a text box
227+
228+
!["Enter your list's of options into a text box"](screenshots-v1/005-create-a-list-of-options-select-many-single-fields.png)
229+
230+
*A page titled: "Enter your list's options into a text box"*
231+
232+
On this page we:
233+
* play back that people filling in the form will be able to select one or more options from the list
234+
* state that the limit of options is 30
235+
* provide a text box where users can type or paste long lists of options, which each option on a new line
236+
* let users decide if their list should have a 'None of the above' option
237+
238+
The task of creating the list of options is the same, but the main heading of this page is different, so that is more accessible and easier to distinguish for users when the land on a new page following a link.
239+
240+
241+
### Edit question page - how we display answer settings and lists of options
242+
243+
!["Edit question" page. Screenshot](screenshots-v1/010-edit-question-options-list.png)
244+
245+
*A page titled: "Edit question"*
246+
247+
On this page we:
248+
* Display the question text, and let user edit it
249+
* Let users include an optional hint text in a text box
250+
* Let user add guidance optionally if their question is more complex, and they need to explain how to answer the question
251+
* Show answer settings, where the user can review and edit them
252+
* in the answer settings we display the number of options they created, followed by the list of options. If the list is longer than 10 options, we wrap them in the detail component so that it's easier for them to scan the page
253+
* Let the use save the question, or delete it (after it's saved)
254+
* Provide a link to go back to their questions
255+
* Provide a link to edit next question
256+
257+
### Warning messages and errors
258+
259+
!["Important banner warnings". Screenshot](screenshots-v1/007-change-seletion-type-warnings.png)
260+
*A screenshot titled: "Important banner warnings"*
261+
262+
We provide warnings to the user when their actions can have an impact on the structure of their form, like routes or to the lists of options itself
263+
264+
If their list is longer than 30 options, and they want to switch to 'one or more options' we say:
265+
> If you change this to 'one or more options', you'll need to edit your list. You can only have up to 30 options in a list where people can select one or more options. If you make this change, you'll be able to edit your list on the next page.
266+
267+
If their list was using a route and was above 30 options, we say
268+
> If you change this to ‘one or more options’, the route from this question will be deleted, and you’ll need to edit the list. You can only have up to 30 options in a list where people can select one or more options. If you make this change, you’ll be able to edit your list on the next page.
269+
270+
<br>
271+
272+
!["Edit list of options page with error message". Screenshot](screenshots-v1/008-change-selection-type-reduce-options-list-edit-options.png)
273+
274+
*A page titled: "Edit list of options"*
275+
276+
When a form creator wants to change their list of options from 'select one only' to 'select one or more' we show them a message that they might need to edit their list of options (As shown in the 'Important banner warnings").
277+
If they proceed and their list of options is longer than 30, they will see an error message on the 'Edit list of options' page
278+
279+
>You cannot have more than 30 options in a list when people can select more than one option"
280+
281+
The form creator then can edit down their list of options in the text area to meet the limit.
282+
283+
If they save their changes, they get taken to Edit question page to view all their changes.
284+
285+
If the form creator didn't save their changes and used a back link, they will land on the 'Edit question' page. When they try to save the question and their list is still above the limit, we show them the same error message and highlight the area where they can 'Change' the list of options. Screenshot below.
286+
287+
<br>
288+
289+
!["Edit question page with error message". Screenshot](screenshots-v1/009-change-selection-type-reduce-option-list-on-edit-question.png)
290+
291+
*A page titled: "Edit question" with an error message*
292+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Create a question with a select from list answers
2+
3+
```mermaid
4+
5+
flowchart LR
6+
A["Start"] --> B["Add a question"]
7+
B --> C["What kind of answer do you need to this question?"]
8+
C -- Selection from a list of options --> D@{ label: "What's your question" }
9+
F{"How many options should people be able to select?"} -- One or more options --> G["Create a list of options<br>1000 limit"]
10+
F -- One option only --> H["Create a list of options<br>30 limit"]
11+
G -.-o I@{ label: "Enter your list's options into a textbox" }
12+
G --> n3["Edit question"]
13+
D --> F
14+
H --> n3
15+
H -.-o n4@{ label: "Enter your list's options into a textbox" }
16+
n3 --> n5["Save question"]
17+
n5 --> n6["End"]
18+
n4 --> n3
19+
I --> n3
20+
21+
```
66.3 KB
Loading
30.5 KB
Loading
38.3 KB
Loading
65.8 KB
Loading
65.8 KB
Loading
51 KB
Loading
60.6 KB
Loading
70.8 KB
Loading

0 commit comments

Comments
 (0)