Skip to content
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

Pop up no longer works with updated browser-mod #19

Closed
masterfish1 opened this issue Sep 5, 2022 · 16 comments
Closed

Pop up no longer works with updated browser-mod #19

masterfish1 opened this issue Sep 5, 2022 · 16 comments
Assignees
Labels
bug Something isn't working

Comments

@masterfish1
Copy link

I imagine this is related to the update to browser_mod (https://github.com/thomasloven/hass-browser_mod) as I just had to edit all my personal popups but, as a result the popup in your card no longer works.

@masterfish1 masterfish1 added the bug Something isn't working label Sep 5, 2022
@fratsloos fratsloos self-assigned this Sep 11, 2022
@fratsloos
Copy link
Owner

fratsloos commented Sep 11, 2022

I see there is a change in the browser_mod. I'll look into it. Unfortunately I won't be able to do that for the next two or three weeks, because I can't access my development system until then.

As a temporary workaround you can set the value for the popup to false:

type: custom:fr24-card
entity: sensor.fr24_aircraft
popup: false

@masterfish1
Copy link
Author

No rush. I was just letting you know rather than requiring it be fixed immediately.

The workaround isn't needed as the card itself works absolutely fine even with "popup: true". It's just that the popup doesn't work when on true.

fratsloos added a commit that referenced this issue Oct 2, 2022
@fratsloos
Copy link
Owner

I've finally found some time to work on this issue. I had to completely rebuild my development system, which took some time. I fixed the issue with the popup itself, but it's not complete yet. When working with the color configuration options, the background of the popup is not completely filled. This is because of the many changes in the code of browser_mod. Will continue working on that. Just wanted to let you know that the issue is in progress. :)

@masterfish1
Copy link
Author

Thanks for the update, I appreciate it.

Still no rush for me and actually less so at the moment as I'm moving house next week and my FR24 plane tracker is currently in a box.

@fratsloos
Copy link
Owner

fratsloos commented Oct 15, 2022

@masterfish1 Are you completely settled after the move, and have you already taken HA and your plane tracker out of the box?

I made a pre-release of the card today and tested it in production at my place. Can you also test the release? If you have installed it via HACS you can choose 'show beta versions' at the redownload option. Then you can install version 0.6.0-alpha.

Screenshot 2022-10-15 at 13 34 16

@masterfish1
Copy link
Author

Semi settled. Still loads to unpack but the plane tracker is done.

I won't get chance to test this until tomorrow afternoon but will do so and report back.

@fratsloos
Copy link
Owner

No problem. I'll wait for your feedback. Thanks for testing.

@BrettEBowman
Copy link

The pop-ups are working for me ok. One thing that I notice is that there isn't a "X" to close the pop-up which is sort of counter-intuitive. I think that it is because you don't have a "Title" object for the pop-up? I'm wondering if that main first line (with the flag, registration, and icon) could be the browser_mod pop-up window title (and then a "X" to close would be displayed?). Also, if the "Flight" is known and different from the "Registration", could that be added to that title line?

@masterfish1
Copy link
Author

@fratsloos It isn't working for me but given that it is working for you and @BrettEBowman, I suspect the issue is with my install. Unfortunately, I don't have time to investigate right now.

Sorry for not getting back to you yesterday, Sunday was even worse than Saturday in the end.

fratsloos added a commit that referenced this issue Oct 17, 2022
@fratsloos
Copy link
Owner

fratsloos commented Oct 17, 2022

@BrettEBowman

One thing that I notice is that there isn't a "X" to close the pop-up which is sort of counter-intuitive. I think that it is because you don't have a "Title" object for the pop-up?

You're right. Because title was not used, the popup from browser_mod did not render a header with the cross to close the popup.
I modified this in the last commit by using the textual value of the title below the aircraft image as the popup title. For below the image I created a subtitle that now shows other data:

  • if there is a registration: title contains registration, subtitle contains flight number or ICAO code
  • if there is no registration, but there is a flight number: title contains flight number, subtitle the ICAO code
  • if there is no registration and no flight number: both contain the ICAO code.

Screenshot 2022-10-17 at 20 03 17

Edit: the changes will be available in a pre-release later this week.

(with the flag, registration, and icon)

That would indeed have been nice. Unfortunately it seems that the popup only accepts text as input and not HTML. See the source code.

@masterfish1

Sorry for not getting back to you yesterday, Sunday was even worse than Saturday in the end.

No problem! It's a hobby for all of us, right? ;)

Just to be sure, did you fully install the new version of browser_mod? I got in the sidebar of HA an item 'Browser Mod' in which I first had to turn on the 'Register' option.

@fratsloos
Copy link
Owner

I've just released version v0.6.0-beta which is available in HACS beta versions with the latest changes.

@masterfish1
Copy link
Author

Seems to be working fine for me. Even the pop-up is working now. It started working on the alpha version too without me changing anything so no idea what was going on there at first.

@BrettEBowman
Copy link

I'm not seeing the Title in the pop-up. I'm pretty sure that the new code is in place OK because the "sub-title" line (with the flag and horizonal icon) is showing the new format.

Is there a change that I need to make to the card's configuration?

@BrettEBowman
Copy link

BrettEBowman commented Oct 23, 2022

Update: I'm getting the Title in the pop-up when I use Edge as the browser, but not with Chrome. I'll have to try to dig into it more later and see if I can figure out why.

EDIT: I got it to work in Chrome. I followed the instructions from the browser_mod page to force a hard cache reload. (I had already tried just doing a Ctrl-F5, which didn't make any difference.) So here's what I did:

Desktop Google Chrome
Navigate to the page
Press F12 to open the chrome developers console
Right click the refresh button to the left of the address bar (not in the developers console, but it needs to be open for this to work)
Select the bottom option to clear the cache and perform a hard refresh

@fratsloos
Copy link
Owner

fratsloos commented Oct 24, 2022

EDIT: I got it to work in Chrome. I followed the instructions from the browser_mod page to force a hard cache reload. (I had already tried just doing a Ctrl-F5, which didn't make any difference.)

Yes, in these cases it's a caching issue almost every time. HA is known for an aggressive caching method. Just a tip, when Ctrl+F5 doesn't do the trick, you can try it with Ctrl+Shift+R, or for the Mac users + Shift + R (docs).

By the way; good to know it's working for the both of you now. I'll make a proper release somewhere this week. :)

@fratsloos
Copy link
Owner

Fixed in v0.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants