Page MenuHomePhabricator

Consider user preference for users to control position of table of contents
Open, LowPublic

Description

I'd like to see the Table of Contents floating above content with a little bit of translucency and fixed on the right side of the page (with an overflow to accommodate large TOCs, ensuring the position is beneath the header and not high enough to extend to the footer). (Of course, one should still be able to hide the TOC.)

The rationale:

  1. Table of Contents can be very long, requiring a lot of scrolling by the user if they just wish to start reading (without going through redundant headings).
  2. It can be handy to have scrolled down anywhere and still be able to quickly jump back to another section elsewhere within the article.
  3. It can be nice to get a bird's eye view of the content one is in the midst of reading and an awareness of the position of one's current position within the hierarchy.

I've added some CSS which works for me in all 4 default-available MW skins: https://meta.wikimedia.org/wiki/Help:User_style/floating_Table_of_contents .

One might enhance it further with some JavaScript to highlight the heading in the TOC for the section where one is currently viewing (where one has scrolled).

Event Timeline

Brettz9 created this task.Mar 29 2016, 6:14 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 29 2016, 6:14 PM
matmarex edited subscribers, added: matmarex; removed: Modern, MonoBook, CologneBlue, Vector.Mar 29 2016, 8:02 PM

(It's sufficient to add projects as projects, they don't need to also be subscribers.)

(It's sufficient to add projects as projects, they don't need to also be subscribers.)

@matmarex I believe this is another instance of https://phabricator.wikimedia.org/T130262

Jdlrobson triaged this task as Low priority.Mar 30 2016, 5:08 PM
Jdlrobson added subscribers: Nirzar, JKatzWMF.

@Nirzar @JKatzWMF something to factor into thoughts around table of contents?

Isarra moved this task from Needs triage to Menus on the Vector board.Apr 7 2016, 12:57 AM

Although I think this change would be useful for many people, I think it may better to allow it as an (easily changeable) preference.

One disadvantage it has is that it may block content more easily since it is fixed. While one may collapse it, this will then by default hide subsequent Table of contents which may not be desirable (since it requires another click to enable followed by possibly by another click to collapse it again).

But the advantages mentioned in the original post are also very compelling. Another compromise is to allow the Table of Contents to fit into a sidebar which doesn't float over the content. Of course the disadvantage here is that more space on the side will be occupied, but it at least combines the benefits of both of the other approaches.

In short, I think all three would be desirable to have as available options.

Jdlrobson renamed this task from Table of Contents floating and fixed on right to Consider user preference for users to control position of table of contents.Jan 15 2020, 7:29 PM