Enable Reply Tool to adapt to indentation syntax used at ru.wiki
Closed, ResolvedPublic

Description

This task involves the work with making it so the Reply Tool uses the indentation Senior Contributors at ru.wiki expect.

Background

T252708 makes it so the Reply Tool uses a consistent character ( :) for indenting all comments posted with it. This task is about adjusting how the Reply Tool behaves at ru.wiki such that it instead uses * to indent comments posted with it.

Implementation details

  1. At ru.wiki:
    • The Reply Tool will, by default, indent comments posted with it using *
  2. For the behavior described in "1." to be adjusted, a config change would need to be made. Read: adjusting the behavior described in "1." will NOT happen via a MediaWiki:message.

Open questions

Done

  • Answers to all ===Open questions are documented
  • The behavior described in the ===Implementation details section above is implemented

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

@Jack_who_built_the_house, the team's wondering whether this should be handled as a config change (have to get a dev if you want to change it) or as a MediaWiki: message, which could be changed locally by any interface-admin. This might only be used at ruwiki, so I'd like to know what you recommend.

For ruwiki, I don't see much difference, as this value is unlikely to change. But I doubt this won't be used in other projects, since at least there are Russian projects other than Wikipedia that will likely use the same indentation, and that could also be the case for wikis in languages of Russia and CIS countries, since many of them have the same users and customs. But honestly I'm a rare guest there, and I don't know which indentation is used where. So, perhaps it would be easier for them to edit a MediaWiki message? I don't know.

On the other hand, I'm not sure this setting is at all suitable for MediaWiki messages. First of all, I doubt that any alternatives to * and : exist. Does any wiki count comments and start them with #? I would be surprised if it does.

BTW, one more thing. In ruwiki, there is a solid custom to put a space after indentation characters. We write

* Comment
: Comment

not

*Comment
:Comment

Could this be configurable too?

In Convenient Discussions, there is also a third setting that determines whether a new comment at the first level should repeat the previous comment's indentation style ('mimic' mode) or should the script use the default indentation char in all cases ('unify' mode).

Maybe DiscussionTools will have some of the mentioned or other settings. And I guess it's better to have all of them in one place. And not necessarily all of them will be suitable for MediaWiki messages.

But maybe I'm overcomplicating things and the devs will decide it's simpler to have a MediaWiki message or two.

I am removing this ticket from the Editing Team's current workboard because:

  1. Work on this ticket will likely be prioritized as part of making the Reply Tool available as an available-by-default feature at all projects (T262331)
  2. Work on "1." is blocked by T280599
  1. Work on this ticket will likely be prioritized as part of making the Reply Tool available as an available-by-default feature at all projects (T280599)

You mean T275256?

  1. Work on this ticket will likely be prioritized as part of making the Reply Tool available as an available-by-default feature at all projects (T280599)

You mean T275256?

Ah, good catch – thank you for saying something. I meant T262331. T259864#7226156 should now be accurate.

ppelberg renamed this task from Enable wikis to customize the syntax used to indent comments posted with Reply Tool to Enable Reply Tool to adapt to indentation syntax used at ru.wiki.EditedJan 10 2022, 6:40 PM
ppelberg updated the task description. (Show Details)

Path Forward
In a meeting the Editing Team had on 15-Dec-2021, we came to think a good first step would be to implement an approach similar to the mimic mode @Jack_who_built_the_house described in T259864#6931828.

Doing the above would mean all new comments people people using the Reply Tool at ru.wiki would be indented using * EXCEPT in cases where the comment being responded to was indented with an :. In this latter case, the Reply Tool would indent the comment being posted with a colon.

We think this approach will increase the likelihood that the Reply Tool will indent comments with syntax Senior Contributors will expect without introducing the number of things Juniors will need to think about/question when drafting comments.

I've updated the task description's ===Implementation Details section with the above.

In a meeting the Editing Team had on 15-Dec-2021, we came to think a good first step (see "Thinking" below) would be to implement an approach similar to the mimic mode @Jack_who_built_the_house described in T259864#6931828.

Doing the above would mean all new comments people people using the Reply Tool at ru.wiki would be indented using * EXCEPT in cases where the comment being responded to was indented with an :. In this latter case, the Reply Tool would indent the comment being posted with a colon.

Just want to note that the current behavior of CD's mimic mode is to repeat the indentation of the previous comment when posting a comment at the first level (i.e., replying to a topic), not the indentation of the comment being responded to when replying to a reply. The broad idea behind that is:

  • There can be different indentation styles on the same wiki. For example, you can often see topics at EnWP's Village pump where people use * indentation despite that in most other places, : is the convention.
  • On default settings, at least for the first level comments, the tool should work as users expect on the wiki. So, mimicking the style already used is the safest way.

But when replying to a reply, CD always uses the default character. This came out of the observation that even though the indentation style of first level comments can differ on a wiki, replies to replies are usually more consistent on the whole-wiki scale (as opposed to the individual-user scale). E.g., at Vllage pump that I mentioned above, first level comments can have * while replies to them have *: or ::. This is not a firm decision though and can be changed.

Thanks for the extra explanations @Jack_who_built_the_house.

I started looking into matching your implementation of indentationCharMode: 'mimic', but then I realized that Russian Wikipedia uses the 'unify' mode, which already matches the behavior of DiscussionTools, as far as I can tell. Am I missing something?

Although 'mimic' is the default in Convenient Discussions, no one else has been asking us to implement that behavior, so I think we can skip this work entirely (at least until someone asks for it). I'll update the task description.

So we just need to have a way to change the reply syntax, matching CD's defaultIndentationChar: '*'. I'm updating my old patch for this: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/672430.

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

[mediawiki/extensions/DiscussionTools@master] Enable wikis to customize the syntax used for replies

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

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

[mediawiki/extensions/DiscussionTools@master] Ensure the marker appears in a reasonable place when replying with a bullet

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

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

[operations/mediawiki-config@master] DiscussionTools: Use bullet indentation on ruwiki

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

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

[mediawiki/extensions/DiscussionTools@master] Add tests for bullet indentation

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

I started looking into matching your implementation of indentationCharMode: 'mimic', but then I realized that Russian Wikipedia uses the 'unify' mode, which already matches the behavior of DiscussionTools, as far as I can tell. Am I missing something?

No, that's correct. I just thought you came to a conclusion that mimicking the comment being replied to is better than simple unify from the perspective of the junior-senior contributor dynamic and wanted to clarify the meaning of mimic in CD :-)

Change 672430 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Enable wikis to customize the syntax used for replies

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

Change 753190 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Ensure the marker appears in a reasonable place when replying with a bullet

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

Change 753194 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Add tests for bullet indentation

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

The next steps (next week) are to ensure the code from patches above is deployed (backporting if necessary), then deploy the config change https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/753192.

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

[mediawiki/extensions/DiscussionTools@wmf/1.38.0-wmf.17] Enable wikis to customize the syntax used for replies

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

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

[mediawiki/extensions/DiscussionTools@wmf/1.38.0-wmf.17] Ensure the marker appears in a reasonable place when replying with a bullet

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

Change 754915 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@wmf/1.38.0-wmf.17] Enable wikis to customize the syntax used for replies

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

Change 754916 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@wmf/1.38.0-wmf.17] Ensure the marker appears in a reasonable place when replying with a bullet

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

Change 753192 merged by jenkins-bot:

[operations/mediawiki-config@master] DiscussionTools: Use bullet indentation on ruwiki

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

