Skip to content

fix(Pagination): Previous and Next Buttons to respect RTL#3316

Merged
LinKCoding merged 7 commits intocass-gmt-1601from
kl-gmt-1592
Apr 14, 2026
Merged

fix(Pagination): Previous and Next Buttons to respect RTL#3316
LinKCoding merged 7 commits intocass-gmt-1601from
kl-gmt-1592

Conversation

@LinKCoding
Copy link
Copy Markdown
Contributor

@LinKCoding LinKCoding commented Apr 3, 2026

Overview

Updates the Pagination component to use the correct Icon for Previous and Next that respect the dir of the parent element.

PR Checklist

  • Related to designs:
  • Related to JIRA ticket: GMT-1592
  • Version plan added/updated (or not needed)
  • I have run this code to verify it works
  • This PR includes unit tests for the code change
  • This PR includes testing instructions tests for the code change
  • The alpha package of this PR is passing end-to-end tests in all relevant Codecademy repositories

Testing Instructions

Don't make me tap the sign.

  1. Go to the pagination story
  2. Toggle between RTL/LTR on the story page and see that the Previous/Next buttons render correctly
  3. Click on an individual story/canvas and see that the buttons still render correctly
  4. (optionally) Check it with VO
  5. Finish and do a celebratory dance

PR Links and Envs

Repository PR Link
Mono Mono PR

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Apr 3, 2026

View your CI Pipeline Execution ↗ for commit b73a384


☁️ Nx Cloud last updated this comment at 2026-04-13 20:49:32 UTC

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

@LinKCoding LinKCoding changed the base branch from main to cass-gmt-1601 April 3, 2026 16:32
@LinKCoding LinKCoding force-pushed the kl-gmt-1592 branch 2 times, most recently from 6ac1288 to 02e01c8 Compare April 7, 2026 18:23
@LinKCoding LinKCoding marked this pull request as ready for review April 8, 2026 14:59
@LinKCoding LinKCoding requested a review from a team as a code owner April 8, 2026 14:59
@LinKCoding LinKCoding requested a review from dreamwasp April 8, 2026 14:59
Copy link
Copy Markdown
Contributor

@dreamwasp dreamwasp left a comment

Choose a reason for hiding this comment

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

Image

i'm seeing the arrows pointing inward for LTR

Comment on lines +65 to +75
useLayoutEffect(() => {
if (typeof document === 'undefined') return;
const doc = storyRef.current?.ownerDocument ?? document;
const root = doc.documentElement;
if (viewMode === 'story') {
root.setAttribute('dir', direction);
} else {
root.removeAttribute('dir');
}
}, [direction, viewMode]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

were you having issues with the dir not updating?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yea, but this seems resolved now, i.e. I deleted it and the story is updating without any issues.

I'll revert these additions, thanks for the check!

Copy link
Copy Markdown
Contributor

@dreamwasp dreamwasp left a comment

Choose a reason for hiding this comment

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

works great + thanks for the HiddenText update!

@codecademydev
Copy link
Copy Markdown
Collaborator

📬 Published Alpha Packages:

Package Version npm Diff
@codecademy/gamut 68.2.3-alpha.0992b7.0 npm diff
@codecademy/gamut-icons 9.57.3-alpha.0992b7.0 npm diff
@codecademy/gamut-illustrations 0.58.10-alpha.0992b7.0 npm diff
@codecademy/gamut-kit 0.6.593-alpha.0992b7.0 npm diff
@codecademy/gamut-patterns 0.10.29-alpha.0992b7.0 npm diff
@codecademy/gamut-styles 17.13.2-alpha.0992b7.0 npm diff
@codecademy/gamut-tests 5.3.4-alpha.0992b7.0 npm diff
@codecademy/variance 0.26.2-alpha.0992b7.0 npm diff
eslint-plugin-gamut 2.4.4-alpha.0992b7.0 npm diff

@github-actions
Copy link
Copy Markdown
Contributor

@LinKCoding LinKCoding merged commit 3c6a8ee into cass-gmt-1601 Apr 14, 2026
13 checks passed
@LinKCoding LinKCoding deleted the kl-gmt-1592 branch April 14, 2026 14:01
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