fix(settings): missing signin token code title#20359
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes an accessibility/UX issue where CMS-driven pages could render an empty <h1> when Strapi returns null for an unset headline, by ensuring CardHeader falls back to the default heading in that case.
Changes:
- Update CMS header detection to treat
null(and other falsy values) as “no CMS headline,” so the default heading renders instead. - Adjust
cmsHeadlineprop typing to acceptnull. - Add a regression test covering the Strapi
nullheadline scenario.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/fxa-settings/src/components/CardHeader/index.tsx | Fixes CMS header detection and updates cmsHeadline typing to handle Strapi null values. |
| packages/fxa-settings/src/components/CardHeader/index.test.tsx | Adds a regression test ensuring fallback behavior when cmsHeadline is null. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Because
CardHeader.isCmsHeadercheckedcmsHeadline !== undefined, which istruefornull, causing the CMS heading to render an empty<h1>page headingThis pull request
isCmsHeaderto use a truthy check (!!) soundefinedandnullget a fallbackstring | undefinedtostring | nullto better reflect what Strapi returnsIssue that this pull request solves
Closes: FXA-13240
Checklist
Put an
xin the boxes that applyHow to review (Optional)
I tested this by running the test case with and without the fix:
cd packages/fxa-settings && SKIP_PREFLIGHT_CHECK=true node scripts/test.js --watchAll=false --testPathPattern=src/components/CardHeader/index.test.tsxI wasn't able to follow the steps to reproduce given in the bug ticket – bonus if you're able to confirm fix that way!
Screenshots (Optional)
Please attach the screenshots of the changes made in case of change in user interface.
Other information (Optional)
This fix is in CardHeader and should apply to all pages that use it with CMS data.