Mentioned in SAL (#wikimedia-operations) [2022-01-19T01:02:33Z] <catrope@deploy1002> Synchronized php-1.38.0-wmf.17/extensions/DiscussionTools: Backport: [[gerrit:754915|Enable wikis to customize the syntax used for replies (T259864)]] and [[gerrit:754916|Ensure the marker appears in a reasonable place when replying with a bullet (T259864)]] (duration: 00m 53s)

Mentioned in SAL (#wikimedia-operations) [2022-01-19T01:07:14Z] <catrope@deploy1002> Synchronized wmf-config/InitialiseSettings.php: Config: [[gerrit:753192|DiscussionTools: Use bullet indentation on ruwiki (T259864)]] (duration: 00m 53s)

Offline, we decide to make an adjustment to how the Reply Tool will look at ru.wiki (and any other wiki where * is used to indent comments rather than :)

Change

  1. Remove the "•" that currently appears next to the "B" within the Reply Tool's source mode:

Screen Shot 2022-01-19 at 11.34.20 AM.png (618×1 px, 81 KB)

Assumptions/Thinking Influencing "Change"

  1. The majority of Senior Contributors at ru.wikipedia use the Reply Tool's source mode [i]
  2. Assumption: the "• " that currently appears within the source mode's real-time preview will be sufficient for helping Senior Contributors to see / understand that the comments they draft with the reply tool will have " • " prepended to them:

Screen Shot 2022-01-19 at 11.36.01 AM.png (766×1 px, 111 KB)


i. While it's not a 1:1 comparison, see that 185 comments have been posted with the reply tool at ru.wiki in the pats 30 days (via https://dtcheck.toolforge.org/dtstats.html) and see that in dec 2021, of all the comments senior contributors posted at ru.wiki by with reply tool, 180 were made with one of the reply tool's two source modes (via https://superset.wikimedia.org/r/1098)

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

[mediawiki/extensions/DiscussionTools@master] When using bullet syntax, hide the marker next to the reply tool

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

Thanks for implementing this change. The implementation is faulty though. Perhaps I should have mentioned this earlier, but it didn't came to my mind and you didn't ask.

Here I wrote

Testing a comment with two lines. First line.
Second line.

The result

*Testing a comment with two lines. First line.
*Second line. [signature]

The whole point of bullets (and probably the reason why it became a convention in RuWP) is that bullets denote comments. One bullet – one comment. This means that if a comment has two lines, the second line goes with : or <br> or even a paragraph, but it doesn't receive a second *.

In this case, I suppose the expected behavior is to post

*Testing a comment with two lines. First line.
:Second line. [signature]

(CD goes with <br> but Reply Tool uses : as I witnessed.)

You can argue that the semantics is faulty here, but well, if we dive into that, we will eventually discover that <dl>s of : are not really description lists and so on.

In this case, you should also account for possible lists in the comment and fall back to : if it has a list at the first line, so that the result is

:* List item.
:* List item.
:Comment ending.

and not

** List item.
:* List item.
:Comment ending.

which would give both semantically and visually wrong result. (And also not

** List item.
** List item.
*Comment ending.

which would make the layout even more confusing than without lists.)

CD has some more logic implicated here, but these considerations are most essential I believe.

In this case, I suppose the expected behavior is to post

*Testing a comment with two lines. First line.
:Second line. [signature]

This should not be done for accessibility reasons. See https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Accessibility#Lists.

Accessibility is actually one reason why some of RuWP users argue for using *, not :, as well, since : are description lists that necessitate the use of <dt> (; in the wiki markup). I haven't conducted research on how <ul>s (*) and <dl>s are actually treated by screen readers and such, and that information is welcome.

So, the accessibility concern in this particular case could be addressed in at least two ways that come to my mind:

  • Use <br> instead of :. It doesn't come down to just RuWP and * problem as it also applies to :-only indentation, and it's actually interesting which is better in terms of accessibility. Visually they currently differ in Vector only in that : creates a 1–2 pixel vertical gap while <br> creates none, so this can be neglected. There are some difficulties in mixing <br>s with lists inside comments, but those could be overcome. <p>...</p> can also be used instead of <br> but this would need additional tweaks to be made to make sure the discussion structure is consistent.
  • Do a special transformation on talk pages of such markup, keeping it in the wikitext but tweaking it for the parsed form.

CD does both things, using <br>s and merging adjacent <dl>s and <ul>s (only those used for comment indentation) together and reducing them to one form.

If this is too complex at this stage of development, and if the accessibility concern is considered valid (although it may need additional research, and if accessibility really is to be taken seriously, much would need to be rethough), I could suggest falling back to : intentation if the comment has more than one line, as starting each line with * is IMHO much more misleading and potentially annoying than choosing : indentation for a whole comment, since it violates the principle "bullets denote comments". (As a side note, this doesn't affect CD users as they see thread lines on the side of comments, not bullets or plain indentation, see example.)

Change 755476 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] When using bullet syntax, hide the marker next to the reply tool

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

@Jack_who_built_the_house: first off, the clear and timely feedback you continue to share helps us to ensure the Reply Tool works in ways volunteers at ru.wiki expect and value...thank you!

Now, to the issues you raised in T259864#7634915: it's clear the Editing Team has some more thinking to do about how the Reply Tool can be configured to meet the needs of volunteers at ru.wiki.

With the above in mind, here is what I'm thinking we will do next:

  1. Until we – volunteers at ru.wiki and the Editing Team – converge on an approach to indentation syntax that we are both satisfied with, the Reply Tool will pause any plans to make the Reply Tool available by default at ru.wiki
  2. The Editing Team is going to draft the requirements we understand any approach to indentation syntax will need to satisfy for the Reply Tool to be made available by default at ru.wiki and propose a set of a approaches we think could satisfy said requirements
  3. Once "2." is done, we will share these requirements and approaches with you, and other volunteers at ru.wiki, to ensure we have a shared understanding of the requirements and see if you all are comfortable with any of the approaches we are proposing.

...does any of what I've described above bring any questions or concerns to mind for you?

@Jack_who_built_the_house Thanks for bearing with us.

We were aware of the issues with multi-line comments, but I think we underestimated how much the ru.wp community cares about them, and wanted to avoid implementing more special cases if possible (or at least, I was and I did, not sure if I can speak for everyone :) ). I guess it's not possible to avoid, so we should do that.

(I didn't actually think of the extra-special special cases for comments starting with lists, thanks for bringing up that in particular. I found that you have some test cases for these behaviors in https://github.com/jwbth/convenient-discussions/blob/master/tests/parseCommentText.test.js, I'm going to borrow them.)

As for semantics and accessiblity of * and : and <dl> and <ul>: As far as I know, they're both equally awful, and it doesn't really matter which one we use. Mixing them in one comment is probably making it worse, but I don't think that's the main problem with accessibility of talk pages. (In my own experience trying to use Windows Narrator, the most infuriating thing was hearing the fancily formatted signatures spoken aloud.)

It looks like switching from * to : is the easiest thing to implement in our code (adding <br> or <p>...</p> markup would be trickier), and it's already used widely on ru.wp and we're not planning to introduce it elsewhere, so that is my current preference, in spite of the ugly / non-semantic / non-accessible markup it generates.

We've talked about this in the engineering meeting today, and @cscott had a new idea: what if we used : for indentation, but added a little bit of CSS styling to display bullet markers at the beginning of each comment? We now have indicators for that in the HTML (the <span data-mw-comment-start …> elements), generated by DiscussionTools, so styling them with CSS actually becomes possible (it wasn't before).

This is, of course, assuming that ru.wp folks care about how the page looks in read mode, rather than what exact markup it uses.

Something like this could work:

dd span[data-mw-comment-start] {
	display: list-item;
	position: absolute;
	top: unset;
	margin-top: -1em;
	padding-top: 1em;
	list-style-image: url(/w/skins/Vector/resources/common/images/bullet-icon.svg);
	pointer-events: none;
}

But if you do care about the exact markup, I also took a stab at implementing the required mix of * and :: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/757011

It is not pretty, but it seems feasible to do this as well. We'd very much prefer the other solution, though.

Next steps

  • @Whatamidoing-WMF is going to share, and invite feedback about, the approaches proposed above at ru.wiki

We've talked about this in the engineering meeting today, and @cscott had a new idea: what if we used : for indentation, but added a little bit of CSS styling to display bullet markers at the beginning of each comment? We now have indicators for that in the HTML (the <span data-mw-comment-start …> elements), generated by DiscussionTools, so styling them with CSS actually becomes possible (it wasn't before).

