Skip to content

Pagination / Search Dialog#216

Merged
ammodev merged 8 commits into
version/1.21.11from
feat/default-dialogs
Feb 10, 2026
Merged

Pagination / Search Dialog#216
ammodev merged 8 commits into
version/1.21.11from
feat/default-dialogs

Conversation

@ammodev

@ammodev ammodev commented Feb 10, 2026

Copy link
Copy Markdown
Member

This pull request introduces a new composable dialog architecture for Bukkit plugins, enabling stateful, paginated, and searchable dialogs for players. It includes a general-purpose dialog composition system, pagination support, dialog state/query abstractions, and a test command to demonstrate paginated dialogs in action.

Composable Dialog Architecture:

  • Added DialogScope, DialogStore, and a composableDialog DSL to manage dialog state, state updates, and caching within a coroutine scope, allowing for reactive dialog UIs. [1] [2] [3]

Pagination and Query Abstractions:

  • Introduced paginatedDialog, a reusable function for creating paginated and optionally searchable dialogs, supporting item rendering, pagination controls, and search reset.
  • Added generic dialog query interfaces (DialogQuery, CursorDialogQuery) and result/state data classes (PageResult, CursorResult, PageState, CursorState) to abstract data retrieval and pagination logic. [1] [2] [3]

Dialog State Management:

  • Defined a marker interface DialogState for dialog state types, enabling type-safe state handling across the dialog system.

Testing and Demonstration:

  • Implemented a test command (paginationDialogTestCommand) and supporting classes to showcase the paginated dialog system, including search functionality and navigation through a large dataset. Registered the command in the test plugin's main class. [1] [2] [3]

@ammodev ammodev self-assigned this Feb 10, 2026
Copilot AI review requested due to automatic review settings February 10, 2026 08:38
@ammodev ammodev enabled auto-merge February 10, 2026 08:39
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ API/ABI changes detected!

This PR contains changes that modified the public API. To update the reference ABI dumps:

./gradlew updateLegacyAbi
git add **/api/**
git commit -m "Update ABI reference"
git push

After updating, the CI will pass. Make sure the changes are backward compatible.

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ API/ABI changes detected!

This PR contains changes that modified the public API. To update the reference ABI dumps:

./gradlew updateLegacyAbi
git add **/api/**
git commit -m "Update ABI reference"
git push

After updating, the CI will pass. Make sure the changes are backward compatible.

Copilot AI left a comment

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.

Pull request overview

This PR adds a composable dialog system to the Bukkit API module, with stateful rendering and a reusable paginated/searchable dialog helper, plus a plugin-test command demonstrating the new pagination UI.

Changes:

  • Introduces dialog composition primitives (DialogStore, DialogScope, composableDialog) to render dialogs from state and update/re-render on state changes.
  • Adds pagination/query abstractions (DialogQuery, PageState, PageResult, etc.) and a paginatedDialog composable supporting optional search.
  • Adds a plugin-test command and sample dataset/query to demo paginated + searchable dialogs.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
surf-api-bukkit/surf-api-bukkit-plugin-test/src/main/kotlin/dev/slne/surf/surfapi/bukkit/test/command/subcommands/PaginatedDialogTest.kt Adds a demo command, sample dataset, and a DialogQuery implementation for paginated/search filtering.
surf-api-bukkit/surf-api-bukkit-plugin-test/src/main/kotlin/dev/slne/surf/surfapi/bukkit/test/BukkitPluginMain.kt Hooks the pagination dialog test command into the test plugin lifecycle.
surf-api-bukkit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/dialog/state/DialogState.kt Adds a marker interface for dialog state types.
surf-api-bukkit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/dialog/query/states.kt Defines paging/cursor state models used by dialog queries.
surf-api-bukkit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/dialog/query/results.kt Defines page/cursor result models returned by queries.
surf-api-bukkit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/dialog/query/queries.kt Adds query fun-interfaces for page/cursor data retrieval.
surf-api-bukkit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/dialog/pagination/PaginatedDialog.kt Implements the reusable paginated/searchable dialog composable.
surf-api-bukkit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/dialog/composition/dsl.kt Adds the composableDialog entrypoint DSL.
surf-api-bukkit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/dialog/composition/DialogStore.kt Implements state storage, caching, and rerendering logic.
surf-api-bukkit/surf-api-bukkit-api/src/main/kotlin/dev/slne/surf/surfapi/bukkit/api/dialog/composition/DialogScope.kt Exposes state helpers (state, setState, remember) for dialog rendering.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ API/ABI changes detected!

This PR contains changes that modified the public API. To update the reference ABI dumps:

./gradlew updateLegacyAbi
git add **/api/**
git commit -m "Update ABI reference"
git push

After updating, the CI will pass. Make sure the changes are backward compatible.

ammodev and others added 3 commits February 10, 2026 09:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…default-dialogs

# Conflicts:
#	surf-api-bukkit/surf-api-bukkit-plugin-test/src/main/kotlin/dev/slne/surf/surfapi/bukkit/test/command/dialog/subcommands/PaginatedDialogTest.kt
@ammodev ammodev disabled auto-merge February 10, 2026 10:48
@ammodev ammodev merged commit e4976dc into version/1.21.11 Feb 10, 2026
4 checks passed
@ammodev ammodev deleted the feat/default-dialogs branch February 10, 2026 10:48
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ API/ABI changes detected!

This PR contains changes that modified the public API. To update the reference ABI dumps:

./gradlew updateLegacyAbi
git add **/api/**
git commit -m "Update ABI reference"
git push

After updating, the CI will pass. Make sure the changes are backward compatible.

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