Reading/Web/Desktop Improvements/Features/Table of contents/ja

デスクトップ版の改善プロジェクトの主な目標は、よく使われるツールに読者や編集者がよりアクセスしやすくすることです. 最も重要なツールのひとつが目次（Table of contents＝ ToC）です. この機能が果たす重要な役割が2つあります. 文脈について情報を与え、ページ内を移動することができるようにします.

現在のところ、目次はページの上部でのみ利用可能であり、有用性が限られています. 目次を常駐させてページ全体を通して利用可能にすることを計画しています. 目標は読者および編集者が目次により簡単に到達できるようにすることです. より簡単に文脈を把握できるようにし、上部へスクロールする必要なくページ全体を移動できるようにしたいと考えています.



背景と目標
We would like the interface, including the navigation elements, to be easier to use. So far, we have built a collapsible sidebar and a sticky header. Now, we are preparing a new ToC.

Currently:


 * The current ToC is available only at the top of the page. It is difficult to regain context and navigate within the page without having to scroll all the way up
 * For pages with a long lead/intro section, the ToC is not visible until you scroll down a bit
 * Users use the ToC to create a mental model of the page. This is similar to the role of the introduction to the page. Users learn what the page contains, how long may be, what parts may be the longest, etc. This becomes lost without the ability to reference the ToC more frequently
 * The ToC creates a lot of unused space in the content area. That space could be used for displaying content and other functionality

The new, persistent table of contents will make it easier for readers to


 * Understand the context of the page
 * Navigate to different parts of the page without having to scroll to the top of the page every time they want to access the table of contents



使用事例

 * 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



機能の説明と要件
The table of contents will appear persistently on one side of the page. It 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
 * Section bolding - the section currently on the page will be displayed as bold. Users will be able to identify where on the page they are located by noting the bolding within the ToC
 * 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





試作品
General ToC functionality: https://en-toc.wmcloud.org/wiki/Moon

Collapsible section functionality: https://di-toc-collapsible-sections.web.app/Aretha_Franklin



定性的テスト


読者および編集者のユーザーテスト
目次のユーザーテストを読者および編集者で実施しました. テストは3か所（アルゼンチン、ガーナ、インドネシア）で、異なる言語で行われました. The participants were asked to interact with different versions of a persistent table of contents. Their task was to give feedback on their preferred version. The test also included an open study of the way readers and editors saw and used the table of contents.

All users found the table of contents to be essential to the reading experience. They needed it for both navigational purposes as well as for setting the context for the page.

Main observations:


 * Testers preferred persistent access. Across all tests, the best prototype was the persistent one
 * Testers preferred having more information. Prototypes that contained all sections and subsections gained more positive opinions
 * Testers did not want the ToC to overlap the content. Even in the cases where it was supplementary to the main ToC at the top of the page
 * Testers liked getting a sense of location within the page. They noted that additions like bolding the title or the section helped with their orientation

The results of the test were used to select the best prototype. Next, we worked on it to better fit the needs of the participants. See the full results of this test.



編集者対象の試用品テスト
2021年12月、30ウィキにわたりログイン利用者で試作品テストを実施しました. 目次の使いやすさと機能性についてフィードバックを集めることを意図してテストを設計しました. 大多数のフィードバックは肯定的でした. Most community members like the new location and functionality of the table of contents, and support the change.



定量的テスト
目次の現在のバージョンと新しいバージョンの機能性を比較するA/Bテストを実施する予定です.

主な疑問：


 * 1) 旧来の目次と比べると新しいほうはもっと頻繁に使われているかどうか
 * 2) ページの冒頭に画面をスクロールして戻る必要は、新しい目次によりニーズが減ったかどうか
 * 3) 利用者が画面をスクロールする回数や速さ※は、新しい目次により減ったかどうか（※＝データ取得が可能なら）
 * 4) 新しい目次とページ閲覧時間の変化

FAQ
The table of contents feature is still in active development.

Why doesn't the table of contents doesn't work well on my mobile device or when I resize the browser?
Users on mobile and resized browsers account for a small fraction of page traffic, so because of this we prioritized building the feature for the majority of our users first. For narrow screens we plan to make the table of contents available as a sticky interface element that's accessible from anywhere in the page. This is being built as part of https://phabricator.wikimedia.org/T306660 with a current release date of early August 2022.

Note what is displayed to mobile devices differs from what you see when you resize your browser. On mobile devices, the site is currently presented as a zoomed out version of the desktop site.

Why can't I collapse the table of contents?
The feature is still in development. We plan to make it possible to collapse the table of contents. This will be handled in https://phabricator.wikimedia.org/T307901.

Why doesn't it appear when I complete an edit?
The feature is still in development. This will be fixed in https://phabricator.wikimedia.org/T307251 with a planned timeline of end of August 2022.

How can I get the old table of contents?
We intentionally do not add the old table of contents to the article in addition to the new sidebar location. This is because it increases the overall size of HTML that is shipped to clients, increases the storage requirement for our parser cache, and requires additional CSS to render. It's a trade off we've taken to reduce the work involved maintaining the code and keeping the site optimized.

Users can restore the old table of contents position with the following JavaScript code:

How do magic words work with this feature?
The magic word will not work in Vector 2022 as the table of contents is always in the sidebar and this cannot be changed. However magic words relating to presence of table of contents will continue to work i.e. an article can disable the default table of contents and apply its own if necessary.

All magic words will continue to work for other skins which render the table of contents within the article.

I can't see the table of contents when the sidebar is open on tablet/mobile device
This is a known problem for now. The sidebar should be closed by default unless you opened it, so this issue should only impact logged in users who have opened the sidebar. On the long term, we plan to reduce the size of this menu, and make the sidebar overlay content. Details and a prototype of how that will look can be found in T302073. This change is planned in the latter part of 2022, and further information can be found on Reading/Web/Desktop_Improvements/Features/Page_tools (October-December).