Page MenuHomePhabricator

Hidden #mw-panel-toc in Vector-2022 overlaps .vector-page-titlebar (can't select title)
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

The first few characters aren't selectable because #mw-panel-toc overlaps it.

Screenshot from 2023-02-02 18-34-47.png (560×963 px, 79 KB)

What should have happened instead?:

I should be able to select the characters. In my case I also use the https://en.wikipedia.org/wiki/User:Anomie/useridentifier.js script, which adds the clickable icons you see next to the title in the above screenshot, but I am unable to click on them.

Other information (browser name/version, screenshots, etc.):

Tested in Chrome 108.0.5359.124 on Ubuntu
Not observed in Firefox 109.0
Observable in Firefox 112.0a1 on Windows

Adding display: none to #mw-panel-toc seems to fix it.

QA

Text selection

Screenshot 2023-02-08 at 15.12.21.png (511×698 px, 149 KB)

Gif with TOC box colored red

chrome_u7H2pHRSlX.gif (277×906 px, 80 KB)

QA Results - Prod

ACStatusDetails
1T328719#871647

Event Timeline

Jdlrobson added subscribers: Jdrewniak, Jdlrobson.

The issue here seems to be the use of contain: paint;

Any temporary solution to this aside from keeping the sidebar open at all times? It is quite annoying.

Edit: Seems like setting .vector-toc-pinned #mw-panel-toc's contain to unset doesn't mess anything up and fixes the issue.

Please see detailed notes in the duplicate task.

This apparently also affects every wikidata page, as wikidata items never have a ToC.

Given the amount of duplicate bugs this is clearly bothersome to editors so I think this should be high.

Jdlrobson renamed this task from Hidden #mw-panel-toc in Vector-2022 overlaps .vector-page-titlebar in Chromium to Hidden #mw-panel-toc in Vector-2022 overlaps .vector-page-titlebar in Chromium (can't select title).Feb 23 2023, 12:04 AM

Possible fix:

  1. Make sure #mw-panel-toc contain no whitespace characters by default. Currently it contains \n\t\t.
  2. Add CSS:
#mw-panel-toc:empty {
  display: none;
}

As TheDJ mentioned, easiest to repeat on WD where it probably affects all pages. E.g. https://www.wikidata.org/wiki/Q511778

Note that the element is also in the same place on Firefox (v110). It's just that selection behaves differently on Firefox and on Chrome. In Firefox you cannot select/click from left side of the title (as you click on a transparent element).

Fix in Firefox that can be applied in MediaWiki:Vector-2022.css even:

	#mw-panel-toc:-moz-only-whitespace {
	
	  display: none;
	
	}

Sorry, but it is still there.

  1. https://wikidata.beta.wmflabs.org/wiki/Q383351
  2. hide main menu (if you are logged in)
  3. devtools:
inspect(document.querySelector('#mw-panel-toc'))

❌ the toc is visible over title bar

Lectrician1 renamed this task from Hidden #mw-panel-toc in Vector-2022 overlaps .vector-page-titlebar in Chromium (can't select title) to Hidden #mw-panel-toc in Vector-2022 overlaps .vector-page-titlebar (can't select title).Feb 25 2023, 8:20 PM
Lectrician1 updated the task description. (Show Details)

Change 892567 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Only render TOC related HTML when TOC is available

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

Change 892581 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Remove TableOfContents mustache template and move layout rules to layouts folder

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

Change 892567 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Only render TOC related HTML when TOC is available

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

Change 892581 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Remove TableOfContents mustache template and mark layout rules

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

Edtadros subscribed.

@Jdlrobson I'm trying to recreate this in prod to make sure I'm testing it correctly. Every link I try seems to not have an issue highlighting text. Am I missing something or is this already in enwiki?

@Jdlrobson I'm trying to recreate this in prod to make sure I'm testing it correctly. Every link I try seems to not have an issue highlighting text. Am I missing something or is this already in enwiki?

I am currently unable to reproduce this bug (even while logged out) on any of the pages listed above or on any of the pages in task T329174 that was closed as a duplicate. It may be that other CSS work has, as a side effect, fixed this problem.

For what it's worth, it works in my test cases too (on WP, WS and WD). The element #mw-panel-toc is not in page DOM at all. Thanks 🙂

Edtadros removed ovasileva as the assignee of this task.
Edtadros added a subscriber: ovasileva.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Ventura
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

Go to: https://en.wikipedia.org/wiki/Category:Star_Trek_television_series
Try to select the word category or star in the H1 title, by dragging the across the bottom of the word
✅ AC1: All text should be selectable

Screenshot 2023-03-21 at 2.59.59 PM.png (399×609 px, 56 KB)