-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/paginated dialog #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: version/1.21.10
Are you sure you want to change the base?
Conversation
…agination controls
…urf/surfapi/bukkit/api/dialog/builder/DialogPaginationBuilder.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/paginated-dialog
There was a problem hiding this 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 adds a new paginated dialog feature to the Bukkit API, providing a builder for creating dialogs with pagination capabilities. The implementation includes navigation buttons, configurable elements per page, and customizable pagination controls.
Key changes:
- Added
DialogPaginationBuilderclass with comprehensive pagination functionality - Introduced
DialogPageActioninterface for custom page navigation logic - Updated API version to 1.21.8-2.39.0
Reviewed Changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| DialogPaginationBuilder.kt | New builder class implementing paginated dialog functionality with navigation buttons and element management |
| surf-api-bukkit-api.api | API signature updates to expose the new pagination builder classes and methods |
| gradle.properties | Version bump from 2.38.0 to 2.39.0 |
Files not reviewed (2)
- .idea/misc.xml: Language not supported
- .idea/modules.xml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| width += paginationButtonWidth // current page button | ||
|
|
||
| return width.coerceAtLeast(minElementButtonWidth) |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function returns a calculated width but this value is never used to update the button widths. The variable width accumulates pagination button widths but doesn't account for the actual element button width calculation logic.
| return width.coerceAtLeast(minElementButtonWidth) | |
| val calculatedWidth = width.coerceAtLeast(minElementButtonWidth) | |
| minElementButtonWidth = calculatedWidth | |
| return calculatedWidth |
| private var firstPageButton = DialogPaginationBaseAction.FIRST.actionButton( | ||
| currentPage, maxPages, paginationButtonWidth | ||
| ) | ||
|
|
||
| private var backButton = DialogPaginationBaseAction.BACK.actionButton( | ||
| currentPage, maxPages, paginationButtonWidth | ||
| ) | ||
|
|
||
| private var currentPageButton = DialogPaginationBaseAction.CURRENT.actionButton( | ||
| currentPage, maxPages, paginationButtonWidth | ||
| ) | ||
|
|
||
| private var nextButton = DialogPaginationBaseAction.NEXT.actionButton( | ||
| currentPage, maxPages, paginationButtonWidth | ||
| ) | ||
|
|
||
| private var lastPageButton = DialogPaginationBaseAction.LAST.actionButton( |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These buttons are initialized with currentPage and maxPages values that will be stale. When currentPage changes or elements are added/removed, these buttons will still display outdated page information since they're not regenerated.
| private var firstPageButton = DialogPaginationBaseAction.FIRST.actionButton( | |
| currentPage, maxPages, paginationButtonWidth | |
| ) | |
| private var backButton = DialogPaginationBaseAction.BACK.actionButton( | |
| currentPage, maxPages, paginationButtonWidth | |
| ) | |
| private var currentPageButton = DialogPaginationBaseAction.CURRENT.actionButton( | |
| currentPage, maxPages, paginationButtonWidth | |
| ) | |
| private var nextButton = DialogPaginationBaseAction.NEXT.actionButton( | |
| currentPage, maxPages, paginationButtonWidth | |
| ) | |
| private var lastPageButton = DialogPaginationBaseAction.LAST.actionButton( | |
| private val firstPageButton get() = DialogPaginationBaseAction.FIRST.actionButton( | |
| currentPage, maxPages, paginationButtonWidth | |
| ) | |
| private val backButton get() = DialogPaginationBaseAction.BACK.actionButton( | |
| currentPage, maxPages, paginationButtonWidth | |
| ) | |
| private val currentPageButton get() = DialogPaginationBaseAction.CURRENT.actionButton( | |
| currentPage, maxPages, paginationButtonWidth | |
| ) | |
| private val nextButton get() = DialogPaginationBaseAction.NEXT.actionButton( | |
| currentPage, maxPages, paginationButtonWidth | |
| ) | |
| private val lastPageButton get() = DialogPaginationBaseAction.LAST.actionButton( |
No description provided.