Change how link annotations work to actively enter/leave the annotation
Closed, ResolvedPublic40 Story Points

Description

Currently, rendering breaks when typing into a cursor at the end of a link:

  • The DM extends the link until the first "word boundary"
  • However, the browser CE continues the link either indefinitely (Firefox) or not at all (Chromium/Firefox)
  • The inconsistency persists until the next re-render.

The DM behaviour cannot be replicated in current browser CEs (because IME stability constraints prevent re-rendering whilst typing text) and is not always desirable (because link text is often multi-word).

Instead, we should do the following:

  1. Show clearly in the UI whether the cursor is inside or outside the link.
  2. Spend a cursor press crossing into/out of a link (without changing the DM offset).
  3. Use unicorn-like image nodes to impose indefinite CE continuation inside links (and none outside).
  4. Calculate the DM insertion annotations from the observed CE ones.
dchan created this task.Mar 2 2015, 6:41 PM
dchan updated the task description. (Show Details)
dchan raised the priority of this task from to Normal.
dchan claimed this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 2 2015, 6:41 PM
dchan set Security to None.
dchan moved this task from Backlog to Hacking proposals on the Wikimedia-Hackathon-2015 board.
He7d3r added a subscriber: He7d3r.Apr 23 2015, 1:23 PM

It is time to promote Wikimedia-Hackathon-2015 activities in the program (training sessions and meetings) and main wiki page (hacking projects and other ongoing activities). Follow the instructions, please. If you have questions, about this message, ask here.

Elitre added a subscriber: Elitre.May 22 2015, 5:18 PM

Did someone work on this project during Wikimedia-Hackathon-2015? If so, please update the task with the results. If not, please remove the label.

Neil_P._Quinn_WMF raised the priority of this task from Normal to High.Jun 30 2015, 10:51 PM
Jdforrester-WMF renamed this task from Change how link annotations work (and fix link continuation rendering) to Change how link annotations work to actively enter/leave the annotation.Aug 10 2015, 8:11 PM

Change 217257 had a related patch set uploaded (by Divec):
WIP: Explicitly enter/exit link annotations

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

dchan added a comment.Sep 1 2015, 9:23 PM

This image shows the operation of link cursoring (with https://gerrit.wikimedia.org/r/217257 )

Change 217257 merged by jenkins-bot:
Links: Explicit entry/exit with cartouches

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

Would it be possible to have the cursor default to outside the link, after inserting it?
Because: With the Current/updated behaviour, I have to add a [right-arrow] keypress, in order to keep typing, after entering a link. This is complicated, non-intuitive, and not consistent with other richtext editors (afaik).
It's especially a concern here, given the previous link continuation bug behaviour, where I'm accustomed to an erroneous display, and I've learned to ignore link text continuing past where it was meant to end (until I hit [enter] or otherwise trigger a re-render).


Current behaviour (post-update):

  • I type foo bar
  • [ctrl-k]test
  • [enter]
  • zow

This results in

foo bar [[test zow]]


My desired behaviour: (identical to gmail, etc)

  • I type foo bar
  • [ctrl-k]test
  • [enter]
  • zow

This results in

foo bar [[test]] zow