Skip to content

[HOTE-1141] feat: update-ui-page-titles#410

Open
ConnorF-NHS wants to merge 9 commits intomainfrom
feature/hote-1141/accessibility-page-titles-spa-updates
Open

[HOTE-1141] feat: update-ui-page-titles#410
ConnorF-NHS wants to merge 9 commits intomainfrom
feature/hote-1141/accessibility-page-titles-spa-updates

Conversation

@ConnorF-NHS
Copy link
Copy Markdown
Contributor

@ConnorF-NHS ConnorF-NHS commented Apr 24, 2026

Description

Context

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

Copilot AI review requested due to automatic review settings April 24, 2026 15:10
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

Lambdas Coverage Report

Lines Statements Branches Functions
Coverage: 97%
97.99% (2052/2094) 91.46% (579/633) 96.37% (346/359)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

UI Coverage Report

Lines Statements Branches Functions
Coverage: 96%
96.44% (6016/6238) 88.75% (742/836) 88.53% (224/253)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates UI page title handling across the React Router SPA so each route sets a consistent document.title using content-driven pageTitle strings (and a shared service name suffix).

Changes:

  • Adds usePageTitle(...) usage to multiple route/page components and introduces a formatPageTitle(...) helper + updated default service name.
  • Extends content types (ui/content/schema.ts) and content JSON to include pageTitle values for affected pages.
  • Updates/introduces Jest tests to assert page title behavior (including a new integration test covering navigation and supplier legal docs).

Reviewed changes

