Review main Merged

77658[BUGFIX] Avoid re-paints and re-layouts in page tree on drag&drop

Andreas Kienast CR +2 V +2 Easy +17 −31 updated 02/02/23, 07:54

Commit message

When using drag&drop in the page tree, many style changes happen:

* a shadow node is rendered that is moved around
* the content within the shadow node changes depending on whether
  dropping is allowed
* CSS classes are changed

The previous implementation was not optimal in several ways:

* the nodes wrapper (aka the "tree") was updated twice which each
  `dragover` event, being expensive on huge trees
* adding and removing CSS classes may have become redundant in some
  cases, triggering a re-paint every time

All these cases are handled in this patch by executing tasks only when
absolutely necessary.

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Markus Klein +1
    • Stefan Bürk +1
    • Christian Kuhn +1
    • Benni Mack +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Stefan Bürk +1
    • Christian Kuhn +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 6

Review log 2431

Show 46 earlier messages
  1. Andreas Kienast uploaded patch set 1 02/01/23, 14:20

  2. core-ci voted on patch set 1 V +1 02/01/23, 14:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36877

  3. Andreas Kienast uploaded patch set 2 V +1 02/01/23, 14:33

  4. Andreas Kienast uploaded patch set 3 02/01/23, 14:36

  5. Andreas Kienast uploaded patch set 4 02/01/23, 14:42

  6. core-ci voted on patch set 3 V +1 02/01/23, 14:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36879

  1. core-ci voted on patch set 2 V +1 02/01/23, 14:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36878

  2. core-ci voted on patch set 4 V +1 02/01/23, 14:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36880

  3. Christian Kuhn voted on patch set 4 V +1 CR +1 02/01/23, 15:15

  4. Markus Klein voted on patch set 4 CR +1 02/01/23, 15:31

  5. Andreas Kienast uploaded patch set 5 CR +1 V +1 02/01/23, 15:48

  6. Markus Klein voted on patch set 5 CR +1 02/01/23, 15:50

  7. Markus Klein commented on patch set 5 CR 0 02/01/23, 15:52

    drag-drop.ts:74

    hm... this seem unrelated. is it?
  8. Markus Klein commented on patch set 5 02/01/23, 15:53

    page-tree-element.js:81

    overlooked conflict on rebase
  9. Andreas Kienast commented on patch set 5 02/01/23, 15:54

    drag-drop.ts:74 Reply

    Nope. With the latest patch, this property was added. However, with this bugfix applied, dropping any node is not possible anymore otherwise. The issue is that page-tree-element.ts calls `this.dragDrop.isDropAllowed()` to check if dropping a node is allowed right before having the chance to determine whether it's really allowed or not.
  10. Christian Kuhn uploaded patch set 6 02/01/23, 15:55

  11. Christian Kuhn commented on patch set 5 02/01/23, 15:56

    page-tree-element.js:81 Reply

    Done
  12. Benni Mack commented on patch set 6 V +1 CR +1 02/01/23, 15:59

    totally fine, I introduced this bug this morning. Thanks for the quick fix
  13. Andreas Kienast commented on patch set 6 V -1 02/01/23, 16:00

    something is broken rn
  14. Christian Kuhn commented on patch set 6 V -1 02/01/23, 16:00

    can not drop anywhere with set 6.
  15. core-ci voted on patch set 5 V -1 02/01/23, 16:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36886

  16. core-ci voted on patch set 6 V +1 02/01/23, 16:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36887

  17. Andreas Kienast uploaded patch set 7 CR +1 V +1 02/01/23, 16:10

  18. core-ci voted on patch set 7 V +1 02/01/23, 16:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/36888

  19. Benni Mack voted on patch set 7 V +1 CR +1 02/01/23, 16:23

  20. Christian Kuhn commented on patch set 7 02/01/23, 19:14

    drag-drop.ts:74 Reply

    Done
  21. Christian Kuhn voted on patch set 7 V +1 CR +1 02/01/23, 19:16

  22. Markus Klein voted on patch set 7 CR +1 02/01/23, 20:41

  23. Stefan Bürk voted on patch set 7 V +1 CR +1 02/02/23, 04:27

  24. Andreas Kienast voted on patch set 7 V +2 CR +2 02/02/23, 07:54

  25. Andreas Kienast merged patch set 8 02/02/23, 07:54