Page MenuHomePhabricator

Cannot move elements in long lists
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • go to https://www.wikifunctions.org/view/en/Z37431 which is a Syntactic table with 100+ options
  • click on edit
  • go to on of the options, click on the three dots next to the "Item XX"
  • select "Move before" (or "Move after"

What happens?:
The moved item as well as the item it should be moved to loose some of the Features, but the values have actually not been moved.

What should have happened instead?:
Two of the options should have been swapped.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

The issue is that ZTypedListItems.vue keyed its v-for by array position. A "Move before"/"Move after" (offset ±1) re-orders the array, but leaves the set of indexes unchanged, so Vue re-used the two swapped child instances in place. Their local UI state (expanded/hasBeenAutoExpanded in ZObjectKeyValue and the async renderedValue cache in ZObjectToString) was never reset, so each swapped instance showed the new item's value with the old item's expansion/render state. The store move itself was always correct; this was live-view corruption only.

Change #1309613 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] editor: Make keyPath reactive in useZObject and useError

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

Change #1309614 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] editor: Key typed-list items by identity so moves don't corrupt the view

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

Change #1309615 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] editor: Relocate field errors when a typed-list item moves

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

Change #1309613 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] editor: Make keyPath reactive in useZObject and useError

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

Change #1309614 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] editor: Key typed-list items by identity so moves don't corrupt the view

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

Change #1309615 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] editor: Relocate field errors when a typed-list item moves

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

Change #1310113 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] aw editor: Key fragments by identity so moves don't corrupt the view

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

Change #1310113 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] aw editor: Key fragments by identity so moves don't corrupt the view

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