User-stories
- As a user, I want to understand the structure of a File-page at a glance.
- As a user, I want to be able to easily navigate to a section within a File-page. – E.g. the section "File usage on other wikis".
- As a user, I want to be able to easily send a #section link to someone. – E.g. the same as above.
Context/Problem
At Commons, there are 2 automated systems for showing a "Table of Contents" (ToC), with some of the Headings on File pages. Both of them are missing some Headings:
The Vector-2022 ToC:
- Doesn't include any of the filetoc headings
- Doesn't include the Structured Data headings
The automatic "filetoc"
- Doesn't include any manually-written ==Headings==
- Doesn't include the new Structured Data headings/tabs
- Doesn't work with gadgets (if the gadgets/scripts identify headings based on the standard CSS-class).
- [E.g. mediawiki-wiki's gadget-vector-headanchor (and others) - or - external userscript linkify-header-script.user.js - all of which show anchor-links on mouseover of headings, and work by detecting the CSS-class mw-headline.]
- Are not visible in the automated "filetoc" bar unless we click the red "x" to "Remove" (hide) the reuse-links. E.g.
Examples
We cannot directly navigate to the "File history" section from any of these links:
- A file with 2 manually created Headings:
- A file without any manual Headings:
Full list of headers to consider
(Using their English-labels)
- filetoc:
- File
- File history
- File usage on Commons
- File usage on other wikis
- Structured Data:
- File information
- Structured data
- Any manually created headers
- …
Screenshot
Screenshot showing
- (a) the "File history" header is missing from the Vector-2022 ToC, and
- (b) that header is lacking the class="mw-headline" (which all manually-created ==Headers== have)
See also
- T169358: Make the filetoc on Commons automatically populate with section links to existing section on page
- (That task has significant overlap, but I think it might be distinct enough to be separate? That task is about changing the auto-generated "filetoc", and this is more about the entire set of headings. But merge freely if it helps get things resolved!)
Proposed solution
? (research?)














