Skip to main content

These components are for prototyping the GOV.UK app, not for use in production.

Chat

The app’s Chat tab, GOV.UK Chat, in its own words: a new chat with its welcome message and questions to try, a question being answered, and the answer, with the GOV.UK pages it used. Asking a question moves through all three.

From the app: Chat, the root of the Chat tab: a new chat, a question being answered, and its answer. To start a prototype from it, copy the folder src/templates/chat/ from the repository.

When to start from it

  • Prototyping a question and answer in GOV.UK Chat, such as how Chat should answer about a service.
  • Prototyping a change to how Chat looks or behaves, such as a new kind of answer or something new under the field.
  • Prototyping a journey that starts in Chat, or one that Chat hands on to another screen.
  • Testing different questions to try, or a change to Chat’s wording.

Screens

The journey starts on the first. Open one to try it, in a phone.

GOV.UK Chat

A new chat: the welcome message and three questions to try. The first question, or typing one and sending it, asks it.

index.html

Open GOV.UK Chat
Generating your answer

The question, with the loading indicator under it. Moves on to the answer by itself after 3 seconds.

generating.html

Open Generating your answer
Answer

Chat’s answer, with headings, a bulleted list, links and the GOV.UK pages it used. Sending another question asks it; Clear chat, in the field’s menu, starts a new chat.

answer.html

Open Answer

Using it

  • Copy the whole folder, so the screens keep linking to each other. Each page has a comment at its top saying what to change and what to leave.
  • The pages are plain HTML, so they move on with links, the field’s form and a page that refreshes. Whatever is typed, the answer is the one in answer.html.
  • To ask another question, change it in all three pages, and write its answer in answer.html. For a longer conversation, copy generating.html and answer.html for each question, and point each at the next.
  • Only the first question to try goes somewhere. Privacy notice, About and Give feedback, in the field’s menu, go nowhere.
  • The app asks the user to agree to GOV.UK Chat’s terms before their first chat. Those screens aren’t here.
  • Home and Settings on the tab bar open the Home and Settings templates, if they’re beside this one.

Components it uses

Sources

The app’s iOS screens it was taken from
  • iOS: ChatView in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/Chat/ChatView.swift at 3813aa2a
  • iOS: ChatViewModel, asking a question and its answer in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/ViewModels/Chat/ChatViewModel.swift at 3813aa2a
  • iOS: ChatCellView, the question, answer and loading in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/Chat/ChatCellView.swift at 3813aa2a
  • iOS: ChatExampleQuestionsView in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/Chat/ChatExampleQuestionsView.swift at 3813aa2a
  • iOS: ChatActionView, the field and its menu in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/Chat/ChatActionView.swift at 3813aa2a
  • iOS: Chat’s wording in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Resources/Strings/Chat.xcstrings at 3813aa2a