Improve how ToC is rendered to allow adding discussion enhancements
Closed, ResolvedPublic

Description

This task involves the work required to improve how the new ToC is rendered to allow adding DiscussionTools enhancements to it.

Requirements

We can add HTML markup to the ToC, and have Vector 2022 display it.

Open questions

  • 1. What – if any – concerns does the Web Team have about implementing the ===Requirements above? See comments from Jon in T305576#7838809.

Testing instructions

Verify that the discussion topic metadata appears in the Vector 2022 table of contents on discussion pages. (see mockups on T309463)

Done

  • Answers to all ===Open questions are documented
  • ===Requirements are implemented

Event Timeline

The old proof-of-concept implementation is here, for reference:

It would still work, but it was meant to go with my proposed implementation for T307251, which might not get merged after all. We might want to wait to see how that is resolved first.

Currently waiting to see what happens in T307251, to avoid having to reimplement this several times if the favored solution for that task changes.

Work on T307251 seems finished, and the solution there seems to work as-is with the old proof-of-concept implementation here. I think we can just promote it to real implementation.

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

[mediawiki/skins/Vector@master] Support additional content in table of contents

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

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

[mediawiki/extensions/DiscussionTools@master] Enhance vector-2022 table of contents

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

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

[mediawiki/extensions/DiscussionTools@master] Enhance vector-2022 table of contents

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

We talked about this in the editing team sync and web team are happy for editing team to review this one.

Requirements

The requirements below are borrowed from what @matmarex proposed in T305576#7846004.

  1. Add a PHP hook in SkinComponentTableOfContents to allow DiscussionTools to add HTML fragments to each ToC line

This ended up not being necessary, we can sneak our additions into the existing ToC data using existing hooks.

  1. Modify Vector to output this

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

  1. Modify the JavaScript API from the previous item to also support this

Done in T307251

Change 773661 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Support additional content in table of contents

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

Change 778316 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Enhance vector-2022 table of contents

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

❓Discussion topic metadata appears in the Vector 2022 table of contents on discussion pages. However, #3 change of the proposed design detailed in T309463 is to Run # of comments on after topic title (read: not on new line). The # of comments is still displayed on a new line. @matmarex am I missing something?

Let me know if the behaviour is expected.

Screenshot 2022-09-01 at 00.25.02.png (1×3 px, 521 KB)

❓Discussion topic metadata appears in the Vector 2022 table of contents on discussion pages. However, #3 change of the proposed design detailed in T309463 is to Run # of comments on after topic title (read: not on new line). The # of comments is still displayed on a new line. @matmarex am I missing something?

Let me know if the behaviour is expected.

Screenshot 2022-09-01 at 00.25.02.png (1×3 px, 521 KB)

Great spot, @EAkinloose.

Per what we discussed during today's standup, we're going to:

  • REVISE the ToC implementation so that the # comment(s) count always appears on a new line, beneath the section heading to which the count is related
  • REMOVE the parentheses that currently surround the (# comment(s)) count
  • CHANGE the language that appears atop the ToC from Contents to Discussions
NOTE: the changes I've named above will happen in T309463.

With T307823#8206958 in mind, @EAkinloose do you think this ticket is Ready for sign off?

With T307823#8206958 in mind, @EAkinloose do you think this ticket is Ready for sign off?

We are all good 👌🏿