Skip to content

Add action confirmation editor#52384

Open
pcan08 wants to merge 11 commits into
home-assistant:devfrom
pcan08:lovelace-action-confirmation-editor
Open

Add action confirmation editor#52384
pcan08 wants to merge 11 commits into
home-assistant:devfrom
pcan08:lovelace-action-confirmation-editor

Conversation

@pcan08

@pcan08 pcan08 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Proposed change

Adds a visual editor for the confirmation option 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 button
Click 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 know

Screenshots

image image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the perfect PR recommendations
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

To help with the load of incoming pull requests:

pcan08 and others added 5 commits June 3, 2026 05:06
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>
pcan08 and others added 3 commits June 3, 2026 09:36
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>
@pcan08 pcan08 force-pushed the lovelace-action-confirmation-editor branch from b55c8e6 to c1f7c02 Compare June 3, 2026 09:37
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>
@Jump-333

Jump-333 commented Jun 3, 2026

Copy link
Copy Markdown

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)

@MindFreeze MindFreeze added the Needs UX Items requiring a review from the Home Assistant design team label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed Needs UX Items requiring a review from the Home Assistant design team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants