Skip to content

Conversation

@twisti-dev
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings September 22, 2025 16:20
Copy link
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 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 DialogPaginationBuilder class with comprehensive pagination functionality
  • Introduced DialogPageAction interface 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)
Copy link

Copilot AI Sep 22, 2025

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.

Suggested change
return width.coerceAtLeast(minElementButtonWidth)
val calculatedWidth = width.coerceAtLeast(minElementButtonWidth)
minElementButtonWidth = calculatedWidth
return calculatedWidth

Copilot uses AI. Check for mistakes.
Comment on lines +114 to +130
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(
Copy link

Copilot AI Sep 22, 2025

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.

Suggested change
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(

Copilot uses AI. Check for mistakes.
@twisti-dev
Copy link
Contributor Author

@codex

Base automatically changed from version/1.21.8 to version/1.21.10 October 21, 2025 06:45
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.

3 participants