Fix: [AEA-6451] - Toggle session timeout modal messaging and actions on select your role#1982
Merged
connoravo-nhs merged 6 commits intomainfrom Apr 2, 2026
Merged
Fix: [AEA-6451] - Toggle session timeout modal messaging and actions on select your role#1982connoravo-nhs merged 6 commits intomainfrom
connoravo-nhs merged 6 commits intomainfrom
Conversation
…e page Signed-off-by: Connor Avery <[email protected]>
Contributor
|
This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket: AEA-6451 |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the session timeout modal UX/behavior specifically for the Select Your Role page, so that the periodic session check introduced previously doesn’t present the same “extend session” actions as the rest of the app.
Changes:
- Add route-aware branching in
useSessionTimeoutandSessionTimeoutModalforFRONTEND_PATHS.SELECT_YOUR_ROLE. - Introduce new modal strings for Select Your Role-specific instruction text and a “Close this message” CTA.
- Update hook/component tests to provide a router context (MemoryRouter) for
useLocationusage.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cpt-ui/src/hooks/useSessionTimeout.ts | Adds Select Your Role route handling to change session-timeout actions. |
| packages/cpt-ui/src/constants/ui-strings/SessionTimeoutModalStrings.ts | Adds new UI strings used by the route-specific modal variant. |
| packages/cpt-ui/src/components/SessionTimeoutModal.tsx | Adds route-specific instruction text and swaps primary button label on Select Your Role. |
| packages/cpt-ui/tests/useSessionTimeout.test.tsx | Wraps hook tests in a router so useLocation works. |
| packages/cpt-ui/tests/SessionTimeoutModal.test.tsx | Wraps modal tests in a router so useLocation works. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Connor Avery <[email protected]>
Signed-off-by: Connor Avery <[email protected]>
Signed-off-by: Connor Avery <[email protected]>
Signed-off-by: Connor Avery <[email protected]>
jonathanwelch1-nhs
approved these changes
Apr 2, 2026
|
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.



Summary
Details
Toggle session timeout modal messaging and actions on select your role.
This is important now that select your role will also run the periodic check after being introduced in 352787d