Page MenuHomePhabricator

suppress TOC sidebar by default on zhwikinews main namespace
Open, MediumPublic

Assigned To
None
Authored By
Kitabc12345
Jan 25 2024, 12:21 PM
Referenced Files
F57577100: image.png
Oct 1 2024, 10:50 AM
F57577077: image.png
Oct 1 2024, 10:48 AM
F57576964: image.png
Oct 1 2024, 10:42 AM
F57577012: IMG_3656.PNG
Oct 1 2024, 10:42 AM
F57577010: IMG_3658.PNG
Oct 1 2024, 10:42 AM
F57577000: IMG_3654.PNG
Oct 1 2024, 10:42 AM
F57577002: IMG_3653.PNG
Oct 1 2024, 10:42 AM
F57577001: IMG_3655.PNG
Oct 1 2024, 10:42 AM

Description

The zhwikinews community believes that there is no need for the TOC affecting the browsing experience on the news page (i.e., the main namespace). It is hoped that the TOC can be suppressed in the main namespace from the software level by default.


Original task content:

Is technical implementation feasible? The local community expressed strong support in the Telegram group.

image.png (1×1 px, 313 KB)
To avoid any misunderstanding, the term '目錄' refers to the section on the left-hand side of the news page, which includes '目次' (Table of Contents), '隱藏' (Hide), '序言' (Introduction), and '消息來源' (Sources) in Chinese. The left-hand side table of contents is not useful for Wikinews articles. So they want to turn off the left-hand menu on all main pages on Vector (2022) by default for everyone on zhwikinews, including readers.

Event Timeline

SunAfterRain renamed this task from Default closed menus on Vector (2022) for zhwikinews main pages to suppress TOC by default on zhwikinews main namespace .Jan 25 2024, 2:37 PM
Func subscribed.

The main issue is that vector 2022 would display a TOC no matter there are more than 3 sections or not.

Jdlrobson added subscribers: cscott, Jdlrobson.

@cscott is there a way to globally suppress the table of contents on a project-level in the parser? It seems like that would be the logical thing to do here to resolve this ticket. Vector 2022 would then just work without hacky workarounds.

This request is to ask about suppress the table of contents on a namespace-level afaik.

Could you just do this with site css -- MediaWiki.css could contain the rule:

.mw-table-of-contents-container { display: none }

and everything would Just Work, right? If you only want this on main namespace changes you could probably do this dynamically with a Gadget instead.

If you wanted to do it on a project level, you could install a very simple extension on the project which used the ArticleParserOptions hook, and use ParserOptions::setSuppressTOC(). That could also be namespace-specific:

	public function onArticleParserOptions(
		Article $article, ParserOptions $popts
	) {
             if ($article->getTitle() ... finish the namespace check here ....) {
                 $popts->setSuppressTOC();
            }
       }

A rough translation of the original user request:

Default closed directory

Default main page directory: Default closed menus on Vector (2022) for zhwikinews main pages. Is technical implementation feasible?

I checked Russian Wiki News or Wiki News in other languages. Their new skin will close the directory when browsing news reports. I think this is suitable for deployment on this site, because the news report pages of Wiki News do not need a directory. In addition, even if there is a directory, it can be replaced by a related template. There is no need to open this directory and it can be hidden by default, which can make it easier to display the report text. There is no need to display this redundant directory, because all current report directories only have news sources. , and then it disappears. In fact, it has no purpose, and in the old version, no directory will be displayed in this case. A strong reason is to hide the directory on the left, which can display more text content, make the news experience richer, and provide a better browsing experience on platforms such as iPad or computers without the need to display this redundant Things hinder the proportion of the interface, because all news reports only have the title of source in the table of contents; even if the news report has a title, there is no need to have a left column of the title (new version of the skin) to display it. There is also a table of contents template that can be used instead. Because this greatly hinders the browsing experience of news reports, the design of this directory is only suitable for Wikipedia. News reports do not need to do this. News reports rarely use clicks in the directory. Usually the subtitles are simply displayed, and there is no need to have a directory. Click on it. But I don’t know how he implements this issue, and now I’m asking for everyone’s opinions. I support it. Kitabc12345 (leave a message) January 13, 2024 (Saturday) 05:29 (UTC)

In addition, I hope there is technology that can make it easier to fill in the source template, because most news websites can actually easily get the title and what organization it comes from. In fact, maybe there can be tools developed to make it faster? Kitabc12345 (leave a message) January 13, 2024 (Saturday) 05:34 (UTC)

(+) Support closing directories under all skins. Zhuofan WuCien años de soledad February 5, 2024 (Monday) 13:06 (UTC)

