阅读/网页/桌面版改进/功能/有限制的宽度

This page is a translated version of the page Reading/Web/Desktop Improvements/Features/Limiting content width and the translation is 95% complete.

本项目的主要目标之一是使维基百科和其他维基媒体的维基更加欢迎新来者。 我们的其中一个目标是让阅读文章的体验更舒适。

什么是舒适(或不舒适)的阅读体验? 根据研究,有几个促成因素,其中一个主要因素就是行长。 IBM高级学习中心Peter Orton博士的研究“计算机文本行长影响阅读和学习”的结论是,行长越长,某人阅读并最终学习且保留文本信息就越困难。 在维基百科的文章行长中可以找到其他一些相关的研究,所有这些研究都建议每行40到75个字符。

虽然在维基媒体维基上实现推荐的行长并不是特别容易,但我们将使用最大宽度来限制内容的宽度,以使维基上的大部分文字更接近推荐值。

你可以了解更多关于这个功能背后的研究和考虑

功能描述及要求

该功能的主要功能是限制文章内容的宽度。 然而为了确保页面上的其他元素(即侧栏和头部)不会与内容漂移太远,我们增加了两个额外的容器。 第二个容器确保侧边栏保持靠近内容。 然后为了防止头部与内容和侧边栏漂移得太远,还有第三个容器来限制页眉的最大宽度。

从技术角度来看:大多数页面的内容都被放置在一个最大宽度为960px的内容容器中。 还有两个额外的容器来帮助管理界面其他部分的宽度,如标题和侧边栏:工作区容器(最大宽度为1440px)和页面容器(1650px)。 以下是说明这些容器如何工作的图表。 有些页面的内容受到内容容器的限制,包括历史记录、最近更改和其他类似的日志类型页面。

设计要求及准则

这是一个GIF,说明了当前布局和更新后的布局与上述各种宽度限制的区别。

 
将当前布局与限制内容宽度的更新布局进行比较的GIF。

限制

这里主要的复杂之处在于,某些日志页面,如历史记录和最近更改,由于换行的原因,屏幕越窄将越难以阅读。 因此,我们决定以一种特殊的方式处理这些页面,将它们限制在工作空间容器(1440px)而不是内容容器(960px)中。 这里是一个原型的GIF,显示了在文章页面和相关历史页面之间的切换:

 
在新的Vector布局上显示条目页面与历史页面的宽度的GIF

使用编辑器进行用户测试

我们与多个维基站点的编辑进行了一轮反馈,并与编辑们一起讨论了有限制宽度内容的原型。 我们邀请编辑们对原型进行探索,并使用中央通知横幅提供他们的反馈。 大家对这个功能的感受不一:许多编辑对较短的行长表示赞赏,并认为这个功能创造了更舒适的阅读体验。 一些编辑不喜欢内容周围的空白,认为这是浪费空间。 我们正在平衡所有这些反馈意见和现有的关于行长和阅读舒适度的广泛研究。

目标和动机

Readability

Research

The primary objective is to improve readability of Wikimedia wiki pages. We decided to work on the width of the content area. There are research-based recommendations on this issue.

The popular recommendation is that there should be between 40 and 75 characters per line. The findings of multiple studies conclude that "short line lengths are easier to read". Regarding learning and information retention: "Subjects reading the narrow paragraphs had better retention than those reading the wide paragraphs".[2]

Web Content Accessibility Guidelines (WCAG)

One can find many popular sites that conform to these guidelines.

  • Articles on the online science journal Nature have a max-width resulting in ~76 characters per line.
  • New York Times articles are ~64 characters per line.
  • Times of India articles are ~100 characters (Hindi).
  • Oxford Academic journal articles are ~75.
  • Articles on the World Health Organization’s website are ~96 (Latin alphabet), ~46 (Chinese alphabet), and ~85 (Cyrillic alphabet).
  • When using reading mode in Safari or Firefox text is rendered at ~73 and ~77 characters per line respectively (Latin alphabet).

Comparison with Wikimedia wikis

Currently, an English Wikimedia wiki page on a browser window at 1280px has a character count of ~170 characters per line.[3] That’s at the small end of the screen size spectrum.

On Wikimedia wiki the character count per line grows as the screen width grows. So on the second most popular screen-size, 1920px (21% of users), the character count per line is ~262, more than three times the recommended value.[4]

Why not choose "the simplest" solution

Based exclusively on the recommended line length, it seems like somewhere around 700px is reasonable. Why not limit the width such that we achieve the recommended line length, as other online content sites seem to?

Because our pages are different, and therefore people read them differently.

  • Wikimedia wiki pages are very long, contain a large amount of information, and they are not uniform from one page to the next. As a result, people have a need to skim and search within pages. This is different than linear reading a typical online article or book. This is supported by our research around reading time on Wikipedia.
  • The more narrow we make the content, the longer the page gets. Perhaps the more difficult scanning becomes as well, because it involves more scrolling, etc. For more information regarding different types of online reading, please see this 2006 study conducted by the Nielsen Norman Group.[5]
  • Additionally, it is not straightforward to achieve a specific number of text characters per line. That is because Wikimedia wiki pages contain many elements that are floated inline alongside text.
 
Moon article at 550px wide, uninterrupted paragraph with a character count per line of ~83
 
Moon article at 750px wide, paragraph next to infobox with a character count per line of ~72

Our design must take into account these distinctions.

  • We should limit the width by some amount to accommodate focused/engaged reading. This means shorter line lengths, and less density.
  • At the same time, we should still enable readers to skim and search around, obtaining a visual map of the page without having to scroll too much This is an argument for longer line lengths, and more density.