It’s still incorrect markup, though. That is one of the reason it is not used in Russian Wikipedia, and the styling tweak you’re proposing is not going to change that.

What do you mean by "incorrect markup"?

To be honest, I see no point in talking accessibility and semantics while individual comments and their components are not isolated, are torn apart across multiple list items, and so on. And given that talk pages HTML is already heavily modified by DiscussionTools, it seems to me that when the time comes, it will not be particularly difficult to switch to whatever accessible and semantic tags are deemed the most appropriate in the HTML output, while keeping whatever markup the users are used to, be it : or *, in the wikicode. (I didn't keep track of new tasks on this subject lately, please link if there were such.)

Hello! I understand correctly that now everything works correctly? :) I want to start a discussion about including the default tool in ruwiki.

Here is an example of a talk page using : indentation withe CSS fix described in T259864#7650035 applied: https://patchdemo.wmflabs.org/wikis/780c86aa34/wiki/Talk:DiscussionTools

Note that this fix would add bullets to all comments indented with : on the wiki, not just those created with our tool.

Here is an example of a talk page using : indentation withe CSS fix described in T259864#7650035 applied: https://patchdemo.wmflabs.org/wikis/780c86aa34/wiki/Talk:DiscussionTools

Note that this fix would add bullets to all comments indented with : on the wiki, not just those created with our tool.