We should get some clarity about exactly what's required -- there are three points from the original request that I think are being lost here:

  • "I checked Russian Wikinews or wikinews in other languages" -- if this is already being done for other wikinews sites we should figure out how/what they are already doing. If it's already being done elsewhere then it's "technically feasible" for sure.
  • "A strong reason is to hide the directory on the left, which can display more text content" -- removing the ToC is not going to remove the left sidebar, which seems to be what's asked for here. And in fact the left sidebar is already removed when the device width is narrow enough, so the desired feature may already be present for "platforms such as iPad".
  • "close the directory" - the vector 2022 skin has a "hide" button next to the ToC, which moves it up to the heading bar (and then a corresponding "move to sidebar" button which moves it back). It may be that what is requested is not removing the ToC entirely but just starting with it in the default "heading" location, not in the "sidebar" location.

I don't know about the technical feasibility of the second two points here -- defaulting to the "narrow screen" layout with sidebar suppressed, or starting with the TOC in "heading" location. But I'm also not 100% certain about what is being asked for, so it's worth clarifying further.

ovasileva triaged this task as Medium priority.Apr 4 2024, 9:05 AM
在T355878#9525307中,@cscott写道:

We should get some clarity about exactly what's required -- there are three points from the original request that I think are being lost here:

  • "A strong reason is to hide the directory on the left, which can display more text content" -- removing the ToC is not going to remove the left sidebar, which seems to be what's asked for here. And in fact the left sidebar is already removed when the device width is narrow enough, so the desired feature may already be present for "platforms such as iPad".

I found that on both a 1920x1080 computer and all iPad models, the left sidebar is not removed. On the iPad, whether in landscape or portrait mode, it affects the text of the news report. I really can't see such a strange situation on any news website; all the text is densely packed together. .What’s even more frustrating is that the left sidebar has no effect on zh.wikinews because it only displays the table of contents, but news reports do not need a table of contents on any media website. For example one:

image.png (889×1 px, 1 MB)
iPad Air 4
image.png (1×1 px, 993 KB)
image.png (1×1 px, 962 KB)
image.png (1×1 px, 928 KB)
image.png (1×1 px, 1 MB)
image.png (1×1 px, 988 KB)
1920x1080 computer

Moreover, I found that when not logged in, there is also a right sidebar. Most news readers do not log in to Wikinews, and this situation is particularly evident on the iPad. The presence of the right sidebar alongside the left sidebar, which left sidebar has no useful in Wikinews, is even more of a disaster. Even if there are no subsection titles, the paragraphs will not display too much. Even if Wikinews has subsections, there is no need to display them in the left sidebar, as no media outlets like BBC, CNN, ABC, NBC, New York Times, Associated Press, Reuters, Wall Street Journal, etc., do this.

IMG_3652.PNG (2×1 px, 2 MB)
IMG_3655.PNG (1×2 px, 808 KB)
IMG_3653.PNG (1×2 px, 2 MB)
IMG_3654.PNG (1×2 px, 3 MB)
IMG_3658.PNG (1×2 px, 3 MB)
IMG_3656.PNG (2×1 px, 2 MB)
iPad Air 4
image.png (1×1 px, 1016 KB)
image.png (1×1 px, 928 KB)
image.png (1×1 px, 873 KB)
1920x1080 computer

  • "close the directory" - the vector 2022 skin has a "hide" button next to the ToC, which moves it up to the heading bar (and then a corresponding "move to sidebar" button which moves it back). It may be that what is requested is not removing the ToC entirely but just starting with it in the default "heading" location, not in the "sidebar" location.

Starting with the TOC in the 'heading' location is the solution we expect; in short, we do not want a left sidebar. However, the display of the table of contents is not useful in Wikinews; it only has an effect in Wikipedia and other encyclopedias. News articles do not need a table of contents. Because left sidebar only displays the table of contents, but news reports do not need a table of contents on any media website. Moreover, almost all report pages in all languages of Wikinews only have a single title called 'Source,' which seems to have little display significance in the left sidebar. Subsection titles, such as 'Interview,' only appear in very rare cases. However, there is still no need for a table of contents for browsing information like in an encyclopedia, even if there are subsection titles, because no one reads news articles that way. Other media websites, even if they have subsection titles, are designed for scrolling down, not for functionality like Wikipedia. Moreover, if the text content of the page is very brief, the title 'Source' can even be displayed without scrolling down, making the left sidebar title completely unnecessary.

I don't know about the technical feasibility of the second two points here -- defaulting to the "narrow screen" layout with sidebar suppressed, or starting with the TOC in "heading" location. But I'm also not 100% certain about what is being asked for, so it's worth clarifying further.

I’m curious why it is marked as 'Blocked on development.' Does this code apply to visitors based on the new issues I mentioned above?

在T355878#9525261中,@cscott写道:

Could you just do this with site css -- MediaWiki.css could contain the rule:.......

Kitabc12345 renamed this task from suppress TOC by default on zhwikinews main namespace to suppress TOC sidebar by default on zhwikinews main namespace .Oct 1 2024, 11:05 AM

It sounds like there are multiple needs here - but perhaps this task should begin with the ability disable the table of contents across all skins. This currently is not supported but would likely need to be done via a new configuration flag that applies globally to all skins. It doesn't make sense to make a Vector 2022 only change for this feature.

To @cscott's point this will not remove the sidebar so we should continue discussing what the actual problem is here given the sidebar contains useful links.