How do we do that?

Our solution

There are two common experiences we might want to consider.

  1. The top of an article, a paragraph of text situated next to an infobox
  2. The middle of an article, a paragraph with no elements interrupting it

We can consider these two experiences at various widths, counting the character length per line for each:

Content width Paragraph next to an infobox Uninterrupted paragraph
600px ~30 characters per line ~94 characters per line
700px ~59 ~109
800px ~76 ~125
900px ~89 ~142
1000px ~105 ~154

At 1000px wide an uninterrupted paragraph of text is ~154 characters long, just about double the upper limit of the recommended range. Sometimes there are floated elements that are wider than infoboxes, resulting in more narrow columns of text next to them. Also there has not been a max-width. While some editors might edit on narrower screens (or check how pages look on narrower screens) there’s likely content on pages that won’t look great at a narrower width (yet), because it might not have been a consideration (e.g. large tables).

Another approach is thinking about a grid-based layout.[6] This is an approach that aims for both visual harmony on the page, and making decisions about spacing, widths, etc. easier. The Vector skin does not currently use a grid. Something we could do is think about the width of the infobox as a grid column (since they are such common elements), and then use a multiple of that to determine the content width.

 
India article with content at 3x infobox width
 
India article with content at 4x infobox width

Establishing a common reading experience

Introducing a max-width would work towards establishing a common experience. Hopefully, it would be helpful to editors when making decisions about page layouts.

Note: 1024px is mentioned as a minimum size to consider in the WP:Manual of Style/Layout page. That’s not quite the same thing, though.

Currently, an editor might be editing a page at a width of 1500px, while a reader reads it at a width of 1200px. By implementing a max-width, we don’t remove this difference completely. There would still be variation below the fixed-width, for people with narrower screens. However, we would be greatly limiting the range of variation.

Conclusion

After thinking all of that through we’ve come to two conclusions:

  1. It seems that a max-width in the range of 800–1000px is a sensible starting point. We will center the content on the page to ensure that it looks good with the sidebar both open and closed.
  2. It seems worthwhile to conduct a study focusing on the readability of Wikipedia articles specifically. We hope to be able to find the resources to do this.
 
Showing content with a max-width of 960px (sidebar collapsed)
 
Showing content with a max-width of 960px (sidebar open)

Additional notes

A note on breaking templates / content / special pages / etc.

Part of what makes Wikipedia, and other Wikimedia wikis, a powerful tool for sharing knowledge is that there are very few constraints on how information is presented. The result of this is a wide variety of different elements on the pages: tables, image galleries, diagrams, panoramic images, graphs, forms, maps, category boxes, and more. We have dealt with the challenges of designing the mobile site, and got the content to look good. This is why we do recognize that there are going to be some situations where page content doesn’t look great given the max-with. Our plan currently is:

  • Work with our test wiki communities to identify issues and discuss solutions using template styles or other existing tools.
  • Not to implement the max-width on Special pages. Special pages are not intended for “reading”. They often function more as lists or dashboards. Until we have time to work through the details about more responsive layouts for these pages, we will be leaving them alone. Here is an initial prototype of how this would work. You can switch between "View history" and "Read" to get a sense for it: https://di-collapsible-sidebar-5.firebaseapp.com/Tea

Previous conversations

This topic has been discussed in the past.

Please feel free to add additional links to past conversations here.

Full-width toggle

 
The fullscreen toggle

Until October 2022, logged-in users were only able to switch between the limited and full content width using gadgets. According to the English Wikipedians, this was insufficient. We decided to build a toggle. (On the right, you can see a screenshot of this toggle.) It needed to be visible and available to both logged-out and logged-in users. As a result, we have:

  1. Built a preference for logged-in users. It allows for the width to be set across pageviews and wikis. The preference is available in the appearance section of the preferences page (启用有限宽度模式). It may also be set as a global preference.
  2. Built a toggle for logged-in and logged-out users. The toggle is available on every page if the width of the screen is larger than 1400px. Selecting the toggle increases the width of the content area.
    • For logged-in users, the toggle also controls the preference mentioned in 1 above. For example, if you click the toggle on the page and visit your preferences page, you will notice that the enable limited width mode checkbox is unchecked.
    • For logged-out users, initially, the toggle set the width on a per-page basis. This means that after refreshing the page or opening a different page the width would return to the default (limited) state.
    • After making our skin the default on English Wikipedia, we heard concerns about the setting for logged-out users. After coordinating with many teams, we made a change. Since February 2023, all users see the width setting of their choice despite refreshing pages or opening new ones.

Why did the toggle work on a per-page basis initially? This was because in principle, preferences are not available for logged-out users. The lack of preferences for logged-out users doesn't only apply to this skin. (You may learn more about the technical limitations.) We have managed to find a short-term bypass. We have more work to do to make sure this solution may be maintained. We might use a better solution in the future. This could be applied to settings such as font size or dark mode.

参考资料

  1. Size Matters: Balancing Line Length And Font Size In Responsive Web Design
  2. Computer text line lengths affect reading and learning by Peter Orton, Ph.D. IBM Center for Advanced Learning
  3. Why 1280px? As of mid-2020, according to StatCounter, the most common computer screen size is 1366px wide, accounting for 22% of users. Imagining a browser window at nearly full width you end up with ~1280px.
  4. Again, we assume a browser window at nearly full-width.
  5. K. Pernice, K. Whitenton, J. Nielsen, "How People Read Online: The Eyetracking Evidence", 2nd edition
  6. Overview of the topic: Building Better UI Designs With Layout Grids