Page MenuHomePhabricator

Zooming in or out in wikistats shouldn't alter the number of metrics shown
Closed, ResolvedPublic

Description

@Nuria mentioned that because of the level of zoom in her Chrome, the UI was switching to the 2 metric per area layout, which at first I thought was related to the operation we perform based on the pixel ratio of the device. It's actually related to the scaling of DOM elements when zooming. Check out the computed width of the application when we zoom in one step:

Screen Shot 2018-03-27 at 10.20.47 AM.png (85×512 px, 12 KB)

Which makes the UI toggle to 2 metrics, as 1023.99 is below the 1024px threshold.

Funny thing is, this only happens in every other zoom step. If we zoom in again the width goes back to 1024px, and so on.

Event Timeline

Change 422102 had a related patch set uploaded (by Fdans; owner: Fdans):
[analytics/wikistats2@master] Prevents zooming in site from changing the number of metrics shown per area

https://gerrit.wikimedia.org/r/422102

Funny thing is, this only happens in every other zoom step. If we zoom in again the width goes back to 1024px, and so on.

Right, i saw that too . The devicepixelratio reported changes.

@Nuria but the issue you reported was caused by computed width of the app container switching between 1024 and 1023.99. Even though the pixel ration was changing too (as it should), that wasn't causing the threshold jump.

Even though the pixel ration was changing too (as it should), that wasn't causing the threshold jump.

the point i wanted to make was that the computation result changed cause the picxelRatio changed, we agree that it should not happen that way.

Change 422102 merged by Fdans:
[analytics/wikistats2@master] Prevents zooming from changing the number of metrics shown per area

https://gerrit.wikimedia.org/r/422102