This task is about implementing specific "inspection behavior" [i] for wikilinks to user pages within DiscussionTools.
Context
Links to user pages are syntactically the same as other wikilinks: [[ Namespace: page | display text ]].
User page link syntax | Other wiklink format |
---|---|
[[User:NAME|NAME]] | [[Help:LINK|LINK]] |
Although, links to user pages behave differently from other wikilinks. Namely, when links to user pages are saved to the page, the person whose user page was linked to will receive an "Alert" as described here: https://www.mediawiki.org/wiki/Help:Notifications/Types#Mentions. The same is not true when any other kind of wikilink is saved to the page.
Trouble is, as T232601 is currently implemented, user page links and other wikilinks behave the same. Should this behavior persist, we think people could become confused about how user page links (read: pings) work. For example, they could mistakenly change the display text of a link, assuming that doing so would change who gets a notification.
For more details about these issues and to see them illustrated, review: T252083#6178541.
Requirements
People should be able to:
- Remove a "ping" from the comment they have drafted
Change who they are "pinging" (read: change ping from USER 1 to USER 2) without having to delete the entire contents of the previously written "ping"- This is no longer a requirement.
- Lower the likelihood people will mistakenly cause the link target and text to become "out of sync."
- Understand "pings" as being different from other links
Implementation
Approach #1A: temporary block that remains a link
- When an @-mention is clicked in the Reply tool's visual mode:
- People will see a dark, highlighted block
that describes its contents with no calls to action; this is similar to how VE already behaves [ii]- The entirety of the block can be deleted
- The block's contents can not be edited
- People will see a dark, highlighted block
- When the cursor is moved atop an @-mention in the Reply tool's visual mode:
- People will see a lightly highlighted block; this is similar to how VE already behaves [iii]
- When someone creates an @-mention in the visual mode and switches to source mode:
- People should see @[[User:NAME|NAME]] and be able to edit it like any other wikilink
- When someone presses backspace into a user link when using the Reply tool's visual mode:
- The user link should become lightly highlighted [iii]; when someone presses backspace for the second time, the entirety of the user link should be deleted.
Open questions
- 1. How should the tool behave when someone places their cursor inside the user link?
- It will not be possible for people to place their cursor *inside* the user link in the Reply tool's visual mode. See "Implementation" section above for more details.
- 2. How should the tool behave when someone backspaces into user link?
- When someone presses backspace into a user link when using the Reply tool's visual mode, the user link should become lightly highlighted [iii], when someone presses backspace for the second time, the entirety of the user link should be deleted.
- 3. When someone deletes an @-mention in visual mode what should be deleted?
- Should the entirety of the @-mention be deleted (read: @ + USERNAME would be deleted)?
- Should a part of the @-mention be deleted (read: USERNAME would be deleted and @ would be kept)?
- 4. Can you change the display text without changing the link target?
- No, you should not be able to change the display text without changing the link target within the Reply tool's visual text input mode (this will still be possible in source mode).
- Rationale: Changing the display text could make it more difficult for people reading and participating in the conversation to understand what is happening because of it not being clear who a comment is directed to. Based on what I've observed so far, it seems to be common practice to refer to someone by the username they've defined for themself.
- No, you should not be able to change the display text without changing the link target within the Reply tool's visual text input mode (this will still be possible in source mode).
Done
- "Open questions" are resolved
- "Implementation" are implemented
i. E.g. placing your cursor into a user page wikilink, backspacing into a user page link, etc.
ii. Screenshot showing how VE currently handles signatures when clicked:
iii. Screenshot showing how VE currently handles signatures when hovered over:
iv. Example of what leaving pings as links and presenting a special UI could look like and behave:
v. Current UI
OTHER APPROACHES
Approach #1B: block that is treated as a template
- Implementation
- When an @-mention is selected in the Reply tool's visual mode...
- People would see a block that describes its contents and includes an "Edit" call to action that, when clicked, shows a special UI for editing the template's contents
- When an @-mention is selected in the Reply tool's source mode:
- People would see something like {{DiscussionTool ping|NAME}} and be able to edit it like any other template
- When an @-mention is selected in the Reply tool's visual mode...
- Considerations
- Always editable later
- Local templates would need to be configured on every wiki (one-time cost)
Approach #1C: block that is treated as a parser function (ala T128535).
Suggested: T252083#6191172
Approach #1D: custom wikilink syntax
Details: T252083#6191323
- [[User:NAME]] rendered as '@NAME'
- [[@:NAME]] / [@NAME] / [@:NAME] rendered as '@NAME' and linking to the user page. No conflict with link parser.
[[@NAME]]conflicts with page names starting with '@'.
Approach #1E: twitter style
@NAME, @NAME_WITH_SPACE rendered as '@NAME', linking to user page only on pages with DiscussionTools enabled. Probably many conflicts.
Approach #2: leave pings as links; present a special UI for editing/inspecting
- Implementation
- When an @-mention is selected in the Reply tool's visual mode...
- People would see a dialog specific to pings that could be customized, similar to what can be found when using Flow [iv]
- This would enable people to edit/modify who they are pinging without needing to delete the entirety of the ping they'd previously written.
- When an @-mention is selected in the Reply tool's source mode...
- People would see @[[User:NAME|NAME]] and be able to edit it like any other wikilink
- When an @-mention is selected in the Reply tool's visual mode...
- Considerations
- Works independently of templates
- Flexibility for defining new interactions (backspacing, cursoring in)
Approach #3: leave pings as links; present same UI that is shown for all other links
- Implementation
- When an @-mention is selected in the Reply tool's visual mode...
- People would see a link dialog like any other [vi]
- Ping/link's display text could be edited independent of its target
- Ping/link could be removed entirely
- A new user could be searched for
- When an @-mention is selected in the Reply tool's source mode...
- People would see @[[User:NAME|NAME]] and be able to edit it like any other wikilink
- When an @-mention is selected in the Reply tool's visual mode...
- Considerations
- Could make it more likely for the ping/link's display text and target to be out of sync (as @Esanders here: T252083#6115759)
- Could lead people to become less confident what they have written will notify someone else, as they're expecting it to.