Background
A main goal of the Desktop Improvements project is to make frequently used tools more accessible to readers and editors. One of the most crucial of these tools is the table of contents (ToC), which is responsible for providing both contextual insight and navigation.
Currently, the ToC is only available at the top of the page, limiting its usefulness. We plan to make it a persistent element, available throughout the page. Our goal is to make it easier for readers and editors to reach the ToC, gain context, and navigate throughout the page without needing to scroll all the way to the top.
Sign off steps
When signing off please make sure
- That the styles for the old table of contents are no longer being shipped in production. In particular ResourceLoaderSkinModule should set the toc feature to false (https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/ /753545/4/skin.json)
Use Cases
As a reader or editor, I want the ability to gain context (content and structure) about the page I am about to read
As a reader or editor, I want the ability to reference the next few sections in the page at any location in the page so that I can choose what to read next
As a reader or editor, I want the ability know how many sections a page has without having to scroll all the way up
Feature description and requirements
The table of contents will appear persistently on one side of the page. This table of contents will contain all sections and sub-sections available in previous versions of the ToC.
The ToC will contain the following functionality:
- Collapsible sub-sections - for users that only want to view the highest level of section heading
- Active section styling - the active section (i.e. the section currently in view) will be styled differently than the other sections. Users will be able to identify where on the page they are currently located.
- Navigation - selecting a section within the table of contents will navigate to the appropriate section within the page
- For screen widths smaller than 1000px, the ToC will collapse and the section titles will be used as a ToC
Mediawiki Page
https://www.mediawiki.org/wiki/Reading/Web/Desktop_Improvements/Features/Table_of_contents
Previous Research
Based on the research we conducted (link to research) we plan to implement a persistent table of contents on Article pages (and possibly other namespaces in the future).
Latest prototypes
Tall/collapsed ToC: https://di-article-tools-da959.web.app/Humpback_whale
Short/expanded ToC: https://di-article-tools-da959.web.app/Cetacean_surfacing_behaviour