Add action confirmation editor#52384
Open
pcan08 wants to merge 11 commits into
Open
Conversation
Adds an inline toggle + pencil icon to `hui-action-editor` for any eligible action (not `none`/`default`). The pencil opens a sub-page via the existing sub-element pattern where the user can configure `title`, `text`, `confirm_text`, and `dismiss_text`. Exempt users remain YAML-only (for now). Also fixes the `actionConfigStructConfirmation` struct which was missing `title`, `confirm_text`, `dismiss_text` and had a typo (`excemptions` → `exemptions`), causing the visual editor to reject any confirmation config with those fields. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nent Moves the inline toggle + pencil row out of hui-action-editor into a dedicated hui-action-confirmation-toggle component in confirmation-editor/. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on toggle Also aligns pencil button size to 36px to match feature editor style. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on editor Replaces computeHelper approach with proper selector placeholder on confirm_text (OK) and dismiss_text (Cancel) fields. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Uses ui.dialogs.generic.default_confirmation_title ("Are you sure?")
as placeholder, matching the runtime default shown by the dialog.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extracts confirmation default text calculation from handle-action into a reusable getConfirmationDefaultText utility. Passes actionConfig via context so the confirmation editor can display the correct runtime default as a placeholder in the message field. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces placeholders with helper text showing "Default: <value>" below each field, which is semantically clearer — the user always sees the default even after typing, and understands it's a fallback. Also removes unused _placeholder translation keys. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b55c8e6 to
c1f7c02
Compare
Replaces the YAML-only hint with a ha-users-picker component that lets users select which HA accounts skip the confirmation dialog. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
It'd be amazing (but I don't know if it's possible) to be able to ask for confirmation based on a condition (es. if binary_sensor.something == true, then show the message, else don't) |
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.
Proposed change
Adds a visual editor for the
confirmationoption on Lovelace card interactions (tap_action,hold_action,double_tap_action, etc.).Each interaction that has an eligible action (anything except
none/ unset) shows an inline toggle + edit buttonClick on the edit button navigates to the confirmation dialog editor
For now, exemptions is not implemented. I can add it in this PR or in a follow-up PR. let me knowScreenshots
Type of change
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
To help with the load of incoming pull requests: