Skip to content

Conversation

@ngynmt
Copy link

@ngynmt ngynmt commented Dec 16, 2025

Description

The current pagination component forces users to navigate sequentially through pages, creating poor user experience for large datasets. Users frequently need to access specific pages (e.g., jumping from page 1 to page 50) but must click through each intermediate page, leading to time-consuming navigation for large datasets. This change proposes additional options for user to navigate to a specific page.

How has this been tested?

Added examples of open-ended and closed-ended scenarios under tables pages

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ngynmt ngynmt requested a review from a team as a code owner December 16, 2025 06:20
@ngynmt ngynmt requested review from YueyingLu and removed request for a team December 16, 2025 06:20
@ngynmt ngynmt force-pushed the new-jump-to-page-branch branch from 4a1ead1 to ab579b4 Compare January 5, 2026 23:19
@gethinwebster gethinwebster marked this pull request as draft January 6, 2026 15:36
Copy link
Member

@gethinwebster gethinwebster left a comment

Choose a reason for hiding this comment

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

To update snapshots: npm run build && npx jest -c jest.unit.config.js -u documenter test-util

},
};

const renderMainInput = () => (
Copy link
Member

Choose a reason for hiding this comment

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

const renderMainInput = <WithNativeAttributes....

Copy link
Author

Choose a reason for hiding this comment

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

updated

margin-block-start: calc(awsui.$space-scaled-xs * -1);
}

.inline-label {
Copy link
Member

Choose a reason for hiding this comment

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

move this to mixin so it can be reused between select and input, probably move to https://github.com/cloudscape-design/components/blob/main/src/internal/styles/forms/mixins.scss

Copy link
Author

Choose a reason for hiding this comment

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

moved

};

const defaultI18nStrings: Required<PaginationProps.I18nStrings> = {
jumpToPageLabel: 'Page',
Copy link
Member

Choose a reason for hiding this comment

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

remove hardcoded strings

Copy link
Author

Choose a reason for hiding this comment

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

updated

loading?: boolean;
}

export interface JumpToPageRef {
Copy link
Member

Choose a reason for hiding this comment

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

name Ref

Copy link
Author

Choose a reason for hiding this comment

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

updated

type InternalPaginationProps = PaginationProps & InternalBaseComponentProps;
type InternalPaginationProps = PaginationProps &
InternalBaseComponentProps & {
jumpToPageRef?: React.Ref<PaginationProps.JumpToPageRef>;
Copy link
Member

Choose a reason for hiding this comment

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

use forwardRef on the internal component as well, rather than manually adding it to the props

Copy link
Author

Choose a reason for hiding this comment

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

updated

function handleJumpToPageClick(requestedPageIndex: number) {
if (requestedPageIndex < 1) {
// Out of range lower bound - navigate to first page
setJumpToPageValue('1');
Copy link
Member

Choose a reason for hiding this comment

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

replace these 3 lines with handlePageClick(1)

Copy link
Author

Choose a reason for hiding this comment

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

updated

handlePageClick(requestedPageIndex);
} else {
// Out of range - set error and navigate to last page
setHasError(true);
Copy link
Member

Choose a reason for hiding this comment

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

use handlePageClick here (with additional param for error state)

tableComponentContext.paginationRef.current.openEnd = openEnd;
}

const renderJumpToPageButton = () => {
Copy link
Member

Choose a reason for hiding this comment

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

plain value rather than function

Copy link
Author

Choose a reason for hiding this comment

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

updated

/**
* Returns the error popover for jump to page.
*/
findPopover(): PopoverWrapper | null {
Copy link
Member

Choose a reason for hiding this comment

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

findJumpToPagePopover

Copy link
Author

Choose a reason for hiding this comment

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

updated

pan-kot and others added 16 commits January 9, 2026 16:21
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrei Zhaleznichenka <zhalea@amazon.de>
)

Co-authored-by: Andrei Zhaleznichenka <zhalea@amazon.de>
Copy link
Member

Choose a reason for hiding this comment

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

there are some unrelated changes in the i18n folder, can you remove them? (I've just merged the latest from main into this PR branch, so there should no longer be any changes within the i18n folder needed at all)

Copy link
Author

Choose a reason for hiding this comment

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

Did I do it? I did git checkout upstream/main -- src/i18n but diff shows the new jump to page strings removed

Copy link
Author

Choose a reason for hiding this comment

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

Nvm, forgot to fetch :) done

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 95.48872% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.14%. Comparing base (15e15bb) to head (58e9033).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/pagination/internal.tsx 96.93% 3 Missing ⚠️
src/input/internal.tsx 50.00% 1 Missing and 1 partial ⚠️
src/popover/internal.tsx 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4113      +/-   ##
==========================================
- Coverage   97.15%   97.14%   -0.01%     
==========================================
  Files         875      878       +3     
  Lines       25673    25796     +123     
  Branches     9293     9334      +41     
==========================================
+ Hits        24942    25060     +118     
- Misses        684      688       +4     
- Partials       47       48       +1     

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

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.

8 participants