Page MenuHomePhabricator

[Minerva TOC] Update long title handling in sticky header
Closed, ResolvedPublic3 Estimated Story Points

Description

From Justin:

The rule is 2 lines then truncate with an ellipsis.

Icons should be vertically centre aligned on the top line of the title. Watch out on the icon spacing because we use a small icon button for the edit affordance and a medium one for the ToC button, so you might have to push down the pencil icon a bit to match.

{F71819576}

{F71819578}

(if above images are not visible - find them here)

From Matthias:

Ideally, we’d have a fixed height for that sticky header:

  • for technical reasons: a variable-length header makes it hard determine when to swap to a new header as people scroll (calculating the position of all headers for every movement is a too intensive task, so we basically rely on intersection updates at specific points, and adding another variable thing in the mix (that we don’t even know the height of until rendered) significantly complicates that)
  • it might also be slightly jarring for users when they’re scrolling to find that the UI suddenly switches to a larger sticky header that then obscures the sentence they were reading near the top of the screen

I’ll fiddle around with this tomorrow to see whether it’s an actual issue or not, but it might be good to think about alternatives just in case.

As for alternatives, the more obvious one would be truncating on a single line.
Or always having a header height enough to accommodate 2 lines, even if it needs only 1.
Or something along the lines of what we’ve currently been working on, where we update the font size if the text doesn’t fit: starting at xx-large, we’ll progressively go down in size until we’re able to fit the text (or truncate it at 2 lines in a small enough font size that fits 2 lines in the smaller header space) - see https://66bd6a1fdc.catalyst.wmcloud.org/wiki/Bernoulli_number?useskin=minerva&mpo=minerva-toc-sticky:treatment&useparsoid=0

I'll fiddle around with this tomorrow = this spike. Let's give it a shot and report back.

Slack thread here

QA notes

To test:

  • open a page with long headings like enwiki's [[International Space Station]] with ?mpo=minerva-toc-sticky
  • ensure all headings either fit on one line or cover 2, with an ellipsis if they would go over
  • ensure that the scroll behavior of the sticky header feels as expected when reaching the in-document headers

Related Objects

Event Timeline

HSwan-WMF moved this task from Incoming/Inbox to Needs Refinement on the Reader Growth Team board.
HSwan-WMF renamed this task from [SPIKE] [Minerva TOC] Update long title handling in sticky header to [Minerva TOC] Update long title handling in sticky header.Wed, Feb 11, 5:36 PM
HSwan-WMF set the point value for this task to 3.

Change #1239102 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/ReaderExperiments@master] Fixed font size, variable header height

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

Change #1239102 merged by jenkins-bot:

[mediawiki/extensions/ReaderExperiments@master] Fixed font size, variable header height

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

I noticed an overlapping issue with the revised long header text behavior.

Problem: the toc overlaps the larger sticky header.
Example: https://en.wikipedia.beta.wmcloud.org/wiki/Spanish_language?mpo=minerva-toc-sticky:treatment

Screenshot 2026-02-12 at 8.17.20 PM.png (306×365 px, 27 KB)

Change #1239316 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/extensions/ReaderExperiments@master] Fix TOC position with variable-height header

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

Change #1239316 merged by jenkins-bot:

[mediawiki/extensions/ReaderExperiments@master] Fix TOC position with variable-height header

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

Etonkovidova subscribed.

Checked with ?mpo=mobile-toc-abc:treatment1

Screenshot 2026-02-23 at 6.36.31 PM.png (1×990 px, 342 KB)
Screenshot 2026-02-23 at 6.36.43 PM.png (1×2 px, 1 MB)

Checked for possible regression on desktop - no issues:

Beforenow
Screenshot 2026-02-06 at 4.47.43 PM.png (598×2 px, 641 KB)
Screenshot 2026-02-23 at 6.37.16 PM.png (900×2 px, 376 KB)

I noticed an overlapping issue with the revised long header text behavior.

Problem: the toc overlaps the larger sticky header.
Example: https://en.wikipedia.beta.wmcloud.org/wiki/Spanish_language?mpo=minerva-toc-sticky:treatment

Screenshot 2026-02-12 at 8.17.20 PM.png (306×365 px, 27 KB)

Screenshot 2026-02-23 at 6.47.10 PM.png (789×380 px, 52 KB)
Screenshot 2026-02-23 at 6.49.41 PM.png (755×382 px, 56 KB)

(click on the gif)

iss_with baby globe TOC3.gif (874×437 px, 1 MB)