feat: add dialog API with builders for various dialog components#110
Merged
twisti-dev merged 11 commits intoversion/1.21.7from Jul 9, 2025
Merged
feat: add dialog API with builders for various dialog components#110twisti-dev merged 11 commits intoversion/1.21.7from
twisti-dev merged 11 commits intoversion/1.21.7from
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a fluent, builder-style API for constructing Paper dialogs in the surf-api-bukkit module.
- Adds high-level DSL functions (
dialog {},noticeDialog {}, etc.) and exposes them in the API. - Implements builder classes for dialog types, bodies, inputs, base configuration, actions, and action buttons.
- Updates module exports and bumps version to
1.21.7-2.21.0.
Reviewed Changes
Copilot reviewed 10 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/.../builder/DialogTypeBuilder.kt | Builds different DialogType variants |
| src/.../builder/DialogInputBuilder.kt | DSL for defining dialog inputs |
| src/.../builder/DialogBodyBuilder.kt | DSL for composing dialog body entries |
| src/.../builder/DialogBaseBuilder.kt | Configures common dialog base settings |
| src/.../builder/DialogActionButtonBuilder.kt | Fluent builder for action buttons |
| src/.../builder/DialogActionBuilder.kt | Fluent builder for dialog actions |
| src/.../DialogBuilder.kt | Top-level dialog {} DSL functions |
| src/.../CommonDialogs.kt | High-level notice dialog helpers |
| api/surf-api-bukkit-api.api | Exposes new DSL entry points in API surface |
| gradle.properties | Bumps version to 1.21.7-2.21.0 |
Files not reviewed (3)
- .idea/jarRepositories.xml: Language not supported
- .idea/modules.xml: Language not supported
- .idea/vcs.xml: Language not supported
Comments suppressed due to low confidence (3)
surf-api-bukkit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/dialog/builder/DialogTypeBuilder.kt:14
- [nitpick] Add a KDoc comment explaining the purpose and usage of this builder to improve discoverability and maintainability of the DSL.
class DialogTypeBuilder {
surf-api-bukkit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/dialog/builder/DialogTypeBuilder.kt:72
- Consider adding unit tests for
DialogTypeBuilder.build()to verify each dialog type variant (notice, confirmation, list, etc.) is constructed correctly.
internal fun build(): DialogType {
surf-api-bukkit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/dialog/builder/DialogActionButtonBuilder.kt:11
- [nitpick] The inline comment
// permissionis unclear here. Either clarify its intent in a KDoc or remove it if it's vestigial.
class DialogActionButtonBuilder { // permission
...it-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/dialog/builder/DialogInputBuilder.kt
Outdated
Show resolved
Hide resolved
Contributor
Author
|
Depends on PaperMC/Paper#12671 |
…nBuilder for player-specific interactions
…n and improve dialog management
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview of Changes
This PR introduces a new dialog API layer to the
surf-api-bukkitmodule, enabling a fluent builder-style approach to constructing dialogs in Paper. It includes high-level helper functions, core API definitions, and a set of builder classes for dialog components (actions, buttons, body, inputs, types, and base configuration).Details
chore: configuration updates
https://maven-prs.papermc.io/Paper/pr12671) to.idea/jarRepositories.xmlandbuild.gradle.ktsfor testing dependencies..idea/vcs.xml.1.21.7-2.21.0ingradle.properties.feat: define dialog API interface
surf-api-bukkit-api.apito exposeCommonDialogsKt,DialogBuilderKt, and builder classes underdev.slne.surf.surfapi.bukkit.api.dialogand...dialog.builder.feat: high-level dialog helpers
CommonDialogs.kt: Add top-levelnoticeDialogandnoticeDialogWithBuilderfunctions.DialogBuilder.kt: Adddialog {},Dialog {}helpers and extensions forDialogRegistryEntry.Builder.feat: builder implementations for dialog components
DialogActionBuilder.kt: Fluent API for creatingDialogActioninstances.DialogActionButtonBuilder.kt: Builder forActionButton(label, tooltip, width, action).DialogBaseBuilder.kt: ConfigureDialogBase(title, external title, body, inputs, afterAction).DialogBodyBuilder.kt: ComposeDialogBodyentries (plain messages, item displays).DialogInputBuilder.kt: Define dialog inputs (text, boolean, number range, single option).DialogTypeBuilder.kt: Configure dialog types (notice, confirmation, list, multi-action, server links).Motivation
Impact
Testing
noticeDialog { ... }.1.21.7-2.21.0.Additional Notes
Download Build‑JARs for this PR: pr-built-jars.zip