Fix text clipping in FAQ, Pricing Options and Accordions - #1474
Conversation
🦋 Changeset detectedLatest commit: 21b18ab The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🟢 No design token changes found |
🟢 Bundle size report
|
🟢 Unit test coverage changes foundUnit test coverage has been updated through this PR. Changes: 0 new tests, 0 removed tests, 1 improved, 1 decreased
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Two unresolved moderate findings remain in the FAQ stories: CJK visual coverage and translated link spacing.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite
Findings: 1
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
packages/react/src/FAQ/FAQ.features.stories.tsx — This story does not set a locale, so the generated visual test runs with the preview default (en)… |
|
apps/storybook/static/locales/en/FAQ.json — The new English translation misspells sponsored as sponsorsed, so the migrated FAQ story… |
What changed in this PR
Fixes multilingual text clipping in Accordion content, including FAQ and Pricing Options consumers, by removing negative positioning and measuring full content height.
Changes:
- Simplifies Accordion positioning and height calculation.
- Adds localized FAQ and Accordion stories, translations, and visual regression coverage.
- Synchronizes Storybook document language and adds a changeset.
| File | Description |
|---|---|
packages/react/src/FAQ/FAQ.visual.spec.ts |
Adds localized FAQ visual coverage. |
packages/react/src/FAQ/FAQ.stories.tsx |
Localizes the default FAQ story. |
packages/react/src/FAQ/FAQ.features.stories.tsx |
Adds translated FAQ fixtures and localized coverage. |
packages/react/src/Accordion/Accordion.visual.spec.ts |
Adds localized Accordion visual coverage. |
packages/react/src/Accordion/Accordion.tsx |
Measures full Accordion content height. |
packages/react/src/Accordion/Accordion.module.css |
Removes offset transforms and adjusts positioning. |
packages/react/src/Accordion/Accordion.features.stories.tsx |
Adds a localized Accordion story. |
apps/storybook/static/locales/pt-BR/FAQ.json |
Adds Portuguese FAQ translations. |
apps/storybook/static/locales/pt-BR/Accordion.json |
Adds Portuguese Accordion translations. |
apps/storybook/static/locales/ko/FAQ.json |
Adds Korean FAQ translations. |
apps/storybook/static/locales/ko/Accordion.json |
Adds Korean Accordion translations. |
apps/storybook/static/locales/ja/FAQ.json |
Adds Japanese FAQ translations. |
apps/storybook/static/locales/ja/Accordion.json |
Adds Japanese Accordion translations. |
apps/storybook/static/locales/fr/FAQ.json |
Adds French FAQ translations. |
apps/storybook/static/locales/fr/Accordion.json |
Adds French Accordion translations. |
apps/storybook/static/locales/es/FAQ.json |
Adds Spanish FAQ translations. |
apps/storybook/static/locales/es/Accordion.json |
Adds Spanish Accordion translations. |
apps/storybook/static/locales/en/FAQ.json |
Adds English FAQ translations. |
apps/storybook/static/locales/en/Accordion.json |
Adds English Accordion translations. |
apps/storybook/static/locales/de/FAQ.json |
Adds German FAQ translations. |
apps/storybook/static/locales/de/Accordion.json |
Adds German Accordion translations. |
apps/storybook/.storybook/preview.jsx |
Synchronizes document language with the Storybook locale. |
.changeset/tidy-accordion-text.md |
Documents the Accordion clipping fix. |
Suppressed comments (3)
.changeset/tidy-accordion-text.md:5
RiverAccordionhas its ownRiverAccordion__contentimplementation and does not useAccordion.module.css, so this release note incorrectly claims that this fix covers RiverAccordion. Name consumers that actually useAccordion, such as FAQ, PricingOptions, or RiverBreakoutTabs.
Fixed first-line text clipping in accordion content, which is used across multiple components like `FAQ` and `RiverAccordion`.
apps/storybook/static/locales/en/FAQ.json:72
- This new English translation is missing
freeinplease feel free to sign up, so the FAQ story renders an ungrammatical sentence.
"startup_not_eligible_answer": "If you're not currently eligible for the GitHub for Startups but would like to try GitHub Enterprise, please feel to sign up for a trial",
packages/react/src/FAQ/FAQ.stories.tsx:46
- Because this translated value is a JSX expression with no trailing whitespace, the following link renders directly after it (for example,
trialhere). Add an explicit space before the link, as done for the first answer above.
{t('startup_not_eligible_answer')}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🟢 No visual differences foundOur visual comparison tests did not find any differences in the UI. |
| const I18nextDecorator = (Story, context) => { | ||
| const {locale} = context.globals | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
The useEffect fixes a pre-existing accessibility issue where the storybook html tag declares en despite page content appearing in other languages. Not related to the fix, but it was setting off AXE scanners.


Summary
Resolves #1473
Part of https://github.com/github/brand-experience/issues/545
Prevents text-clipping in the accordion component, which happened because of previously incorrect negative positioning of the accordion content. This change affects multiple components, from Accordion to PricingOptions.
🔗 Preview
List of notable changes:
Steps to test:
Supporting resources (related issues, external links, etc):
Contributor checklist:
update snapshotslabel to the PR)Reviewer checklist:
Screenshots: