=== Deployment plan
- [x] @matmarex to announce change on pl.wiki sometime this week
-- Done in T314714#8420500
- [x] Tuesday, 29 Nov: @matmarex to backport this change to pl.wiki on **Tuesday, 29 Nov**
- [x] Monday, 5 Dec: [Group 0](https://wikitech.wikimedia.org/wiki/Deployments/Train#Groups)
- [ ] TBD: [Group 1](https://wikitech.wikimedia.org/wiki/Deployments/Train#Groups)
-- //Pending Tech/News announcement//
- [ ] TBD: Group 2 minus en.wiki
- [ ] TBD: en.wiki
=== Tech/News Copy
//"Wikis where [DiscussionTools](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:DiscussionTools) are enabled will see the markup DiscussionTools uses to [show discussion metadata beneath section headings](https://www.mediawiki.org/wiki/Talk_pages_project/Usability#Phase_1:_Topic_containers) will be inserted after these headings, not inside of it. Gadget authors and maintainers: please see [T314714](https://phabricator.wikimedia.org/T314714) for details."//
Comparison of the HTML output for reference is below. Note that the `ext-discussiontools-init-section-bar` element is only visible for users who have enabled the DiscussionTools beta feature, but it is always included in the HTML.
```lang=html, name=BEFORE
<h2 class="ext-discussiontools-init-section">
<span class="ext-discussiontools-init-section-subscribeButton ..." ...>...</span> <!-- Only included if topic subscription is enabled -->
<span class="ext-discussiontools-init-section-subscribe mw-editsection-like">...</span> <!-- Only included if topic subscription is enabled -->
<span class="mw-headline" ...>
Heading text
</span>
<span class="mw-editsection">...</span>
<div class="ext-discussiontools-init-section-bar">
...
</div>
</h2>```
```lang=html, name=AFTER
<div class="mw-heading mw-heading2 ext-discussiontools-init-section">
<span class="ext-discussiontools-init-section-subscribeButton ..." ...>...</span> <!-- Only included if topic subscription is enabled -->
<h2>
<span class="ext-discussiontools-init-section-subscribe mw-editsection-like">...</span> <!-- Only included if topic subscription is enabled -->
<span class="mw-headline" ...>
Heading text
</span>
<span class="mw-editsection">...</span>
</h2>
<div class="ext-discussiontools-init-section-bar">
...
</div>
</div>```
---
I saw a link to https://www.mediawiki.org/wiki/Talk:Reading/Web/Desktop_Improvements#"Beginning"_is_confusing and browsed to it anonymously. For me, the current markup that DiscussionTools exposes for heading metadata is this:
```
<h2 class="ext-discussiontools-init-section"><!--__DTSUBSCRIBEBUTTONDESKTOP__h-Sdkb-2022-04-27T22:42:00.000Z--><!--__DTSUBSCRIBELINK__h-Sdkb-2022-04-27T22:42:00.000Z--><span id=".22Beginning.22_is_confusing"></span><span class="mw-headline" id=""Beginning"_is_confusing" data-mw-comment="{"type":"heading","level":0,"id":"h-\"Beginning\"_is_confusing-2022-04-27T22:42:00.000Z","replies":["c-Sdkb-2022-04-27T22:42:00.000Z-\"Beginning\"_is_confusing","c-132.170.199.112-2022-06-22T19:32:00.000Z-\"Beginning\"_is_confusing"],"headingLevel":2,"name":"h-Sdkb-2022-04-27T22:42:00.000Z"}"><span data-mw-comment-start="" id="h-"Beginning"_is_confusing-2022-04-27T22:42:00.000Z"></span>"Beginning" is confusing<span data-mw-comment-end="h-"Beginning"_is_confusing-2022-04-27T22:42:00.000Z"></span></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Talk:Reading/Web/Desktop_Improvements&action=edit&section=11" title="Edit section: "Beginning" is confusing">edit</a><span class="mw-editsection-bracket">]</span></span><div class="ext-discussiontools-init-section-bar"><div class="ext-discussiontools-init-section-metadata"><span class="ext-discussiontools-init-section-metaitem ext-discussiontools-init-section-timestampLabel">Latest comment: <a href="#c-OVasileva_(WMF)-2022-07-11T13:58:00.000Z-Sdkb-2022-07-06T17:16:00.000Z">26 days ago</a></span><span class="ext-discussiontools-init-section-metaitem ext-discussiontools-init-section-commentCountLabel">9 comments</span><span class="ext-discussiontools-init-section-metaitem ext-discussiontools-init-section-authorCountLabel">6 people in discussion</span></div><div class="ext-discussiontools-init-section-actions"><!--__DTSUBSCRIBEBUTTONMOBILE__h-Sdkb-2022-04-27T22:42:00.000Z--></div></div></h2>
```
Though you might not have known this, this markup makes it so every heading is being read out like this in assistive technologies:
```
"Beginning is confusing" [edit] Latest comment: 26 days ago 9 comments 6 people in discussion
```
While logged in at https://www.mediawiki.org/wiki/Talk:Reading/Web/Desktop_Improvements?dt-enable=1&safemode=1#"Beginning"_is_confusing it's even worse:
```
<h2 class="ext-discussiontools-init-section"><span class="ext-discussiontools-init-section-subscribeButton oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-frameless oo-ui-iconElement oo-ui-labelElement oo-ui-flaggedElement-progressive oo-ui-buttonWidget" id="ooui-php-11" data-ooui="" data-mw-subscribed="null"><a class="oo-ui-buttonElement-button" role="button" title="Subscribe to receive notifications about new comments." tabindex="0" rel="nofollow"><span class="oo-ui-iconElement-icon oo-ui-icon-bellOutline oo-ui-image-progressive"></span><span class="oo-ui-labelElement-label">Subscribe</span><span class="oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator oo-ui-image-progressive"></span></a></span><span class="ext-discussiontools-init-section-subscribe mw-editsection-like"><span class="ext-discussiontools-init-section-subscribe-bracket">[</span><a href="" class="ext-discussiontools-init-section-subscribe-link" role="button" tabindex="0" title="Subscribe to receive notifications about new comments.">subscribe</a><span class="ext-discussiontools-init-section-subscribe-bracket">]</span></span><span id=".22Beginning.22_is_confusing"></span><span class="mw-headline" id=""Beginning"_is_confusing" data-mw-comment="{"type":"heading","level":0,"id":"h-\"Beginning\"_is_confusing-2022-04-27T22:42:00.000Z","replies":["c-Sdkb-2022-04-27T22:42:00.000Z-\"Beginning\"_is_confusing","c-132.170.199.112-2022-06-22T19:32:00.000Z-\"Beginning\"_is_confusing"],"headingLevel":2,"name":"h-Sdkb-2022-04-27T22:42:00.000Z"}"><span data-mw-comment-start="" id="h-"Beginning"_is_confusing-2022-04-27T22:42:00.000Z"></span>"Beginning" is confusing<span data-mw-comment-end="h-"Beginning"_is_confusing-2022-04-27T22:42:00.000Z"></span></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Talk:Reading/Web/Desktop_Improvements&action=edit&section=11" title="Edit section: "Beginning" is confusing">edit</a><span class="mw-editsection-bracket">]</span></span><div class="ext-discussiontools-init-section-bar"><div class="ext-discussiontools-init-section-metadata"><span class="ext-discussiontools-init-section-metaitem ext-discussiontools-init-section-timestampLabel">Latest comment: <a href="#c-OVasileva_(WMF)-2022-07-11T13:58:00.000Z-Sdkb-2022-07-06T17:16:00.000Z">26 days ago</a></span><span class="ext-discussiontools-init-section-metaitem ext-discussiontools-init-section-commentCountLabel">9 comments</span><span class="ext-discussiontools-init-section-metaitem ext-discussiontools-init-section-authorCountLabel">6 people in discussion</span></div><div class="ext-discussiontools-init-section-actions"></div></div></h2>
```
which resolves to
```
Subscribe \"Beginning\" is confusing[edit] Latest comment: 26 days ago 9 comments 6 people in discussion
```
While some metadata might not seem as too much on one heading, it would certainly become a lot if every heading on the page is like this. Many users of assistive technologies use a list of headings to navigate the page, so [[ https://www.w3.org/WAI/WCAG21/Understanding/headings-and-labels | they should be clear and concise ]] (WCAG 2.1 criterion 2.4.6) about what each section represents. Usually, discussion authors try to keep them short and indicative of what a discussion is about. A bunch of metadata does not belong in every heading that would be exposed to assistive technologies. In addition, I was pointed by @Jack_who_built_the_house to MDN that says that [[ https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements | heading elements are only supposed to have ‘Phrasing content’ ]], which [[ https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#phrasing_content | does not include <divs> ]].
If you want to make this a unified block, wrapping it in a `<div>` wrapper block instead would be better, as well as trying to fix whatever problems that have caused this usage in the first place. Abusing heading markup like this is a bad precedent.
---
//This issue emerged in a conversation at en.wiki here: https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#c-Whatamidoing_(WMF)-20220913225300-DiscussionTools_Beta_Feature_update .//