Skip to content

Improve ConfirmDialog to support multiple closing states #876

@Cyclone1337

Description

@Cyclone1337

Problem:

Currently, when the user closes the ConfirmDialog by pressing the X button, the dialog automatically returns false. This conflates the “No” response with “Closed via X”, which can be misleading in some workflows.

Desired behavior:

The ConfirmDialog should differentiate between multiple closing states:

  • Confirmed → user clicked Yes

  • Canceled → user clicked No

  • Closed → user closed the dialog via X

This allows developers to handle each case explicitly.

Possible additional workaround:

Optionally allow the X button to be hidden, forcing only explicit Yes/No responses.

Notes / Suggestions:

  • Consider returning an enum instead of a bool to represent the three states.

  • Ensure backward compatibility.
    The Delete configuration should still only require a simple true/false return value, as before.
    In contrast, the Yes/No configuration should support all three states, because No and Cancel can represent two different outcomes.

Example:

"Should the unused node types also be removed?"

  • No → Do not remove the unused node types, but continue the deletion process.

  • Cancel → Abort the deletion entirely.

  • Yes → Delete both the nodes and the unused node types.

This ensures that existing Delete workflows continue to work with true/false, while the Yes/No configuration can express the more nuanced states.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ImprovementImprovement of existing features

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions