home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
4.12k stars 2.81k forks source link

The nested trigger `triggers` is breaking the automation editor #22101

Closed jlpouffier closed 2 months ago

jlpouffier commented 2 months ago

Checklist

Describe the issue you are experiencing

2024.10 introduced a way for (advanced) users to nest triggers like that:

description: ""
triggers:
  - triggers:
      - trigger: state
        entity_id:
          - light.salon_buffet_droit
        id: child_1
      - trigger: state
        entity_id:
          - light.salon_buffet_gauche
        id: child_2

Today this is not handled well by the UI, as show here:

CleanShot 2024-09-26 at 16 17 20

CleanShot 2024-09-26 at 16 17 33

Even if this is a pretty advanced use case mostly built for blueprint creators, we should not break the UI especially knowing that users can take control of blueprints

Describe the behavior you expected

I would expected a nested block as similar to what we built for the sequence building block Just a list, displaying the individual child triggers.

Similar to that CleanShot 2024-09-26 at 16 20 41

Steps to reproduce the issue

  1. Open Automation editor
  2. Go into YAML mode
  3. Coyp this:
    alias: "TEST NESTED TRIGGERS "
    description: ""
    triggers:
    - triggers:
      - trigger: homeassistant
        event: start
      - trigger: homeassistant
        event: shutdown
    conditions: []
    actions: []
    mode: single
  4. Back to visual mode

What version of Home Assistant Core has the issue?

core-2024.10.0b0

What was the last working version of Home Assistant Core?

core-2024.9.3

In which browser are you experiencing the issue with?

Version 1.61.1 (54104) Chromium Engine Version 129.0.6668.59

Which operating system are you using to run this browser?

macOS 14.6.1 (23G93)

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

jlpouffier commented 2 months ago

Additional brain dump. It may be more complex than I initially thought.

It's not a "real" trigger. Triggers are flatten on core side

So

Basically most of the overflow menu won't work.