Page MenuHomePhabricator

Restrict sticky header to one line only regardless of length
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

See T289814: Sticky header: Add article title to sticky header for more context. Currently the sticky header allows the title to take multiple lines within the sticky header. We would like to restrict this and ensure title only stays to one line

Replication steps

  1. Visit https://de.wikipedia.org/wiki/Rindfleischetikettierungs%C3%BCberwachungsaufgaben%C3%BCbertragungsgesetz?useskinversion=2&vectorstickyheader=1
  2. Scroll down to see sticky header
  3. Notice that "Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz" takes up more than one line in the sticky header

Acceptance Criteria

  • Ensure all page titles are limited to one line

Developer notes

<wbr> tags can appear within the page title which can cause the text to wrap. Applying whitespace: nowrap does not work consistently across browsers with the wbr tag. However, hiding the wbr tag with CSS, seems to work:

// Prevent text from wrapping in the sticky header.
.vector-sticky-header-context-bar-primary wbr {
  display: none;
}

QA steps

  • Edit the source of an article with a long title to add <wbr> tags interspersed throughout the title like so:
{{DISPLAYTITLE:Rindfleischetikettierungs<wbr>überwachungsaufgabenübertragungsgesetz<wbr>leischetikettierungsüberwachung}}
  • View the page in modern vector and scroll to see sticky header - title should not wrap but get cut off with ellipsis

QA Results - Beta

ACStatusDetails
1T300134#7732774

QA Results - Prod

ACStatusDetails
1T300134#7740486

Event Timeline

this might be resolved by T298885

example local screenshot:

Screen Shot 2022-02-04 at 11.02.08 AM.png (1,988×776 px, 383 KB)

With the T298885 patch, I'm still noticing the issue:

Screen Shot 2022-02-04 at 12.13.53 PM.png (5,040×2,350 px, 1 MB)

The wbr tags that can be in the text are problematic as they can force the text to span more than two lines

Change 763865 had a related patch set uploaded (by Clare Ming; author: Clare Ming):

[mediawiki/skins/Vector@master] Fix long titles with wbr tags in sticky header

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

Change 763865 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Fix long titles with wbr tags in sticky header

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

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

Edit the source of an article with a long title to add <wbr> tags interspersed throughout the title like so:
{{DISPLAYTITLE:Rindfleischetikettierungs<wbr>überwachungsaufgabenübertragungsgesetz<wbr>leischetikettierungsüberwachung}}
View the page in modern vector and scroll to see sticky header - title should not wrap but get cut off with ellipsis

Screen Recording 2022-02-23 at 9.23.08 AM.mov.gif (1,192×332 px, 752 KB)

Edtadros subscribed.

Test Result - Prod

Status: ✅ PASS
Environment: dewiki
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

Edit the source of an article with a long title to add <wbr> tags interspersed throughout the title like so:
{{DISPLAYTITLE:Rindfleischetikettierungs<wbr>überwachungsaufgabenübertragungsgesetz<wbr>leischetikettierungsüberwachung}}

Screen Shot 2022-02-27 at 9.16.31 PM.png (1,089×180 px, 34 KB)

✅ AC1:View the page in modern vector and scroll to see sticky header - title should not wrap but get cut off with ellipsis
Screen Shot 2022-02-27 at 9.17.50 PM.png (1,058×256 px, 118 KB)

Screen Shot 2022-02-27 at 9.17.37 PM.png (1,209×361 px, 173 KB)