Skip to content

fix(settings): missing signin token code title#20359

Merged
toufali merged 1 commit intomainfrom
missing-signin_token_code-title
Apr 13, 2026
Merged

fix(settings): missing signin token code title#20359
toufali merged 1 commit intomainfrom
missing-signin_token_code-title

Conversation

@toufali
Copy link
Copy Markdown
Member

@toufali toufali commented Apr 10, 2026

Because

  • When a CMS client (Smart Window) has a page in Strapi with splitLayout but no headline, Strapi returns null for that field
  • CardHeader.isCmsHeader checked cmsHeadline !== undefined, which is true for null, causing the CMS heading to render an empty <h1> page heading

This pull request

  • Fixes isCmsHeader to use a truthy check (!!) so undefined and null get a fallback
  • Updates the cmsHeadline prop type from string | undefined to string | null to better reflect what Strapi returns
  • Adds a regression test for the null case

Issue that this pull request solves

Closes: FXA-13240

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How 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.tsx

I 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.

@toufali toufali requested a review from a team as a code owner April 10, 2026 20:16
Copilot AI review requested due to automatic review settings April 10, 2026 20:16
Copy link
Copy Markdown

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

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 cmsHeadline prop typing to accept null.
  • Add a regression test covering the Strapi null headline 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.

Copy link
Copy Markdown
Contributor

@LZoog LZoog left a comment

Choose a reason for hiding this comment

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

Ahh good find! LGTM.

@toufali toufali merged commit ed4693b into main Apr 13, 2026
25 checks passed
@toufali toufali deleted the missing-signin_token_code-title branch April 13, 2026 17:35
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.

3 participants