Page MenuHomePhabricator

Define URL schema for talk page comment and discussion URLs
Closed, ResolvedPublic

Description

In T273341 and T275729, we will introduce permalinks for topics and comments published to wikitext-based talk pages.

Both of these capabilities require that these permalinks be "human readable."

This task involves the work with defining what "human readable" means in this context.

Stories

  • As someone who is wanting to reference a particular comment or topics, I want the URL to said comment or topic to be somewhat memorable, so that I can identify said comment or topic amongst a list of other topics or comments. Think: some kind of suggestion list, similar to @ mentions, that enables you to easily "grab" a permalink to a particular topic/comment while you're writing something yourself.
  • As someone who encounters a permalink to a topic or comment, I want to know, generally, what that link is referencing (e.g. an entire discussion, a specific comment), so that I can better understand the meaning of the "message" I encountered the permalink within.

Requirements

This section will eventually contain the schema/patterns that will determine what permalinks to topics and comments on wikitext-based talk pages look like.

  • Permanent links to talk page comments and topics should be generated in the following format:
    • URL of page on which link to permanent link was generated + comment/topic hash

Gathering

Below is a *loose* collection of ideas that have surfaced around what "human readable" *could* mean in this context. See Editing Team Slack conversation for more context.

Done

Related Objects

Event Timeline

The current links on-page to a single comment are long, but full of useful non-duplicated information...

https://[domain]/wiki/[namespace]:[title]/[subpage]#[commentid] => https://www.mediawiki.org/wiki/Talk:Talk_pages_project/Usability#c-Whatamidoing_(WMF)-2022-02-07T04:55:00.000Z-Lectrician1-2022-02-02T18:51:00.000Z

That's mostly long because the comment IDs are huge. (And they're mostly huge because we're using full ISO8601 timestamps.)

If we're going to be creating e.g. a Special:CommentLink page that'll be suggested as the copyable permalink (that'll essentially be a redirect to the real one), we have the ability to make it contain less things... so long as we can use whatever data is included to still find the comment. The less data we include the less "human readable" it becomes, of course. (Smallest would be something like Special:CommentLink/54321 which is just a reference to a uniquely-assigned ID for the comment.)

(rephrasing my comments from the Slack conversation)

Here's what our current not-quite-perma-links look like:
https://www.mediawiki.org/wiki/Talk:Talk_pages_project/Usability#c-Whatamidoing_(WMF)-2022-02-07T04:55:00.000Z-Lectrician1-2022-02-02T18:51:00.000Z

We could argue how human-readable they are, but they definitely contain information and not just gibberish:

  • the title of the discussion page
  • username of the commenter, and date/time of the comment
  • username of the person they are directly replying to, and date/time of that comment

Our future permalinks should be shorter than that (we don't need all this information to identify a comment). We haven't really thought about how they would look, but the first thing that comes to my mind after 60 seconds of thinking about it is along the lines of:
https://www.mediawiki.org/wiki/Special:CommentLink/Lectrician1/2022-02-02T18:51:00.000Z

(Maybe the timestamps included in those links should be formatted differently to look cleaner… MediaWiki URLs usually format them with no separators, like this: 20220202185100.)

You can also safely drop the seconds from the timestamp—since timestamps in signatures are only accurate to a minute, the seconds part is always zero anyway, isn’t it?

2022-02-02T18:51:00.000Z is easier to recognize as containing a date than 20220202185100. 2022-02-02T18:51 would be even easier.

During today's team meeting, we revisited this question, "What format should comment and topic permanent link be presented to people in?".

While the question above remains open, the below is an attempt to bring some shape to the decision we're needing to make...


Approaches

There seem to be two general approaches which @matmarex named in T302012#7719342:

  • Approach #1: URL of page on which link to permanent link was generated + comment/topic hash.
    • Example
      • https://www.mediawiki.org/wiki/Talk:Talk_pages_project/Usability#c-Whatamidoing_(WMF)-2022-02-07T04:55:00.000Z-Lectrician1-2022-02-02T18:51:00.000Z
  • Approach #2: project domain + Special:FindComment + comment hash
    • Example
      • https://www.mediawiki.org/wiki/Special:FindComment

Considerations

ScenarioDescriptionApproach #1Approach #2Notes
1.Comment 1 still exists on the page URL was generated "on" (Page A)✅ Seamless; you will be taken right to the Comment 1 (scrolled in view + blue highlight)✅ Seamless; you will be taken right to the Comment 1 (scrolled in view + blue highlight)
2.If Comment 1 does NOT exists on Page AYou will arrive on Page A and then need to be redirected to page Comment 1 now exists on via the experience being defined in T333334You will be seamlessly redirected to the page Comment 1 now exists on provided the DB does not "think" Comment 1 exists on multiple pages [i]
3.If permanent link storage breaks in some way [ii]Can use redirect workflow described in "Scenario 2." to find comment/topic you're seeking❌ Link broken, you will not be able to find topic/comment you are seeking

Some other, more meta considerations:

  • If we go with "Approach #1", people might not perceive, and subsequently use, these URLs as permanent links because the format is reminiscent of the existing project + page+ #heading construct that people are likely to expect to fail when said #heading is moved or otherwise changed
  • If we go with "Approach #2", people who have grown accustomed to generating links to comments / topics by copying + pasting the URL in their browser's address bar may grow confused about why multiple URL constructs exists for the same "entity"

i. If the DB thinks Comment 1 exists on multiple pages, you will be taken to Special:GoToComment and be presented with links to the pages where the comment you're seeking was found
ii. E.g. Comment/topic fails to get written to permanent link database

ScenarioDescriptionApproach #1Approach #2Notes
4.Comment 1 doesn’t exist at all (e.g. reverted or deleted instead of being archived)You will arrive on Page A and have to figure out what happened to the comment, maybe using the page history❌ Link broken, you will have no clue what happened to the comment, as the page name is not recorded in the URL

@Tacsipacsi I believe that's less common than you might think -- if it's reverted you should get linked to the last revision it was contained in, so it's just full deletions-from-the-history that we need to worry about.

Per what the Editing Team converged on offline on 27 Sep, we're going to move forward with "Approach #1" named in T302012#8953681: URL of page on which link to permanent link was generated + comment/topic hash.

Thinking...

  1. For the majority of cases when people click/tap a permanent link and the comment they are seeking remains on the page from which the permanent link was generated [i], it's important that people immediately be taken to said comment.
    • Reason being: people will find any additional friction, by way of the page reload "Approach #2" [ii] would require, disruptive.[iii]
  2. For the cases when when people click/tap a permanent link and the comment they are seeking does NOT exist on the page from which the permanent link was generated, we'll show some bit of UI that shows them where the comment they're seeking might exist and presents them with the option to go see it there. Experienced volunteers are likely to find this experience familiar and in-line with the habits they've developed seeing as how it as a pattern borrowed from an existing gadget: User:SD0001/find-archived-section.
  3. It’s going to be what people share from their URL bar anyway after they follow a link to a comment, so it’s consistent. (And we should handle redirecting from that case anyway.)
  4. If the comment is missing from the permalink tables for some reason, you’ll still wind up on the right page.

i. T321228#9021242
ii. T302012#8953681
iii. T333334#8735873