Skip to content

OCPBUGS-84876: Add bottom pagination to ConsoleDataView for mobile responsiveness#16391

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
rhamilto:OCPBUGS-84876
May 4, 2026
Merged

OCPBUGS-84876: Add bottom pagination to ConsoleDataView for mobile responsiveness#16391
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
rhamilto:OCPBUGS-84876

Conversation

@rhamilto
Copy link
Copy Markdown
Member

@rhamilto rhamilto commented May 1, 2026

Analysis / Root cause:
The ConsoleDataView component only included pagination in the top toolbar. According to PatternFly design guidelines (https://www.patternfly.org/components/pagination/design-guidelines/), both top and bottom pagination should be used. On mobile viewports (< 768px), the top pagination condenses to just an item count, leaving users with no way to navigate between pages.

Additionally, the pagination components were missing internationalization (i18n) for navigation button aria-labels and visible text, which is required for accessibility and localization support.

Solution description:

  1. Added a Pagination component with variant={PaginationVariant.bottom} after the DataViewTable component
  2. Added complete i18n support to both top and bottom pagination components:
    • Navigation aria-labels: toFirstPageAriaLabel, toPreviousPageAriaLabel, toNextPageAriaLabel, toLastPageAriaLabel
    • Visible text labels: ofWord, itemsPerPage, perPageSuffix
  3. Added the missing PaginationVariant import from @patternfly/react-core
  4. Both pagination components share the same state (via {...pagination}) to keep them synchronized

Screenshots / screen recording:

Test setup:
No special setup required.

Test cases:

  1. Navigate to any page using ConsoleDataView (e.g., Nodes page)
  2. Verify bottom pagination is visible at the bottom of the table
  3. Verify both top and bottom pagination have properly translated text
  4. Verify navigation buttons have proper aria-labels for screen readers
  5. Resize viewport to mobile size (< 768px)
  6. Verify top pagination shows only item count
  7. Verify bottom pagination still shows full controls (page navigation, items per page selector)
  8. Change page or items per page in bottom pagination
  9. Verify both top and bottom pagination remain synchronized
  10. Test with different locale settings to verify i18n translations work

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:

Reviewers and assignees:
/cc @openshift/team-ux-review

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. labels May 1, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 1, 2026

@rhamilto: GitHub didn't allow me to request PR reviews from the following users: openshift/team-ux-review.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

Analysis / Root cause:
The ConsoleDataView component only included pagination in the top toolbar. According to PatternFly design guidelines (https://www.patternfly.org/components/pagination/design-guidelines/), both top and bottom pagination should be used. On mobile viewports (< 768px), the top pagination condenses to just an item count, leaving users with no way to navigate between pages.

Solution description:
Added a Pagination component with variant={PaginationVariant.bottom} after the DataViewTable component. The bottom pagination shares the same state as the top pagination (via {...pagination}) to keep them synchronized. Also added the missing PaginationVariant import from @patternfly/react-core.

Screenshots / screen recording:

Test setup:
No special setup required.

Test cases:

  1. Navigate to any page using ConsoleDataView (e.g., Nodes page)
  2. Verify bottom pagination is visible at the bottom of the table
  3. Resize viewport to mobile size (< 768px)
  4. Verify top pagination shows only item count
  5. Verify bottom pagination still shows full controls (page navigation, items per page selector)
  6. Change page or items per page in bottom pagination
  7. Verify both top and bottom pagination remain synchronized

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:

Reviewers and assignees:
/cc @openshift/team-ux-review

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label May 1, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rhamilto: This pull request references Jira Issue OCPBUGS-84876, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Analysis / Root cause:
The ConsoleDataView component only included pagination in the top toolbar. According to PatternFly design guidelines (https://www.patternfly.org/components/pagination/design-guidelines/), both top and bottom pagination should be used. On mobile viewports (< 768px), the top pagination condenses to just an item count, leaving users with no way to navigate between pages.

Solution description:
Added a Pagination component with variant={PaginationVariant.bottom} after the DataViewTable component. The bottom pagination shares the same state as the top pagination (via {...pagination}) to keep them synchronized. Also added the missing PaginationVariant import from @patternfly/react-core.

Screenshots / screen recording:

Test setup:
No special setup required.

Test cases:

  1. Navigate to any page using ConsoleDataView (e.g., Nodes page)
  2. Verify bottom pagination is visible at the bottom of the table
  3. Resize viewport to mobile size (< 768px)
  4. Verify top pagination shows only item count
  5. Verify bottom pagination still shows full controls (page navigation, items per page selector)
  6. Change page or items per page in bottom pagination
  7. Verify both top and bottom pagination remain synchronized

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:

Reviewers and assignees:
/cc @openshift/team-ux-review

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added component/core Related to console core functionality approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 1, 2026
@rhamilto
Copy link
Copy Markdown
Member Author

rhamilto commented May 1, 2026

/cherry-pick release-4.22 release-4.21

@openshift-cherrypick-robot
Copy link
Copy Markdown

@rhamilto: once the present PR merges, I will cherry-pick it on top of release-4.22 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-4.22 release-4.21

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Comment on lines +249 to +258
<Pagination
itemCount={filteredData.length}
titles={{
ofWord: t('public~of'),
itemsPerPage: t('public~Items per page'),
perPageSuffix: t('public~per page'),
}}
variant={PaginationVariant.bottom}
{...pagination}
/>
Copy link
Copy Markdown
Member

@logonoff logonoff May 1, 2026

Choose a reason for hiding this comment

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

According to the data view example, they wrap this in another DataViewToolbar:

    <DataView selection={selection} activeState={finalData.length > 0 ? undefined : 'empty'}>

// ...

      <DataViewToolbar
        ouiaId='LayoutExampleFooter'
        pagination={
          <Pagination 
            isCompact  
            perPageOptions={perPageOptions} 
            itemCount={repositories.length} 
            {...pagination} 
          />
        } 
      />
    </DataView>

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

📝 Walkthrough

Walkthrough

This change refactors the pagination UI in ConsoleDataView component by extracting pagination control from the implicit DataView prop-based approach to an explicit, dedicated bottom paginator element. The new implementation renders a paginator with PaginationVariant.bottom, maintaining existing bindings for itemCount (derived from filteredData.length), internationalization titles, and pagination state handlers. This represents a shift toward more explicit component composition while preserving functional parity with the previous implementation.

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Title check ✅ Passed The title directly references the Jira issue (OCPBUGS-84876) and clearly describes the main change: adding bottom pagination to ConsoleDataView for mobile responsiveness.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR modifies only frontend React/TypeScript code (ConsoleDataView.tsx). No Ginkgo test files are present or modified.
Test Structure And Quality ✅ Passed Custom check for Ginkgo test code quality is not applicable to this PR as it only modifies React/TypeScript frontend component with no test code changes.
Microshift Test Compatibility ✅ Passed PR modifies only frontend React component; no Ginkgo e2e tests added or modified, so check does not apply.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR modifies only ConsoleDataView React component with no Ginkgo e2e tests added; custom check scope does not apply.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only frontend React/TypeScript UI component for pagination; contains no Kubernetes scheduling constraints, manifests, operators, or topology-related code.
Ote Binary Stdout Contract ✅ Passed The OTE Binary Stdout Contract check is not applicable to this pull request. The PR modifies only a React/TypeScript frontend component file (.tsx), making no changes to Go binaries, test suites, or process-level code.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR modifies only React/TypeScript frontend component, not Go-based e2e tests; custom check for IPv6 and disconnected network compatibility is not applicable.
Description check ✅ Passed PR description comprehensively addresses root cause, solution, test cases, and PatternFly guidelines; all critical sections are well-populated with actionable details.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
frontend/packages/console-app/src/components/data-view/ConsoleDataView.tsx (1)

249-258: ⚡ Quick win

Deduplicate shared pagination config to prevent drift.

The same titles and itemCount config is now duplicated between the top and bottom pagers. Extracting shared pagination props keeps both controls consistent as this evolves.

♻️ Suggested refactor
+  const paginationTitles = useMemo(
+    () => ({
+      ofWord: t('public~of'),
+      itemsPerPage: t('public~Items per page'),
+      perPageSuffix: t('public~per page'),
+    }),
+    [t],
+  );
...
          pagination={
            <Pagination
              itemCount={filteredData.length}
-              titles={{
-                ofWord: t('public~of'),
-                itemsPerPage: t('public~Items per page'),
-                perPageSuffix: t('public~per page'),
-              }}
+              titles={paginationTitles}
              {...pagination}
            />
          }
...
        <Pagination
          itemCount={filteredData.length}
-          titles={{
-            ofWord: t('public~of'),
-            itemsPerPage: t('public~Items per page'),
-            perPageSuffix: t('public~per page'),
-          }}
+          titles={paginationTitles}
          variant={PaginationVariant.bottom}
          {...pagination}
        />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/packages/console-app/src/components/data-view/ConsoleDataView.tsx`
around lines 249 - 258, Extract the duplicated pagination props into a shared
object (e.g., const sharedPaginationProps = { itemCount: filteredData.length,
titles: { ofWord: t('public~of'), itemsPerPage: t('public~Items per page'),
perPageSuffix: t('public~per page') }, variant: PaginationVariant.bottom }) and
spread that into the bottom <Pagination ... /> where Pagination, filteredData,
pagination are used; then replace the duplicated itemCount/titles in the top
pager to use the same sharedPaginationProps (spreading
{...sharedPaginationProps, ...pagination} as appropriate) so both pagers consume
one source of truth and avoid drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@frontend/packages/console-app/src/components/data-view/ConsoleDataView.tsx`:
- Around line 249-258: Extract the duplicated pagination props into a shared
object (e.g., const sharedPaginationProps = { itemCount: filteredData.length,
titles: { ofWord: t('public~of'), itemsPerPage: t('public~Items per page'),
perPageSuffix: t('public~per page') }, variant: PaginationVariant.bottom }) and
spread that into the bottom <Pagination ... /> where Pagination, filteredData,
pagination are used; then replace the duplicated itemCount/titles in the top
pager to use the same sharedPaginationProps (spreading
{...sharedPaginationProps, ...pagination} as appropriate) so both pagers consume
one source of truth and avoid drift.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: b036d057-291f-470a-8546-639f9179ad8f

📥 Commits

Reviewing files that changed from the base of the PR and between 2f52067 and 6c4b262.

📒 Files selected for processing (1)
  • frontend/packages/console-app/src/components/data-view/ConsoleDataView.tsx
📜 Review details
🔇 Additional comments (1)
frontend/packages/console-app/src/components/data-view/ConsoleDataView.tsx (1)

9-9: PatternFly import update looks correct.

PaginationVariant is imported from the correct module and matches the new bottom paginator usage.

@openshift-ci openshift-ci Bot added the kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated label May 1, 2026
@rhamilto rhamilto force-pushed the OCPBUGS-84876 branch 2 times, most recently from 7e34e35 to 7e5145c Compare May 1, 2026 18:11
Copy link
Copy Markdown
Member Author

@rhamilto rhamilto left a comment

Choose a reason for hiding this comment

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

Good catch! Wrapped the bottom pagination in a DataViewToolbar to match the PatternFly pattern. Updated in 7e5145c.

…sponsiveness

The ConsoleDataView component was missing bottom pagination, which is
required by PatternFly design guidelines for proper mobile responsiveness.
On mobile viewports, the top pagination condenses to just an item count,
so full pagination controls must be available in the footer/bottom.

This change adds a Pagination component with variant="bottom" after the
DataViewTable to ensure pagination controls remain accessible on all
viewport sizes.

Additionally, adds complete i18n support to both top and bottom pagination
components with proper aria-labels for navigation buttons (first, previous,
next, last pages) and translated visible text (ofWord, itemsPerPage,
perPageSuffix) to ensure full accessibility and internationalization.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@logonoff logonoff left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 1, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 1, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: logonoff, rhamilto

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhamilto
Copy link
Copy Markdown
Member Author

rhamilto commented May 1, 2026

/verified by @rhamilto

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label May 1, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rhamilto: This PR has been marked as verified by @rhamilto.

Details

In response to this:

/verified by @rhamilto

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@rhamilto
Copy link
Copy Markdown
Member Author

rhamilto commented May 4, 2026

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels May 4, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rhamilto: This pull request references Jira Issue OCPBUGS-84876, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label May 4, 2026
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label May 4, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 4, 2026

New changes are detected. LGTM label has been removed.

@rhamilto rhamilto added the lgtm Indicates that a PR is ready to be merged. label May 4, 2026
@rhamilto
Copy link
Copy Markdown
Member Author

rhamilto commented May 4, 2026

/override ci/prow/e2e-gcp-console

I mistakenly pushed a change to the branch. The tests previously passed.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 4, 2026

@rhamilto: Overrode contexts on behalf of rhamilto: ci/prow/e2e-gcp-console

Details

In response to this:

/override ci/prow/e2e-gcp-console

I mistakenly pushed a change to the branch. The tests previously passed.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@rhamilto
Copy link
Copy Markdown
Member Author

rhamilto commented May 4, 2026

/verified by @rhamilto

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label May 4, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rhamilto: This PR has been marked as verified by @rhamilto.

Details

In response to this:

/verified by @rhamilto

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 4, 2026

@rhamilto: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot Bot merged commit 2e316b9 into openshift:main May 4, 2026
8 checks passed
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@rhamilto: Jira Issue Verification Checks: Jira Issue OCPBUGS-84876
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-84876 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

Analysis / Root cause:
The ConsoleDataView component only included pagination in the top toolbar. According to PatternFly design guidelines (https://www.patternfly.org/components/pagination/design-guidelines/), both top and bottom pagination should be used. On mobile viewports (< 768px), the top pagination condenses to just an item count, leaving users with no way to navigate between pages.

Additionally, the pagination components were missing internationalization (i18n) for navigation button aria-labels and visible text, which is required for accessibility and localization support.

Solution description:

  1. Added a Pagination component with variant={PaginationVariant.bottom} after the DataViewTable component
  2. Added complete i18n support to both top and bottom pagination components:
  • Navigation aria-labels: toFirstPageAriaLabel, toPreviousPageAriaLabel, toNextPageAriaLabel, toLastPageAriaLabel
  • Visible text labels: ofWord, itemsPerPage, perPageSuffix
  1. Added the missing PaginationVariant import from @patternfly/react-core
  2. Both pagination components share the same state (via {...pagination}) to keep them synchronized

Screenshots / screen recording:

Test setup:
No special setup required.

Test cases:

  1. Navigate to any page using ConsoleDataView (e.g., Nodes page)
  2. Verify bottom pagination is visible at the bottom of the table
  3. Verify both top and bottom pagination have properly translated text
  4. Verify navigation buttons have proper aria-labels for screen readers
  5. Resize viewport to mobile size (< 768px)
  6. Verify top pagination shows only item count
  7. Verify bottom pagination still shows full controls (page navigation, items per page selector)
  8. Change page or items per page in bottom pagination
  9. Verify both top and bottom pagination remain synchronized
  10. Test with different locale settings to verify i18n translations work

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:

Reviewers and assignees:
/cc @openshift/team-ux-review

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-cherrypick-robot
Copy link
Copy Markdown

@rhamilto: new pull request created: #16394

Details

In response to this:

/cherry-pick release-4.22 release-4.21

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@rhamilto rhamilto deleted the OCPBUGS-84876 branch May 4, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants