Skip to content

feat: add pageable message builder interface and implementation #95

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

Open
wants to merge 7 commits into
base: version/1.21
Choose a base branch
from

Conversation

TheBjoRedCraft
Copy link
Member

This pull request introduces a new DSL-based interface and its implementation for building and sending paginated messages in the surf-api-core module. The changes include defining the SurfPageableMessageBuilder interface and providing a concrete implementation, PageableMessageBuilder, which supports customization of message content, pagination, and navigation.

New DSL Interface for Paginated Messages:

  • SurfPageableMessageBuilder interface: Added a DSL interface to define paginated messages, allowing customization of lines per page, page navigation commands, message title, and content lines. It also includes a method to send messages to an Audience at a specific page. ([surf-api-core/surf-api-core-api/src/main/kotlin/dev/slne/surf/surfapi/core/api/messages/builder/SurfPageableMessageBuilder.ktR1-R60](https://github.com/SLNE-Development/surf-api/pull/95/files#diff-896975cf4975132a2d217513118a4812f77c5baa8fcdab404a5d36d2a39a8d69R1-R60))

Implementation of Paginated Messages:

  • PageableMessageBuilder class: Implemented the SurfPageableMessageBuilder interface, providing functionality for managing message content, calculating pagination, and rendering navigation buttons. It includes methods for setting the title, adding content lines, and sending paginated messages with error handling for invalid page numbers. ([surf-api-core/surf-api-core-api/src/main/kotlin/dev/slne/surf/surfapi/core/api/messages/builder/SurfPageableMessageImpl.ktR1-R95](https://github.com/SLNE-Development/surf-api/pull/95/files#diff-81fa4ff54e1e2ff90436e88f527d9372b1bdcc54d41fd7655960ecb225ece01fR1-R95))

@Copilot Copilot AI review requested due to automatic review settings May 19, 2025 15:31
Copy link
Contributor

@Copilot 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 introduces a new DSL-based interface for paginated messages along with its concrete implementation.

  • Added SurfPageableMessageBuilder interface with DSL methods for title and content lines.
  • Implemented PageableMessageBuilder providing functionalities for pagination and navigation.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
surf-api-core/surf-api-core-api/src/main/kotlin/dev/slne/surf/surfapi/core/api/messages/builder/SurfPageableMessageImpl.kt Implements paginated message rendering including a navigation component and error handling for page bounds.
surf-api-core/surf-api-core-api/src/main/kotlin/dev/slne/surf/surfapi/core/api/messages/builder/SurfPageableMessageBuilder.kt Adds DSL interface for building paginated messages with configuration for title, content lines, and page command.

@TheBjoRedCraft TheBjoRedCraft self-assigned this May 19, 2025
@TheBjoRedCraft TheBjoRedCraft requested a review from twisti-dev May 19, 2025 15:33
@TheBjoRedCraft
Copy link
Member Author

@twisti-dev You have to fix the GH Action to accept PRs from forks.

@twisti-dev
Copy link
Contributor

Yes, I know that obviously, but I don’t have time right now.

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