kinghat / tabbed-card

a custom card for home assistant that utilizes tabs to segregate individual cards.
MIT License
87 stars 10 forks source link

Custom:stack-in-card prevents Entities card from working in first tab #133

Open almighty059 opened 8 months ago

almighty059 commented 8 months ago

Description

It took me forever to figure this out but after trying almost every card combination I think I finally found the issue.

The issue occurs when using the and the entities: card together in the first tab and only the first tab. When the 'custom:stack-in-cardis used in the first row and theentities:card is placed within the card it will not appear. All the other cards I tried worked fine just not theentities:card. If the I put a 'conditional: card within the 'custom:stack-in-card' and then use the entities: as the card that is shown when the condition is true then it does work. It does not matter how many entities: cards I use, as long as they are separate and within the custom:stack-in-card they will not appear. If I copy the entire code from the first tab and use it for any additional tabs then all of a sudden it works. It also works when using the normal vertical-stack card.

https://github.com/kinghat/tabbed-card/assets/63380298/7cf39b06-fc0b-4f0c-8b3f-f171d970ec35

Environment

- OS: Windows
- Browser: Firefox
- Home Assistant Version: 2023.10.5        
- Tabbed Card Version: v0.3.2

Reproducible configuration

type: vertical-stack
cards:
  - type: custom:tabbed-card
    option: null
    attributes: null
    tabs:
      - card:
          type: custom:stack-in-card
          mode: vertical
          cards:
            - type: custom:button-card   # This works 
              entity: sun.sun
            - type: entities   # This does not appear on dashboard view 
              entities:
                - entity: sun.sun
                - entity: sun.sun
            - type: custom:button-card   # This works 
              entity: sun.sun
            - type: entities   # This does not appear on dashboard view 
              entities:
                - entity: sun.sun
        attributes:
          label: 1
      - card:
          type: custom:stack-in-card
          mode: vertical
          cards:
            - type: custom:button-card   # This works 
              entity: sun.sun
            - type: entities   # This works now since not in first tab
              entities:
                - entity: sun.sun
                - entity: sun.sun
            - type: custom:button-card   # This works 
              entity: sun.sun
            - type: entities   # This works now since not in first tab
              entities:
                - entity: sun.sun
        attributes:
          label: 2

Additional context

No response

kinghat commented 8 months ago

can you first try installing the alpha version: https://github.com/kinghat/tabbed-card/releases/tag/v0.4.0-alpha.2 of the card and see how if the issue persists? if you installed using HACS you can get it from there by enabling "show beta versions" when redownloading it. there were some big changes in that code that might have worked it out.

almighty059 commented 7 months ago

Okay, I'll give it a try and let you know.

almighty059 commented 7 months ago

I just installed the alpha version and the issue still remains. It only seems to apply to the entities card and when it is used inside of the custom:stack-in-card in the first tab. That seems so strange but that's what I was able to narrow the issue down to.

kinghat commented 7 months ago

I just installed the alpha version and the issue still remains. It only seems to apply to the entities card and when it is used inside of the custom:stack-in-card in the first tab. That seems so strange but that's what I was able to narrow the issue down to.

did you clear your site data/cache and reload after updating to the alpha version?

almighty059 commented 7 months ago

Yes. Cleared cache and restarted HA. I did it twice just to be sure.

kinghat commented 7 months ago

im able to reproduce an issue. not sure if its the same issue or even a tabbed-card issue but its something lol

almighty059 commented 7 months ago

Yeah I have no idea myself. It only happens when the entities card is used within the stack-in card and only in the first tab which is strange. There's obviously some type of conflict the between all three of them being used but I have no idea if it's because of something with your card or the stack-in by @RomRider but he hasn't updated it in a while.

So I just switched out the custom:stack-in-card with the custom:vertical-stack-in-card and everything worked fine so it's something specifically between yuor card and RomRider;'s stack-in-card that is somehow conflicting. I just don't know enough to tell what that is. Maybe some type of naming conflict within the code? Is there anything that you use specifically for the first tab that changes in the additional tabs? Just a thought.

kinghat commented 7 months ago

Yeah I have no idea myself. It only happens when the entities card is used within the stack-in card and only in the first tab which is strange. There's obviously some type of conflict the between all three of them being used but I have no idea if it's because of something with your card or the stack-in by @RomRider but he hasn't updated it in a while.

So I just switched out the custom:stack-in-card with the custom:vertical-stack-in-card and everything worked fine so it's something specifically between yuor card and RomRider;'s stack-in-card that is somehow conflicting. I just don't know enough to tell what that is. Maybe some type of naming conflict within the code? Is there anything that you use specifically for the first tab that changes in the additional tabs? Just a thought.

there are a lot of issues in there about rendering things, this one in particular: https://github.com/custom-cards/stack-in-card/issues/49

almighty059 commented 7 months ago

@kinghat I have an off topic question to ask. I now I have the option to use defaultTabIndex: to set which tab is displayed on first render but is there a way to set something similar so that the last tab displayed is the tab displayed on first render?

kinghat commented 7 months ago

@kinghat I have an off topic question to ask. I now I have the option to use defaultTabIndex: to set which tab is displayed on first render but is there a way to set something similar so that the last tab displayed is the tab displayed on first render?

off topic stuff should be kept to the discussion area: https://github.com/kinghat/tabbed-card/discussions

more specifically, the feature requests category. there are already similar tab requests there such as: https://github.com/kinghat/tabbed-card/discussions/70 which you can subscribe to. if you dont feel your request matches anything there, feel free to open another.

ildar170975 commented 7 months ago

More simple example:

type: vertical-stack
cards:
  - type: custom:tabbed-card
    option: null
    attributes: null
    tabs:
      - card: &ref_card
          type: custom:stack-in-card
          mode: vertical
          cards:
            - type: entity
              entity: sun.sun
            - type: entities
              entities:
                - entity: sun.sun
                - entity: sun.sun
        attributes:
          label: 1
      - card: *ref_card
        attributes:
          label: 2

Works unstable:

изображение

изображение

изображение

изображение

изображение

изображение

And seems to be really related to https://github.com/custom-cards/stack-in-card/issues/49