-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Show warning if SSE connection or send command fails #1808
Conversation
03780c5
to
9189f1a
Compare
/cc @digitaldan WDYT? I've seen that you created #1441. |
Job #905: Bundle Size — 15.71MiB (+0.28%).Metrics (4 changes)
Total size by type (3 changes)
|
Hi @florian-h05 , thanks for picking this up! Sounds like a good approach, one thing i would want to check is to make sure the Mobile client is not also displaying an error message on top of this one. I'm fine either having the IOS not show something, or possibly have the UI check to see if a mobile client is handling this message (like we do for showing or not showing the top right "other apps" button) . I 'll find some time to play around as i have not really thought this through. |
I’ve already thought of this, the SSE warning is not displayed if FYI #1807 is required to have this PR properly work (the SSE warning is only persistent if the reconnection mechanism is in place). |
0851a0a
to
b8e41c3
Compare
.failure-toast | ||
background-color #e64a19 !important | ||
font-size 22px !important |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would really prefer finding a Framework7 CSS variable (https://v5.framework7.io/docs/css-variables) instead of hardcoding a color, also I'm not sure about this 22px font size 😅
There are other options for example a centered toast if the app is effectively unusable when the connection is broken (from https://v5.framework7.io/docs/toast#examples):
Or maybe a Notification (https://v5.framework7.io/docs/notification#examples)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This color is the openHAB orange, I have switched to using the --f7-theme-color
CSS variable instead of hard-coding it.
I have chosen the 22px font size to make the warning larger.
Regarding the centered toast: I really don‘t like its look without having an icon, and it seems that we can‘t have both icon and reload button. A toast at the bottom seemed the visually best solution to me.
I haven‘t really looked into the notifications, but IMO we should not use them and instead „reserve“ them for real notifications when MainUI supports Web Push one day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the answer, I don't mind your choices but had to express mine ;)
Follow-up for openhab#1499. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
This reverts commit ce201328b7edf1d36cc5f9167f717e415018d9c2. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Note that this commit only works correctly together with another PR. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Fixes background color of toast on iOS, enlarges font size and simplifies messages. The "Communication failure" toast is shared across SSE and send command (REST) to avoid having the toast popping in and out. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
b8e41c3
to
ad2ff48
Compare
Depends on #1807.
Currently, SSE connection and sending commands fail silently, which makes the user think that everything is fine, but instead outdated values are displayed and commands are not sent.
This implements user warnings for such cases, a large openHAB orange toast "Communication failure" with the option to reload is displayed at the bottom center:
If the Item does not exist (error code 404), " not found" is displayed for 5 sec