-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2024.8.0 - Markdown cards not loading classes on page load until theme is reloaded #392
Comments
FWIW, I have confirmed that applying styles directly to the markdown card works as expected on page load, which seems obvious since it's not loading the styles from the theme. |
Confirmed, and I observe it to Markdown particularly (Entity, Entities - work OK). |
Same here. My LCARS theme is fully unusable with 2024.8. |
did anyone check the markdown card resource for changes in the Dom? if they changed the resource, we should be able to find it there. |
This could be some kind of race condition, at least sometimes the CSS seems to be applied to the markdown card. Note how the results differ when I navigate between the pages. You can always see some headers/footers where it worked and some where it didn't and these change every time. So I strongly suspect some timing problem here. 2024-08-14_06-50-31.mp4 |
Yup, I'm seeing the same behaviour - sometimes it loads the class correctly, sometimes it doesn't. Even the same Markdown element duplicated will sometimes only pick up the style on one of them. |
Same behavior here. |
With me this behavior likewise appears. Unfortunately, many Themes are thereby useless. |
Same issue for me also - LCARS theme specifically. |
Adding my voice that this intermittantly occurs on my LCARS themed dashboards as well. Regular refreshes do not solve the problem. It occurs in Fully Kiosk browser as well as the Home Assistant app |
I too will add my voice to this issue. Building my own LCARS based them in Kiosk/panel mode for a non-admin user So the option of a reload themes button is out of the question as user does not have priveledges to run the service :( have to hit the reload service everytime i make a change and refresh the panel. sometime multiple preses just to get it to display correctly.. I also making heavy use of markdown cards as i also implement some customised font colours and decorations. |
I worked around this by creating an automation to reload the theme then adding a button to the non-admin dashboards that runs the automation. Works like a charm, though it will be better once this issue is fixed of course. |
I too am experiencing this exact issue. |
+1 for experiencing this. Please shout if anything is needed to get more data/test/check. |
Same experience here. Markdown issues. No header, footer, etc |
With my all due respect to people confirming this issue: |
oh, does it not give a general idea how widespread it is? |
Useless information. If something is “0” - it will not become “1”. |
This comment was marked as off-topic.
This comment was marked as off-topic.
The great card-mod plugin - not MY project, unfortunately ))) |
Both of you could could do with being a bit more tactful, the bickering isn't helpful to anyone. Can we please keep this issue on topic. |
Please tell it to a person who started using words like “asshole” and thus exposed himself as a jerk 🤷. I just replied him. Once again:
|
I have the same problem even in
Reload works sometimes to fix it. I'm using CARD-MOD 3.4.3 . No errors I can connect to this problems are visible in the browser console. |
Not really a surprise but for confirmation I am still seeing this issue on HA 2024.9.0 |
Unfortunately, even 1 month later, there is no reaction from the card-mod team to the (at least for me) critical error (dashboard fully unusable). You're doing really good work in your free time - thank you for that!!! But it would still be nice if you at least sent a short "accepted, but it will take a while" message. Some issues have been open here for over three years without any response... Since I have no idea how long the error will remain, I unfortunately had to uninstall LCARS and no longer use card-mod, otherwise my wife will give me hell with the unusable display ;-) By the way: at first the family doesn't want something like that in the house, but later it has to work without errors. Kind of funny :-) |
You are exaggerating the issue.
When the issue with card-mod is solved - simply remove/comment card-mod code in the template. |
First of all, thank you for the tip, which I'm sure others can use now! I counted my old LCARS dashboard - 155 markdown cards, all with card-mod code. Maybe I'm misunderstanding this, but I would have to customize all the markdown cards and copy all the code into the templates. Nevertheless, thank you again for your effort! |
Would you mind sharing examples to those of us not understanding you?
…-------- Original Message --------
On 08/09/2024 23:11, ildar170975 wrote:
> 155 markdown cards, all with card-mod code.
Do you mean that your Markdown cards have ADDITIONAL card-mod code - i.e. in addition to card-mod-theme from LCARS?
If these Markdown cards have only difference in “title” and “content” - then you can replace these cards by one common template as it was described above.
BTW, this “155” number frightens me))). If the Markdown card is used along with other cards in combinations - have you considered to use decluttering template for these “combinations”? In my setup I have (almost) zero of repeating code.
—
Reply to this email directly, [view it on GitHub](#392 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AEMGWC3FC6RERGBBBRFBJ3LZVTDRPAVCNFSM6AAAAABMG7ORE6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZWHA2DCMRZGY).
You are receiving this because you commented.Message ID: ***@***.***>
|
I don't know about op but for my it's a series of vertical stack cards with different title and content values. And I'm sure you've got lovely beautiful dashboards but there is a dearth of good tutorials for this. |
@csanner |
I don't think discussing a workaround to the issue currently present in this repo is offtopic, just because it uses a different addon - if it's a valid workaround, then it's fair game. I mean this topic was started because of the LCARS theme, so by the same extension it would be offtopic.. However, the reason people are asking for a tutoral/guide on your suggestion is because it's not clear how it solves the issue, either. I am familiar with the decluttering card, but I don't see how it helps card-mod not loading correctly. With the LCARS theme, Markdown cards are used quite heavily to add what I guess you'd call "flair", lots of headers, dividers and footers, etc. so it's not unreasonable or unexpected for someone to have 100+ of them. Thus while your suggested workaround is a welcome one, it's not an "easy" fix. The easiest workaround I've found is somewhat of a hammer to crack a nut, this automation:
It calls |
my 2cnts:
and then add that to any card you require via an include:
it would be a 1 liner in the actual markdown cards, so not that much of a waste this is only possible in yaml mode unfortunately also, if this is actually the consequence of HA 2024.8, then you would need to try to get in touch with HA devs, to see what they changed, making classes not load on Markdowns any longer. |
I assumed that most suffering users using a storage mode - so proposed a “decluttering card” way. (untested) or try using an external js-file to style markdown cards (a positive negative effect - ALL markdown cards in HA will be styled). |
This comment was marked as off-topic.
This comment was marked as off-topic.
Probably because YOU have not tried solving it. |
you are aware this is not a helpdesk? in other words: and there will be no real fix at all, because the author of this repo has not chimed in, and he is the only one that could truly fix (if it's an issue in Card-mod). |
People keep mentioning to use a decluttering template - that's great. Would one of you using that please share a quick example, not asking for a full on tutorial, just copy and paste what you do to achieve this showing the LCARS code too? Yes, I am reading the docs for decluttering, still having this example would be a big old speed boost please. |
show us what you did, so we can help you out please make it only a small example (like I did above), and not a complete fleshed out configuration |
I haven't done it yet - that's my point. People are saying "use the decluttering template" and not sharing an example to help people start it off.. So far, I have done as per the instructions on the LCARS theme type: vertical-stack
Pretty basic |
Three ways we have:
|
As for practical use of decluttering card - repeat, read docs in corr repo and ask in Community. |
This comment was marked as off-topic.
This comment was marked as off-topic.
HA-LCARS author, here. I want to clarify that this is not an issue that exclusively affects HA-LCARS. For Thomas' sake, I want to make sure there is a clear delineation between HA-LCARS and card-mod; HA-LCARS uses card-mod in ways that Thomas probably never intended. It just so happens that Markdown cards are commonly used in HA-LCARS. But I did not use the HA-LCARS theme in the original example in this issue for the purpose of decoupling the issue from HA-LCARS. I would ask that further conversation around HA-LCARS be relegated to the HA-LCARS Discord. Note, however, name-calling will result in an immediate ban from the Discord server. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I would further request that if anyone has commented on this thread anything that does not have to do with the original issue or that is not a workaround appropriate or (truly) useful for non-HA-LCARS users, to please hide or delete comments. We're not helping our case to get this issue resolved. |
I believe the whole idea if the decluttering card is to prevent the class (which you report as not working correctly) and replace that with a card_mod directly on the Markdown card itself. so the decluttering template would use the card_mod, and any other repetitive yaml. template and save it in de decluttering folder with a descriptive title, (for now I used 'markdown'):
and then use that in the frontend
ofc, you need to expand on that, but this is to get you going. I didnt check the LCARS at all, so have no idea whether this would be a useable workaround yet. |
It's worth highlighting that this issue isn't specific to Markdown cards either, other card types will be affected by the issue as well (to varying degrees in my experience) - so any solution that involves using templates to inject the card-mod code will need templates creating for lots of other card types as well. Definitely doable if it fixes the issue, but it's going to be a lot of work. |
Thank you for this. This was the one that will be enough for me—tried all the other suggestions with no consistent results. The "declutter" card did not work either. |
none of my classes suffer the described issue, but, I admit to only use a few. having said that, things like these classes are functional as ever, just as the generic settings for the buttons-header-footer
|
this might be worth the experiment: what happens if you add this to the mod:
Markdown is one of the rare cards (next to a few incidental type picture-x cards) that requires this in the regular modding, because every now and then when I use it without, and the markdown is in a stack or entities, those margins get applied to the containing card and make the markdown go beyond the limits of the container... setting it explicitly to the |
Hi,
|
I didn't see a simple example of the decluttering solution. It turned out to be quite easy and works well. Once you have installed it via HACS you can use this example code to get the card working. Search for 'Decluttering Card' in HACS and follow the install instructions. In the dashboard raw configuration editor place a template in front of the existing code:
Then replace the markdown card with the following (change variables as you need to)
I hope that is helpful for some. |
@th3jesta the
|
thanks @nickshew, that worked a treat! |
not sure that decluttering solution is so fail-safe as you hope it is. decluttering is known for its intricacies, especially in combination with card-mod, and passing on templates in particular. If it works in your current usecase, please use it of course. Just be ware that in more complex (card-modded) configurations, you need to be very alert all settings are passed on to the final card.
isn't that what I proposed here #392 (comment) ? O well, use the workaround that works for you, in either case, if there is a true bug in card-mod, it needs to be fixed by Thomas, as he is the true magician here. and be sure to load the resource via de Frontend:
cant hurt to repeat that once more |
My Home Assistant version: 2024.8.0
My lovelace configuration method (GUI or yaml):
Both.
What I am doing:
Applying a class to a Markdown card so custom CSS in theme file loads.
What I expected to happen:
Class should load and styling should apply to card on page load.
What happened instead:
Class does not load and styling does not apply to card on page load until
frontend: Reload themes
is called, every time the page is loaded. This only happens in 2024.8.0 and has been reported by many of my theme users. See below video for a demonstration.Untitled.mov
Minimal steps to reproduce:
Error messages from the browser console:
None.
By putting an X in the boxes ([]) below, I indicate that I:
Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).
Have made sure I am using the latest version of the plugin.
Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.
Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.
The text was updated successfully, but these errors were encountered: