Page MenuHomePhabricator

The [Reply] button inherits the text formatting before it. Is this the Right Thing to do?
Closed, ResolvedPublic

Description

If a comment is wrapped in <small> tags, then the [ reply ] button is in small type, too. Is this a bug or a feature?

Ed: I think bug, as I wrote in T267949:

Sometimes the reply link will be inserted in a context that changes the style of it. While we won't be able to fix every edge case, and in some cases the inherited styling will be appropriate, the case of the unsigned template (at least on en.wiki) is pretty common, and the reply link should not be small as it makes it harder to click.

Observed

Expected

(https://en.wikipedia.org/wiki/User:ESanders_(WMF)/sandbox?dtenable=1)

Event Timeline

matmarex added subscribers: Esanders, ValeJappo, matmarex.

Quoting from the merged task:

I think the rule we should implement is:

  • When we get to the end of the timestamp that is immediately followed by a close tag: [TIMESTAMP]</TAG>
  • We should move the end comment marker from before </TAG> to after </TAG> if the tag is an inline tag (we have utilities for defining what tags are inline vs block).

This seems reasonable to me.

Change 641227 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/DiscussionTools@master] Move end marker up to last non-block-level element

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

For the record I did find an example in our test case where one could argue the reply link should go inside some small tags:

These users have wrapped their comments in small tags, possibly to indicate it is a side chat?

I think the unsigned comment case is far more common, and there are better way to markup side chats than <small> wrapping.

If the case above is raised as problematic in the future, we could consider special casing inline annotations which wrap the whole line.

For the record I did find an example in our test case where one could argue the reply link should go inside some small tags:

These users have wrapped their comments in small tags, possibly to indicate it is a side chat?

I think the unsigned comment case is far more common, and there are better way to markup side chats than <small> wrapping.

Yes, this use is to indicate off-topic commentary most often. I do not agree with your assertion that there are better ways; small is precisely the HTML element to do so per its present definition.

Change 641227 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Skip end marker "forward" until a block tag is reached

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

Yes, this use is to indicate off-topic commentary most often. I do not agree with your assertion that there are better ways; small is precisely the HTML element to do so per its present definition.

Changing the font size has accessibility implications. I don't think it matters if this convention continues though, this patch will just make the reply buttons normal size.

Yes, this use is to indicate off-topic commentary most often. I do not agree with your assertion that there are better ways; small is precisely the HTML element to do so per its present definition.

Changing the font size has accessibility implications. I don't think it matters if this convention continues though, this patch will just make the reply buttons normal size.

I said nothing about font size, and although small implies it, specifically making font small is no longer the specified intent of the element. From MDN:

The HTML <small> element represents side-comments and small print, like copyright and legal text, independent of its styled presentation.

In other words, it is now more or less an inline equivalent of aside.

But, since we are talking about accessibility considerations, en.wp at least makes small text 85%, which is our established line in the sand. Browsers are inconsistent in how small text is, hence our decision. Perhaps something to consider in another task is a better reset for the element.

Lastly, I have little issue in normal sized reply buttons since that seems to be your concern, though it will cause some noticeable whitespace on any given line of interest for this particular pattern. (I anticipate the unsigned pattern is not a case of interest regarding that whitespace concern.)

Perhaps Volker has an opinion on the matter.

@ppelberg to create ticket for the case where an entire comment is wrapped in small tags

@ppelberg to create ticket for the case where an entire comment is wrapped in small tags

Here is that ticket: T270230