[HOTE-1141] feat: update-ui-page-titles#410
Open
ConnorF-NHS wants to merge 9 commits intomainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
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 aformatPageTitle(...)helper + updated default service name. - Extends content types (
ui/content/schema.ts) and content JSON to includepageTitlevalues 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. |
…' of github.com:NHSDigital/hometest-service into feature/hote-1141/accessibility-page-titles-spa-updates
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Context
Type of changes
Checklist
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.