Page MenuHomePhabricator

Change how link annotations work to actively enter/leave the annotation
Closed, ResolvedPublic40 Estimated 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.

Event Timeline

dchan claimed this task.
dchan raised the priority of this task from to Medium.
dchan updated the task description. (Show Details)

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.

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.

nshahquinn-wmf raised the priority of this task from Medium 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

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

link-cursoring.png (975×714 px, 54 KB)

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