Skip to content

✨ feat(dialog): add search dialog functionality with input handling - #412

Merged
twisti-dev merged 2 commits into
version/26.2from
feat/minestom-dialogs-dsl
Aug 19, 2026
Merged

✨ feat(dialog): add search dialog functionality with input handling#412
twisti-dev merged 2 commits into
version/26.2from
feat/minestom-dialogs-dsl

Conversation

@twisti-dev

Copy link
Copy Markdown
Contributor
  • introduce SearchDialog for querying with customizable input fields
  • implement action buttons for search and cancel with tooltips
  • ensure dialog closes before executing callbacks for search and close actions

- introduce SearchDialog for querying with customizable input fields
- implement action buttons for search and cancel with tooltips
- ensure dialog closes before executing callbacks for search and close actions
Copilot AI lite review requested due to automatic review settings August 19, 2026 20:47

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@twisti-dev
twisti-dev merged commit 23ef287 into version/26.2 Aug 19, 2026
4 of 7 checks passed
@twisti-dev
twisti-dev deleted the feat/minestom-dialogs-dsl branch August 19, 2026 20:47

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e84132d332

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


type {
confirmation {
no {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bind cancellation to the no button

When canCloseWithEscape is enabled, confirmation-dialog cancellation delegates to the no button, but this block assigns onSearch to that button and onClose to yes. Pressing Escape therefore submits the current query and invokes onSearch instead of treating the dismissal as cancellation; swap the search and cancel button mappings.

Useful? React with 👍 / 👎.

Comment on lines +94 to +96
val search = SearchDialogAction(
label = { },
tooltip = { }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve defaults when customizing button blocks

When a caller supplies either button block to customize only one property—for example, changing the cancel tooltip—the corresponding default-argument block is not executed, and these empty initializers erase the default label and tooltip. The resulting button can therefore have a blank label; initialize each SearchDialogAction with its documented default values before applying the caller's block, as is already done for SearchInput.

Useful? React with 👍 / 👎.

tooltip(search.tooltip)

action {
customPlayerClick { response, player ->

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow returned dialogs to handle repeated submissions

When the returned Dialog is cached, revisited from a dialog list, or shown to multiple players, each button stops working after its first use because customPlayerClick defaults to DialogCallbackOptions.DEFAULT, whose registration permits only one global use. Since searchDialog neither exposes callback options nor documents the returned dialog as single-use, subsequent clicks are silently ignored; register reusable callbacks or expose lifecycle options to callers.

Useful? React with 👍 / 👎.

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