Skip to content

Conversation

@dougfabris
Copy link
Member

@dougfabris dougfabris commented Sep 25, 2025

Proposed changes (including videos or screenshots)

Screenshot 2025-09-25 at 15 00 05

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Refactor

    • Simplified and clarified pagination wiring in the Users table to improve consistency of page navigation and items-per-page handling; no visual changes expected.
  • Documentation

    • Storybook for Users table now includes mocked pagination data to better represent pagination states during preview and testing.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Sep 25, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Sep 25, 2025

⚠️ No Changeset found

Latest commit: 9f03380

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 25, 2025

Walkthrough

Destructures paginationData in UsersTable to pass explicit current/itemsPerPage and setter handlers to Pagination; story adds a mockedPagination object and supplies it to UsersTable via paginationData in the Storybook template.

Changes

Cohort / File(s) Summary
UsersTable pagination prop wiring
apps/meteor/client/views/admin/users/UsersTable/UsersTable.tsx
Destructure paginationData into current, itemsPerPage, setCurrent, setItemsPerPage, and paginationProps; pass current and itemsPerPage explicitly to Pagination; wire onSetCurrent/onSetItemsPerPage to setCurrent/setItemsPerPage; spread remaining paginationProps.
Story: mocked pagination
apps/meteor/client/views/admin/users/UsersTable/UsersTable.stories.tsx
Add mockedPagination object with current, itemsPerPage, label functions, and setter placeholders; update Template to render <UsersTable {...args} paginationData={mockedPagination} />.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UsersTable
  participant Pagination

  Note over UsersTable,Pagination: UsersTable now passes explicit pagination props and setters

  User->>Pagination: click page / change itemsPerPage
  Pagination-->>UsersTable: onSetCurrent(page) / onSetItemsPerPage(size)
  rect rgba(220,235,255,0.6)
    note right of UsersTable: call setCurrent(page) / setItemsPerPage(size)
    UsersTable-->>UsersTable: update state and compute paginationProps
  end
  UsersTable-->>Pagination: render with { current, itemsPerPage, ...paginationProps }
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hop through pages, nibble numbers neat,
I set the size, then take my seat.
Props aligned in tidy rows,
Setters jump where pagination goes.
A little rabbit, code complete. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly identifies the core change by indicating that paginationData was not spread correctly in the admin users context and labels the change appropriately as a chore, accurately reflecting the modifications made in this PR.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/paginationData

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@dougfabris dougfabris added this to the 7.11.0 milestone Sep 25, 2025
@dougfabris dougfabris marked this pull request as ready for review September 25, 2025 18:00
@dougfabris dougfabris requested a review from a team as a code owner September 25, 2025 18:00
MartinSchoeler
MartinSchoeler previously approved these changes Sep 25, 2025
@MartinSchoeler MartinSchoeler added the stat: QA assured Means it has been tested and approved by a company insider label Sep 25, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Sep 25, 2025
@codecov
Copy link

codecov bot commented Sep 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.37%. Comparing base (22b63f0) to head (9f03380).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37063      +/-   ##
===========================================
+ Coverage    67.35%   67.37%   +0.01%     
===========================================
  Files         3326     3326              
  Lines       113195   113207      +12     
  Branches     20534    20534              
===========================================
+ Hits         76240    76270      +30     
+ Misses       34350    34331      -19     
- Partials      2605     2606       +1     
Flag Coverage Δ
e2e 57.27% <100.00%> (+<0.01%) ⬆️
unit 71.14% <100.00%> (+0.02%) ⬆️

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

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
apps/meteor/client/views/admin/users/UsersTable/UsersTable.stories.tsx (2)

10-17: Tighten typing and setter signatures for mockedPagination.

  • Add satisfies to lock the shape to UsersTable’s paginationData type.
  • Accept a number in the setter no‑ops to avoid potential strictFunctionTypes friction.

Apply this diff:

-const mockedPagination = {
+const mockedPagination = {
 	current: 0,
-	setCurrent: () => undefined,
+	setCurrent: (_: number) => undefined,
 	itemsPerPage: 25 as const,
-	setItemsPerPage: () => undefined,
+	setItemsPerPage: (_: number) => undefined,
 	itemsPerPageLabel: () => 'Items per page:',
 	showingResultsLabel: () => 'Showing results 1 - 5 of 5',
-};
+} satisfies NonNullable<Parameters<typeof UsersTable>[0]['paginationData']>;

19-19: Don’t hardcode paginationData in the Template; pass via args.

Keeps the story flexible and allows other stories/controls to override pagination.

Apply this diff:

-const Template: StoryFn<typeof UsersTable> = (args) => <UsersTable {...args} paginationData={mockedPagination} />;
+const Template: StoryFn<typeof UsersTable> = (args) => <UsersTable {...args} />;

Then set it in Default.args (outside the changed hunk):

Default.args = {
  // ...existing args
  paginationData: mockedPagination,
};
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c553308 and 9f03380.

📒 Files selected for processing (2)
  • apps/meteor/client/views/admin/users/UsersTable/UsersTable.stories.tsx (1 hunks)
  • apps/meteor/client/views/admin/users/UsersTable/UsersTable.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/client/views/admin/users/UsersTable/UsersTable.tsx
🔇 Additional comments (1)
apps/meteor/client/views/admin/users/UsersTable/UsersTable.stories.tsx (1)

11-11: Confirm Pagination page index base
Verify that the Pagination component from @rocket.chat/fuselage expects a 1-based current page index; if so, update mockedPagination.current to 1 instead of 0.

@kodiakhq kodiakhq bot merged commit de51a86 into develop Sep 25, 2025
50 checks passed
@kodiakhq kodiakhq bot deleted the chore/paginationData branch September 25, 2025 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants