Skip to content

Conversation

heloiselui
Copy link
Contributor

@heloiselui heloiselui commented Sep 7, 2025

Closes #19870
Closes #20265

Align <cds-pagination> web component with React version for feature parity and consistency.

Changelog

New

  • None.

Changed

  • Updated _renderStatusText
  • Updated updated() lifecycle to:
    • Recompute totalPages when relevant props change (pageSize, start, totalItems, page)
    • Clamp requested page to safe range
  • Improved prev/next button disable logic
  • Fix accessibility
  • Storybook stories to use args consistently
  • Updated <cds-select> for page dropdown to set the correct selected item
  • Minor style fix in button.scss focus state to fix a small design bug

Removed

  • Duplicate/unnecessary page select rendering logic in stories
  • Removed non-visual controls from Storybook

Testing / Reviewing

  • Go to Web Components Deploy Preview > Pagination
  • Play around the default story and try to compare the components to make sure no missing features are present.

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • Updated documentation and storybook examples
  • [ ] Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

More details can be found in the pull request guide

Copy link

netlify bot commented Sep 7, 2025

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit e194da3
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/68c0911bd5d01600086a8794
😎 Deploy Preview https://deploy-preview-20459--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

codecov bot commented Sep 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.83%. Comparing base (30b4f87) to head (e194da3).
⚠️ Report is 173 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20459      +/-   ##
==========================================
+ Coverage   91.39%   91.83%   +0.43%     
==========================================
  Files         485      480       -5     
  Lines       31370    32409    +1039     
  Branches     5430     5434       +4     
==========================================
+ Hits        28670    29762    +1092     
+ Misses       2547     2501      -46     
+ Partials      153      146       -7     
Flag Coverage Δ
main-packages 85.03% <ø> (+0.09%) ⬆️
web-components 97.26% <ø> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

netlify bot commented Sep 7, 2025

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit e194da3
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/68c0911bf27ec70008ed42e6
😎 Deploy Preview https://deploy-preview-20459--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Sep 7, 2025

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit e194da3
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/68c0911b6367590008eec1b5
😎 Deploy Preview https://deploy-preview-20459--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@maradwan26 maradwan26 left a comment

Choose a reason for hiding this comment

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

Looks good! Just some comments:

  • Default Story: when pagesUnknown = true, the pagination still caps out and stops increasing the pages when it reaches totalItems. In React it lets you keep going forever even when u have totalItems="some number" but pagesUnknown = true, pagesUnknown seems to override totalItems in the React Default Story

    React:
    Screenshot 2025-09-09 at 10 54 18 AM

    WC:
    Screenshot 2025-09-09 at 10 54 00 AM

  • "Unknown pages and items" story is broken

@heloiselui
Copy link
Contributor Author

Looks good! Just some comments:

  • Default Story: when pagesUnknown = true, the pagination still caps out and stops increasing the pages when it reaches totalItems. In React it lets you keep going forever even when u have totalItems="some number"

@maradwan26 Thank you for reviewing my PR, I believe everything is all set now.

Copy link
Contributor

@maradwan26 maradwan26 left a comment

Choose a reason for hiding this comment

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

Thx! LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Pagination doesn't work with a default value for page React|WC Parity: Pagination
2 participants