As far as I can see, now new messages are used *, not : in ruwiki.

As far as I can see, now new messages are used *, not : in ruwiki.

It was configured this way after previous discussion on this task, but if you wanted to use the CSS fix instead, then the configuration would be changed back.

BTW, one more thing. In ruwiki, there is a solid custom to put a space after indentation characters. We write

* Comment
: Comment

not

*Comment
:Comment

Could this be configurable too?

@Iniquity reminded me of this question at T298932#8115366. It is possible, and although the implementation will be a little hacky, it's not really worse than other things we already do, so I think we can do it.

(It's tricky because we now have to parse the wikitext partially to see if the comment line begins with lit item markup, and not add the space in this case, but we already do that for T263217. Also, controlling the spaces is not really supported by Parsoid, as discussed in T238218, but we do it anyway.)

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

[mediawiki/extensions/DiscussionTools@master] Add space if possible after bullet indentation

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

@Iniquity reminded me of this question at T298932#8115366. It is possible, and although the implementation will be a little hacky, it's not really worse than other things we already do, so I think we can do it.

Thank you! I hope in the future we will generally go for a unique syntax (smth like >>>) and this will no longer interfere.

Change 822684 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Add space if possible after bullet indentation

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

@matmarex hi :) thanks for the patch. I have a question :) It does not apply to such comments: https://ru.wikipedia.org/w/index.php?diff=125125050&oldid=125122773?

I don't know why it didn't work in that case. We don't have full control of the wikitext generate by reply tool in visual mode. We can give hints to Parsoid, but we can't guarantee that it will add or omit spaces. If it's a common problem, please file a task with more examples and I'll try to investigate.

I don't know why it didn't work in that case. We don't have full control of the wikitext generate by reply tool in visual mode. We can give hints to Parsoid, but we can't guarantee that it will add or omit spaces. If it's a common problem, please file a task with more examples and I'll try to investigate.

This is a common problem, but I think it's not critical :) Thanks for the answer, I'll probably create a task later!