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

Analyzer: Fix analyzer not initially visible on iOS 17.4 #2511

Merged
merged 2 commits into from
Mar 29, 2024

Conversation

florian-h05
Copy link
Contributor

@florian-h05 florian-h05 commented Mar 29, 2024

When the analyzer was opened on iOS/iPadOS 17.4 devices, the screen stayed blank until the controls were opened.

ECharts logged the following warning to the console:

[ECharts] Can't get DOM width or height.Please check dom.clientWidth and dom.clientHeight.
They should not be 0.For example, you may need to call this in the callback of window.onload.

This is more or less a workaround, since I cannot really debug on iOS as I have no Mac and BrowserStack does not provide iOS 17.4 devices at the moment. I have checked that this workaround does not affect other devices.

Reported on the community: https://community.openhab.org/t/openhab-4-1-release-discussion/152252/188?u=florian-h05.

When the analyzer was opened on iOS/iPadOS 17.4 devices, the screen stayed blank until the controls were opened.

ECharts logged the following warning to the console:

```
[ECharts] Can't get DOM width or height.Please check dom.clientWidth and dom.clientHeight.
They should not be 0.For example, you may need to call this in the callback of window.onload.
```

Reported on the community: https://community.openhab.org/t/openhab-4-1-release-discussion/152252/188?u=florian-h05.

Signed-off-by: Florian Hotze <[email protected]>
Signed-off-by: Florian Hotze <[email protected]>
@florian-h05 florian-h05 requested a review from a team as a code owner March 29, 2024 16:13
@florian-h05 florian-h05 added bug Something isn't working main ui Main UI labels Mar 29, 2024
@florian-h05 florian-h05 added this to the 4.2 milestone Mar 29, 2024
Copy link

relativeci bot commented Mar 29, 2024

Job #1877: Bundle Size — 10.56MiB (~-0.01%).

cdc19e4(current) vs 4d5a4a4 main#1876(baseline)

Warning

Bundle contains 2 duplicate packages – View duplicate packages

Bundle metrics  Change 1 change
                 Current
Job #1877
     Baseline
Job #1876
No change  Initial JS 1.86MiB 1.86MiB
No change  Initial CSS 607.87KiB 607.87KiB
Change  Cache Invalidation 17.91% 17.64%
No change  Chunks 223 223
No change  Assets 246 246
No change  Modules 2861 2861
No change  Duplicate Modules 141 141
No change  Duplicate Code 1.73% 1.73%
No change  Packages 95 95
No change  Duplicate Packages 2 2
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
Job #1877
     Baseline
Job #1876
Improvement  JS 8.75MiB (~-0.01%) 8.75MiB
Regression  CSS 890.07KiB (~+0.01%) 890.03KiB
Not changed  Fonts 526.1KiB 526.1KiB
Not changed  Media 295.6KiB 295.6KiB
Not changed  IMG 140.74KiB 140.74KiB
Not changed  HTML 1.24KiB 1.24KiB
Not changed  Other 871B 871B

View job #1877 reportView florian-h05:analyzer-ios174 branch activityView project dashboard

@florian-h05 florian-h05 changed the title Analyzer: Fix analyzer initially not visible on iOS 17.4 Analyzer: Fix analyzer not initially visible on iOS 17.4 Mar 29, 2024
@florian-h05 florian-h05 merged commit 2539d6d into openhab:main Mar 29, 2024
6 checks passed
@florian-h05 florian-h05 deleted the analyzer-ios174 branch March 29, 2024 16:24
@scheuerer
Copy link

scheuerer commented Jul 16, 2024

As said before, the issue is not gone with the current 4.2 build.
I have several views which worked in past normal.
Now when open then they are empty, like this
IMG_0015

So I need to press an other graph, eg the humity, that the new graph is shown correct, like this:
IMG_0017

If the clicking for the old temperature graph, which was first empty, now it is also filled right.
See here:
IMG_0016

Everthing is about that when open the graph the first time it is empty....

@florian-h05
Copy link
Contributor Author

Context? From your screenshots I assume iPad, but which iOS version? Which browser and which browser version?
And this here is a PR to fix problems with the analyzer, not with chart pages as shown in your screenshots.
Apart from that, I can neither reproduce your issue on iPad OS 17.5.1 with Safari nor on iOS 17.5.1 with Safari.

Have you tried reload app & clear cache and reload app from Help & About?

@scheuerer
Copy link

Some more information. iOS 17.5.1 on an iPad 12, with Safari and Firefox. No different in the issue which browser I use.
Here is video which I hope to help

https://www.dropbox.com/scl/fi/qj3vtnivimvssjv6lwm1f/20240716_223436.mp4?rlkey=domypwdhdy8n9d7nf1y8fg98z&dl=0

@florian-h05
Copy link
Contributor Author

Have you tried reload app & clear cache and reload app from Help & About?

??

Can you please share the YAML Code of these chart pages?

@florian-h05
Copy link
Contributor Author

Another thing to try: Do the charts on the demo server work for you?

https://demo.openhab.org/page/chart_tabs

@Beluk
Copy link

Beluk commented Jul 17, 2024

I have the same issue with charts. They only work after the second time on iPad and iPhone.

My config is...

config:
  chartType: day
  label: Stromverbrauch pro Stunde
  order: "1"
  sidebar: true
  visibleTo:
    - role:administrator
    - role:user
slots:
  grid:
    - component: oh-chart-grid
      config: {}
  series:
    - component: oh-aggregate-series
      config:
        aggregationFunction: average
        dimension1: hour
        gridIndex: 0
        item: SmartmeterLeistung
        name: Energie
        type: bar
        xAxisIndex: 0
        yAxisIndex: 0
  xAxis:
    - component: oh-category-axis
      config:
        categoryType: day
        gridIndex: 0
        monthFormat: default
        weekdayFormat: default
    - component: oh-time-axis
      config:
        gridIndex: 0
  yAxis:
    - component: oh-value-axis
      config:
        gridIndex: 0
        name: W

@florian-h05
Copy link
Contributor Author

Can you please create a new issue and provide the full context as requested by the template there?
A merged PR especially one that is about a different issue is no place to further discuss bugs. Feel free to ping me on the new issue, thanks.

@openhab openhab locked as off-topic and limited conversation to collaborators Jul 17, 2024
@florian-h05
Copy link
Contributor Author

Although I haven't seen anyone open an issue for the issues report in this PR, I took a second look and @Beluk 's chart code allowed me to finally reproduce the issue. I have created a fix #2677 with which I cannot reproduce the issue anymore.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants