Page MenuHomePhabricator

Enable more signature flexibility in discussion tools
Closed, ResolvedPublic

Description

This task is meant to bring together the various tickets requesting changes be made to how "permissive" Discussiontools' signature handling is.

Related Objects

Event Timeline

I really appreciate how inserting the [ reply ] links detects any paragraph or list-item that contains both a user-page link and a timestamp, even if they're not at the end, and even if they are not adjacent. Using the same logic to suppress inserting a second signature on preview and save is not just good for flexibility in signing, but also good for consistency.

Source+preview users will learn that no auto-sig in preview means they have already added a valid user+time combo. This helps to develop accurate mental models of how the system works.

Differences: need an extra check that the user-page link is for the author not an @-mention of someone else; also need to detect or expand ~~~, ~~~~, and ~~~~~.

Complications: if the user link and timestamp are in separate paragraphs or listitems, then a [ reply ] is not added (for obvious reasons). In those cases it is desirable to add a full signature at the end. We would like any comment added by Reply Tool to also be detected as a reply-able post on the page after saving.

Which leads to an open question: if a multi-paragraph reply (or new-discussion post) has a signature in a not-last paragraph, do you still insert another sig. after the last para? (I'd be inclined to say yes, at least until we have syntax for multi-line list items &/or delimited discussion-post blocks.)

@Pelagic I'm glad to read this comment, as I was also pondering a similar approach.

Some additional complications, in addition to what you listed:

  • What if the last paragraph of the reply is actually <references/>, or {{clear}}, do we want to try to handle that?
  • We don't actually yet require that user's signature be detectable by our tools; the signature requirements we're trying to introduce are more like strong hints.

Implementing that would also require some refactoring. In the current code, when we're at the point where we need to add the signature, we don't actually have the content of the reply in a format on which we could run the signature detection (in source mode, obviously we have the wikitext; in visual mode, we have the HTML with un-expanded templates). But I'm sure it's possible to change this with some effort.

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

[mediawiki/extensions/DiscussionTools@master] Improve detecting already signed comments

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

This patch will avoid adding an extra signature for anything that we recognize in existing discussions (that is, anything that gets a [reply] link in the correct place at the end of the line): including comments wrapped in formatting like <small>…</small>, comments with a post-scriptum or in parentheses, or comments generated by various templates. Thus is will resolve T268558, T278355, T291421, and T282983. Hopefully there will be no other cases where the auto-signing isn't correct, and everyone will be happy if we decline T279578 and T283631.

Change 759841 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Improve detecting already signed comments

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