Page MenuHomePhabricator

Selection experiment: Don't re-activate selection after toolbar/dialog/inspector open on mobile
Closed, ResolvedPublic

Description

However do allow the user to tap to reactivate if within previous selection

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 502895 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Re-use previousSelection when re-activating

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

Change 502896 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Don't reactivate after opening tools/windows on mobile

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

Change 502895 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Re-use previousSelection when re-activating

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

Change 504790 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (6afc66096)

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

Change 504790 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (6afc66096)

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

Change 502896 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Don't reactivate after opening tools/windows on mobile

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

Change 506223 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (d0ff41a71)

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

Change 506224 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (b049d6049)

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

Change 506223 abandoned by Jforrester:
Update VE core submodule to master (d0ff41a71)

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

Change 506224 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (b049d6049)

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

This doesn't seem to consistently work for the link inspector (…anymore?), because it changes the selection from collapsed to expanded when closing.

To reproduce the problem:

  • Place a collapsed selection inside a link annotation
  • Open link inspector
  • Click "Done" to close link inspector

Expected: deactivated expanded selection covering the link. Actual: it is activated.

It also works correctly if you start from an expanded selection covering the link, or use the "Back" button to close the inspector.

Change 516581 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[VisualEditor/VisualEditor@master] WindowAction: Refactor surface re-activation logic once again

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

Can you check the behaviour on the prototype server as I think it might be working there with the new context changes?

Change 516581 abandoned by Bartosz Dziewoński:
WindowAction: Refactor surface re-activation logic once again

Reason:
Looks like the bug is also fixed by the changes in https://gerrit.wikimedia.org/r/c/VisualEditor/VisualEditor/ /510229/16/src/ui/inspectors/ve.ui.AnnotationInspector.js , so maybe this isn't needed.

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

Actually I will split this change into a separate commit. It is not really related to the other context changes, and it seems to be the only functional change in that commit that affects both old and new contexts.

Change 517133 had a related patch set uploaded (by Bartosz Dziewoński; owner: Esanders):
[VisualEditor/VisualEditor@master] ve.ui.AnnotationInspector: Deactivate surface after closing on mobile

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

Change 517133 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] ve.ui.AnnotationInspector: Deactivate surface after closing on mobile

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

Change 517137 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (44556e8fd)

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

Change 517137 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (44556e8fd)

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

This doesn't seem to consistently work for the link inspector (…anymore?), because it changes the selection from collapsed to expanded when closing.

To reproduce the problem:

  • Place a collapsed selection inside a link annotation
  • Open link inspector
  • Click "Done" to close link inspector

Expected: deactivated expanded selection covering the link. Actual: it is activated.

It also works correctly if you start from an expanded selection covering the link, or use the "Back" button to close the inspector.

@matmarex: I am a bit confused here, what's collapsed selection and expanded selection?

Collapsed selection is just a text cursor, while expanded selection is a "normal" selection.

We call both of these things "selections" because internally, they are represented by the same structure, except that for collapsed selections (text cursors) the beginning and end positions are the same.

Collapsed selectionExpanded selection
7A764308-832D-4B01-8B59-86C6D19BF44D.png (1×640 px, 104 KB)
25B7E691-7DEE-4122-8B11-C56CFED0E1E3.png (1×640 px, 107 KB)

Collapsed selection is just a text cursor, while expanded selection is a "normal" selection.

We call both of these things "selections" because internally, they are represented by the same structure, except that for collapsed selections (text cursors) the beginning and end positions are the same.

Collapsed selectionExpanded selection
7A764308-832D-4B01-8B59-86C6D19BF44D.png (1×640 px, 104 KB)
25B7E691-7DEE-4122-8B11-C56CFED0E1E3.png (1×640 px, 107 KB)

Thanks for explaining @matmarex. I think it's working as expected now. Just to confirm the highlight in the screenshot below is called " deactivated expanded selection" right?

IMG_3413.jpg (1×640 px, 67 KB)

The blue highlight with border is yet another thing, it indicates that text you type will go inside of the link, rather than outside. Without it, when you place the cursor at the beginning or end of a link, there would be no way to tell if the typed text will be linked or not. We just call it the active annotation highlight (it was also occasionally called a "cartouche" but I think we stopped using that term).

Active link annotation is highlighted, typed text will become part of the link after "Trafalgar"
C5404C4F-28B2-4083-A417-F0F8F223B538.png (1×640 px, 113 KB)
No active annotation, typed text will be plain text after the link, before the comma
D3D06E01-B5D8-4B3B-B31F-3403DFF46A1B.png (1×640 px, 113 KB)

Note that we used to have an issue where the active annotation would still be highlighted after closing the keyboard, which is pointless (you can't type anyway, so it indicates nothing). I fixed it recently in https://gerrit.wikimedia.org/r/c/VisualEditor/VisualEditor/+/518817 (your comment makes me think you also noticed that bug :) ).


Deactivated selections use a gray background (expanded) or a black cursor (collapsed), and indicate that you can use the toolbar tools (e.g. tapping the link tool with create a link over the selected text), but can't type (this is also evident from the lack of keyboard on mobile).

Collapsed selection (deactivated)Expanded selection (deactivated)
FC977E9F-14B3-4744-9480-A52F5134A513.png (1×640 px, 124 KB)
0C7A1748-80B2-4560-9471-A99D9892251D.png (1×640 px, 124 KB)