Skip to content
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

feat: adds Prompt Dialog support #1262

Merged

Conversation

pedrolamas
Copy link
Member

@pedrolamas pedrolamas commented Dec 7, 2023

Adds support to the prompt dialog commands, based on Octoprint Action Command Prompt.

This feature was requested here, and after discussion with Mainsail devs, we have come to an agreement for an MVP.

The implementation here matches the documentation here, with the exception of action:prompt_button_group_* (these are for now ignored and we just stack all the buttons).

Example 1

Commands:

RESPOND TYPE=command MSG="action:prompt_begin MacroPrompt"
RESPOND TYPE=command MSG="action:prompt_text These are all button colors"
RESPOND TYPE=command MSG="action:prompt_button default|TEST"
RESPOND TYPE=command MSG="action:prompt_button_group_start"
RESPOND TYPE=command MSG="action:prompt_button primary|TEST|primary"
RESPOND TYPE=command MSG="action:prompt_button secondary|TEST|secondary"
RESPOND TYPE=command MSG="action:prompt_button_group_end"
RESPOND TYPE=command MSG="action:prompt_button_group_start"
RESPOND TYPE=command MSG="action:prompt_button info|TEST|info"
RESPOND TYPE=command MSG="action:prompt_button warning|TEST|warning"
RESPOND TYPE=command MSG="action:prompt_button error|TEST|error"
RESPOND TYPE=command MSG="action:prompt_button_group_end"
RESPOND TYPE=command MSG="action:prompt_show"

Result:

image

Example 2

Commands:

RESPOND TYPE=command MSG="action:prompt_begin Question"
RESPOND TYPE=command MSG="action:prompt_text Do you want to cancel the print?"
RESPOND TYPE=command MSG="action:prompt_footer_button continue|RESPOND TYPE=command MSG=action:prompt_end"
RESPOND TYPE=command MSG="action:prompt_footer_button CANCEL|CANCEL_PRINT|error"
RESPOND TYPE=command MSG="action:prompt_show"

Result:

image

@pedrolamas pedrolamas added the FR - Enhancement New feature or request label Dec 7, 2023
@pedrolamas pedrolamas added this to the 1.26.4 milestone Dec 7, 2023
@pedrolamas pedrolamas requested a review from matmen December 7, 2023 22:14
@pedrolamas pedrolamas force-pushed the pedrolamas/prompt-dialog branch from 3204078 to 3795709 Compare December 8, 2023 13:20
@pedrolamas pedrolamas merged commit b5733d6 into fluidd-core:develop Dec 8, 2023
4 checks passed
@pedrolamas pedrolamas deleted the pedrolamas/prompt-dialog branch December 8, 2023 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FR - Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant