Page MenuHomePhabricator

Reconsider list switcher design to allow nesting ordered list inside unordered list
Closed, ResolvedPublicFeature

Description

Feature summary:
I would like to create this kind of list with VisualEditor:

Ordered item following unordered item:
# item 1
#* example for 1
## item 1.a.
##* example for 1.a.

Nested unordered list inside ordered list inside unordered list:
* item
*# sub
*#* sub-sub

Redesign proposal:

  • Even on a nested list, only one list type (ordered/unordered) should be highlighted in menu (matching with last level).
  • Clicking on highlighted list menu item (to disable list) should only remove the last indentation level. So, if you are on level-3 *#*, item content will get down to level-2 *#.
  • Switching list type (ordered/unordered) should only change current item or selected items. You will have to select the whole list to fully switch it from ordered list to unordered list.

Use case(s):
This kind of complex list are sometimes used on Wiktionary (example).

Benefits:
Currently, they can be created only in wikitext editing.

Event Timeline

This comment has been deleted.

Even on a nested list, only one list type (ordered/unordered) should be highlighted in menu (matching with last level).

This sounds like a reasonable request.

Clicking on highlighted list menu item (to disable list) should only remove the last indentation level. So, if you are on level-3 *#*, item content will get down to level-2 *#.

That might make more sense, but there is already a de-indent button for that purpose, so it doesn't seem that important.

Switching list type (ordered/unordered) should only change current item or selected items. You will have to select the whole list to fully switch it from ordered list to unordered list.

I don't really see a need for this ("Ordered item following unordered item"), or any examples of it at the Wiktionary link provided. In HTML the list type (bullet/number) is defined at the list level, so these would need to be two separate lists anyway.

The second example ("Nested unordered list inside ordered list inside unordered list") should be fixed.

Change 785865 had a related patch set uploaded (by Esanders; author: Esanders):

[VisualEditor/VisualEditor@master] ve.dm.SurfaceFragment: Add matchFirstAncestorOfType option

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

I don't really see a need for this ("Ordered item following unordered item"), or any examples of it at the Wiktionary link provided. In HTML the list type (bullet/number) is defined at the list level, so these would need to be two separate lists anyway.

I have edited the example to provide a more complete example as use case (but note this syntax is not consensual in French Wiktionary community).
Indeed, even semantically, these have to be separate lists: <ul> stands for examples whereas <ol> stands for sub-definitions or related definitions.

I fear any UX that supported this use case (like in Libre Office) would make the more common use case (where you want to change the whole list) harder to do, or more error prone.

Change 785865 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] ve.dm.SurfaceFragment: Add matchFirstAncestorOfType option

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

Change 790452 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (e54ef8d1c)

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

Change 790452 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (e54ef8d1c)

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

matmarex moved this task from To Triage to Triaged on the VisualEditor board.
matmarex moved this task from Inbox to QA on the Editing-team (Kanban Board) board.
matmarex edited projects, added Editing QA; removed Patch-For-Review.

Testing:

It should be possible to create a list that alternates between bullet and numbered and multiple indentations, using the toolbar tools:

  • One
    1. Two
      • Three

Placing your cursor in any of these list items, should highlight just one list type in the toolbar corresponding to the current list type.

Many thanks for this nice feature!

There is a minor inconsistency: list type should be updated immediately after decreasing indentation.

Reproduction steps:

  1. Create the following list:
  • One
    1. Two
      • Three
  1. Outdent “Three” item
  • One
    1. Two
    2. Three
  1. Click on List Structure drop-down button.

Actually: “Bullet list” choice is highlighted.

Expected: “Numbered list” choice should be highlighted.

Note if you move your cursor outside the Three item, then coming back to it, “Numbered list” is well highlighted.

List switcher allows nesting order and cursor position is in sync with the highlighted list type irrespective of the depth. See:

Screenshot 2022-05-27 at 00.11.12.png (858×1 px, 105 KB)

Screenshot 2022-05-27 at 00.10.44.png (864×1 px, 108 KB)

Screenshot 2022-05-27 at 00.10.35.png (786×1 px, 105 KB)

Screenshot 2022-05-27 at 00.10.27.png (850×1 px, 106 KB)

Screenshot 2022-05-27 at 00.10.18.png (854×1 px, 105 KB)

Screenshot 2022-05-27 at 00.10.10.png (846×1 px, 106 KB)

Saved edit looks like:
Screenshot 2022-05-27 at 00.11.30.png (820×1 px, 93 KB)

ppelberg claimed this task.