Page MenuHomePhabricator

Wikistats 2.0: Page heading style varies
Closed, ResolvedPublic

Description

When landing on https://stats.wikimedia.org/v2/, the heading has a certain size and is generally not bolded. When navigating around to different views and pages, it stays constant.

Except when accessing a page with a map, when it suddenly becomes bolded:

Page with a mapAll other pages
Screen Shot 2018-02-14 at 16.56.38.png (362×1 px, 64 KB)
Screen Shot 2018-02-14 at 16.55.23.png (356×1 px, 57 KB)
Screen Shot 2018-02-14 at 16.56.16.png (970×2 px, 291 KB)

Once this page has been visited, the heading stays bolded until the page is refreshed. Presumably due to navigation being implemented in JavaScript, and the additional styles staying active.

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
fdans triaged this task as Medium priority.
fdans added a project: Analytics-Kanban.
fdans moved this task from Incoming to Wikistats Beta on the Analytics board.

I'm totally familiar with the issue you are describing, but it does seem like we corrected it at some point recently, since I'm now trying to replicate it and the style of the heading remains consistent regardless of where I go in the site. The issue of some of our css selectors not being precise enough, thus some style declarations having side effects still remains, and it's something that we probably should look at, which is why I've just opened T190915

@fdans I can still reproduce the issue:

  1. View https://stats.wikimedia.org/ in a new tab. – Heading not bold.
  2. In that tab, click "Reading", then click "Page Views by Country. – Heading not bold.
  3. You're now at https://stats.wikimedia.org/v2/#/all-projects/reading/pageviews-by-country
  4. Refresh this page, or otherwise open it directly in a tab (instead of navigating from home). – Heading bold.

So it seems there are styles that are loaded as part of maps pages (like "Page Views by country") that cause the heading to be bold.

But, when navigating to a maps page from another page, those styles don't "win" due to other left-over styles from other pages being "stronger" and thus remaining in effect.

Viewing maps indirectly (eg via Home)Viewing maps directly
Screen Shot 2018-03-28 at 17.36.04.png (1×2 px, 536 KB)
Screen Shot 2018-03-28 at 17.36.06.png (1×2 px, 538 KB)

You can see here there is an additional style block in the inheritance chain:

.left.floated.header {
    font-size: 30px;
    font-weight: 500;
}

This overwrites the bold code (700) back to a more regular weight (500). But these styles are only loaded on the home page, not on the maps page. So unless a visitor views home first (and gets these styles applied), they are missing.

@Krinkle thank you so much for the report! I've uploaded a change to get rid of this.

Change 422925 had a related patch set uploaded (by Fdans; owner: Fdans):
[analytics/wikistats2@master] Prevent Wikimedia Statistics header from bolding in certain cases

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

Change 422925 merged by Milimetric:
[analytics/wikistats2@master] Prevent Wikimedia Statistics header from bolding in certain cases

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

Krinkle removed a project: Patch-For-Review.