Copilot reviewed 51 out of 51 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ui/src/state/PostcodeLookupContext.tsx Refactors postcode lookup session rehydration to initialize state from persisted values without a separate hydration effect.
ui/src/routes/get-self-test-kit-for-HIV-journey/SelectDeliveryAddressPage.tsx Sets a dynamic page title based on address count using formatPageTitle.
ui/src/routes/get-self-test-kit-for-HIV-journey/OrderSubmittedPage.tsx Sets page title from content pageTitle.
ui/src/routes/get-self-test-kit-for-HIV-journey/NoAddressFoundPage.tsx Sets page title from content pageTitle.
ui/src/routes/get-self-test-kit-for-HIV-journey/KitNotAvailableInAreaPage.tsx Sets page title from content pageTitle.
ui/src/routes/get-self-test-kit-for-HIV-journey/HowComfortablePrickingFingerPage.tsx Sets page title from content pageTitle.
ui/src/routes/get-self-test-kit-for-HIV-journey/GoToClinicPage.tsx Sets page title from content pageTitle.
ui/src/routes/get-self-test-kit-for-HIV-journey/EnterMobileNumberPage.tsx Sets page title from content pageTitle.
ui/src/routes/get-self-test-kit-for-HIV-journey/EnterDeliveryAddressPage.tsx Sets page title from content pageTitle.
ui/src/routes/get-self-test-kit-for-HIV-journey/EnterAddressManuallyPage.tsx Sets page title from content pageTitle.
ui/src/routes/get-self-test-kit-for-HIV-journey/ConfirmMobileNumberPage.tsx Sets page title from content pageTitle.
ui/src/routes/get-self-test-kit-for-HIV-journey/CheckYourAnswersPage.tsx Sets page title from content pageTitle.
ui/src/routes/get-self-test-kit-for-HIV-journey/CannotUseServiceUnder18Page.tsx Sets page title from content pageTitle.
ui/src/routes/get-self-test-kit-for-HIV-journey/BloodSampleGuidePage.tsx Sets page title from content pageTitle.
ui/src/routes/TestResultsPage.tsx Sets page title from content pageTitle.
ui/src/routes/ServiceErrorPage.tsx Sets page title from content pageTitle.
ui/src/routes/OrderTrackingPage.tsx Sets page title from content pageTitle.
ui/src/routes/LoginPage.tsx Sets page title using formatPageTitle("Sign in").
ui/src/routes/HomeTestTermsOfUsePage.tsx Sets page title from legal content pageTitle.
ui/src/routes/HomeTestPrivacyPolicyPage.tsx Sets page title from legal content pageTitle.
ui/src/routes/CallbackPage.tsx Sets page title using formatPageTitle("Signing you in").
ui/src/lib/utils/page-title.ts Introduces SERVICE_NAME + formatPageTitle and updates the default page title.
ui/src/components/SupplierLegalDocumentContent.tsx Sets page title for supplier legal documents using formatPageTitle.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/SelectDeliveryAddressPage.test.tsx Adds a document title assertion for the dynamic select-address title.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/OrderSubmittedPage.test.tsx Adds a document title assertion.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/NoAddressFoundPage.test.tsx Adds a document title assertion.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/KitNotAvailableInAreaPage.test.tsx Verifies usePageTitle called with content pageTitle.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/HowComfortablePrickingFingerPage.test.tsx Verifies usePageTitle called with content pageTitle.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/GoToClinicPage.test.tsx Verifies usePageTitle called with content pageTitle.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/GetSelfTestKitPage.test.tsx Updates expected page title string to new format/service name.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/EnterMobileNumberPage.test.tsx Adds supplier seeding helper + document title assertion.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/EnterDeliveryAddressPage.test.tsx Adds a document title assertion.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/EnterAddressManuallyPage.test.tsx Adds a document title assertion.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/ConfirmMobileNumberPage.test.tsx Adds state seeding helpers + document title assertion; updates heading expectations.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/CheckYourAnswersPage.test.tsx Adds a document title assertion.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/CannotUseServiceUnder18Page.test.tsx Verifies usePageTitle called with content pageTitle.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/BloodSampleGuidePage.test.tsx Adds a document title assertion.
ui/src/tests/routes/get-self-test-kit-for-HIV-journey/BeforeYouStartPage.test.tsx Updates expected page title string to new format/service name.
ui/src/tests/routes/TestResultsPage.test.tsx Adds a document title assertion.
ui/src/tests/routes/ServiceErrorPage.test.tsx Adds pageTitle to mocked content + verifies usePageTitle called; minor expectation formatting.
ui/src/tests/routes/PageTitle.integration.test.tsx New integration test ensuring titles update on navigation and for supplier legal document routes.
ui/src/tests/routes/OrderTrackingPage.test.tsx Adds a document title assertion.
ui/src/tests/routes/LoginPage.test.tsx Adds document title assertions for the login redirect page.
ui/src/tests/routes/HomeTestTermsOfUsePage.test.tsx Adds a document title assertion.
ui/src/tests/routes/HomeTestPrivacyPolicyPage.test.tsx Adds a document title assertion.
ui/src/tests/routes/CallbackPage.test.tsx Mocks usePageTitle to set document.title and asserts the callback title.
ui/src/tests/components/SupplierLegalDocumentContent.test.tsx Verifies usePageTitle is called with the formatted supplier doc title.
ui/content/schema.ts Adds pageTitle to multiple content interfaces to make page titles content-driven/typed.
ui/content/hometest-terms-of-use.json Adds pageTitle and minor formatting adjustments.
ui/content/hometest-privacy-policy.json Adds pageTitle and minor formatting adjustments.
ui/content/content.json Updates/introduces pageTitle entries across multiple pages and refreshes strings to new format.

Comment thread ui/content/schema.ts
…' of github.com:NHSDigital/hometest-service into feature/hote-1141/accessibility-page-titles-spa-updates
Comment thread ui/src/state/PostcodeLookupContext.tsx Fixed
Copilot AI review requested due to automatic review settings April 28, 2026 09:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 51 out of 51 changed files in this pull request and generated 2 comments.

Comment thread ui/src/state/PostcodeLookupContext.tsx
Comment thread ui/content/schema.ts
Copilot AI review requested due to automatic review settings April 28, 2026 12:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 53 out of 53 changed files in this pull request and generated 1 comment.

Comment thread ui/content/ContentValidator.ts
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants