Skip to content

feat: change deps table pagination to 50 rows per page#120

Merged
fengmk2 merged 1 commit intomasterfrom
show-optionalDependencies-v2
Dec 22, 2025
Merged

feat: change deps table pagination to 50 rows per page#120
fengmk2 merged 1 commit intomasterfrom
show-optionalDependencies-v2

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Dec 22, 2025

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Updated pagination settings for dependency tables. The Dependencies, DevDependencies, and OptionalDependencies tables now display 50 rows per page by default, enhancing visibility when reviewing project dependencies. This change allows users to see more entries at once, reducing the need to navigate between multiple pages.

✏️ Tip: You can customize this high-level summary in your review settings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 22, 2025 14:27
@vercel
Copy link
Copy Markdown

vercel bot commented Dec 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
cnpmweb Ready Ready Preview, Comment Dec 22, 2025 2:29pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 22, 2025

Walkthrough

Updated pagination configuration for three dependency tables in the dependencies view by explicitly setting pageSize to 50 rows per page. No functional or structural changes to data fetching, processing, or display logic.

Changes

Cohort / File(s) Change Summary
Pagination Configuration
src/slugs/deps/index.tsx
Added explicit pageSize: 50 configuration to pagination settings for Dependencies, DevDependencies, and OptionalDependencies tables

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Straightforward configuration adjustment with no logic changes
  • Single file affected with repetitive pattern (same pagination setting applied to three tables)
  • Verify that pageSize: 50 is appropriate for the UI/UX context and consistent with other tables in the codebase

Possibly related PRs

  • cnpmweb#119: Adds OptionalDependencies table and a third dependency table to the same file; this PR complements it by configuring consistent pagination behavior across all three tables.

Suggested reviewers

  • Copilot

Poem

🐰 Fifty rows per page, a cleaner view,
No more scrolling marathons for you!
Dependencies neat, in tidy rows,
Pagination flows where readability grows!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: change deps table pagination to 50 rows per page' directly describes the main change in the pull request, which is updating pagination configuration to show 50 rows per page in dependency tables.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch show-optionalDependencies-v2

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.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @fengmk2, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience when viewing dependency lists by increasing the default number of items displayed per page in the dependency tables. This change applies to the main dependencies, development dependencies, and optional dependencies, ensuring that users can see more relevant information at a glance without needing to navigate through multiple pages as frequently.

Highlights

  • Dependency Table Pagination: The pagination settings for the dependencies, devDependencies, and optionalDependencies tables have been updated.
  • Increased Page Size: The number of rows displayed per page in all dependency tables has been explicitly set to 50.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the pagination for dependency tables to show 50 rows per page. The change is applied correctly to all three dependency tables (dependencies, devDependencies, and optionalDependencies). However, the pagination configuration is duplicated, and the page size 50 is a magic number. I've suggested refactoring this to use a constant for better maintainability, following the DRY principle.

rowKey={'package'}
columns={columns}
pagination={{ size: 'small' }}
pagination={{ size: 'small', pageSize: 50 }}
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.

medium

The pagination configuration {{ size: 'small', pageSize: 50 }} is duplicated for the dependencies, devDependencies, and optionalDependencies tables. This use of a 'magic number' and repeated code can make future updates more difficult and error-prone.

To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, I recommend extracting this configuration into a constant. You can define it once and reuse it for all three tables.

For example, you could add this inside your component:

const paginationConfig = { size: 'small' as const, pageSize: 50 };

And then apply it to each table like this:

<Table
  // ... other props
  pagination={paginationConfig}
/>

This would make the code cleaner and easier to update in the future.

Copy link
Copy Markdown

@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 (1)
src/slugs/deps/index.tsx (1)

68-68: LGTM! Pagination configuration looks good.

The explicit pageSize: 50 is a reasonable choice for dependency tables and improves UX by showing more rows per page. The configuration is applied consistently across all three tables.

Optional: Consider extracting pagination config to reduce duplication.

The same pagination object is repeated three times. You could extract it to a constant for easier maintenance.

🔎 Optional refactor to extract pagination config
 const columns: TableColumnsType<DepRecord> = [
   {
     title: '名称',
     dataIndex: 'package',
     render: (pkg: string, record: DepRecord) => {
       return (
         <Link href={`/package/${pkg}?version=${encodeURIComponent(record.spec)}`} target="_blank">
           {pkg}
         </Link>
       );
     },
   },
   {
     title: '版本范围',
     dataIndex: 'spec',
   },
 ];
+
+const paginationConfig = { size: 'small' as const, pageSize: 50 };

 export default function Deps({ manifest, version }: PageProps) {

Then use pagination={paginationConfig} on lines 68, 78, and 88.

Also applies to: 78-78, 88-88

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 676dc44 and 0dfc59c.

📒 Files selected for processing (1)
  • src/slugs/deps/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Node.js / Test (ubuntu-latest, 24)
  • GitHub Check: Node.js / Test (ubuntu-latest, 22)
  • GitHub Check: Agent

@fengmk2 fengmk2 merged commit e1a3a9c into master Dec 22, 2025
17 checks passed
@fengmk2 fengmk2 deleted the show-optionalDependencies-v2 branch December 22, 2025 14:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the pagination settings for dependency tables to display 50 rows per page instead of using the default page size.

Key Changes:

  • Added pageSize: 50 to pagination configuration for all three dependency tables (dependencies, devDependencies, and optionalDependencies)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

rowKey={'package'}
columns={columns}
pagination={{ size: 'small' }}
pagination={{ size: 'small', pageSize: 50 }}
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

Consider extracting the pagination configuration to a constant to avoid repetition across all three tables. This would make future changes easier to maintain. For example, you could define const PAGINATION_CONFIG = { size: 'small' as const, pageSize: 50 } at the module level and reuse it for all three Table components.

Copilot uses AI. Check for mistakes.
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.

2 participants