Page MenuHomePhabricator

ToC is not shown during Preview when using the standard WikiEditor
Closed, ResolvedPublic

Description

In the current vector-2022, the ToC does not appear during Preview, if I'm using the standard wikitext editor. (i.e. not using the beta-feature "New wikitext mode").
This makes it impossible for me to understand what results my edit will have, until after I Publish it.

User-story:

  • As an editor who is trying to improve the 'structure' of a page, by adding/editing/refactoring/sorting of the ==Headers== and sub-headers.
  • I want to be able to Preview my changes without saving the page.

E.g. If I add the wrong quantity of === on either side of a heading, I can normally detect this during Preview.

Event Timeline

Jdlrobson added a subscriber: Jdlrobson.

Related conversation in T307251. Presumably the solution there will also be applicable here.

Change 802677 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] EditPage: Set sections for new skin TOC when previewing

https://gerrit.wikimedia.org/r/802677

Change 802679 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] Fire new 'wikipage.tableOfContents' hook to update TOC on live preview

https://gerrit.wikimedia.org/r/802679

matmarex added a subscriber: matmarex.

This fixes both the full-page preview and the live preview, both didn't show the table of contents, although the issues were different.

Change 802677 merged by jenkins-bot:

[mediawiki/core@master] EditPage: Set sections for new skin TOC when previewing

https://gerrit.wikimedia.org/r/802677

Change 802679 merged by jenkins-bot:

[mediawiki/core@master] Fire new 'wikipage.tableOfContents' hook to update TOC on live preview

https://gerrit.wikimedia.org/r/802679

(original talk) Two editors of the Italian Wikipedia are experiencing the same, no TOC in Preview mode. They are reporting this as a bug. Getting an idea of the layout before saving the change is described as relevant (similar to T294950#789365 by @Quiddity).

Current state (since July) is that the TOC works correctly if you're using old wikitext editor with live preview disabled. Other scenarios don't work correctly (there's a list in T294950#8196609). I think we should close this task, and continue there.