Review main Merged

87887[BUGFIX] Improve Context Menu Accessibility

Benjamin Kott CR +2 V +2 Expert +690 −459 updated 02/05/25, 07:54

Commit message

This patch addresses several issues within the context menu.

The context menu has been rewritten as a reactive web component.
All entries are now managed as a dataset within the component,
with only the node itself used internally. This significantly
improves reliability and simplifies handling by eliminating the
need to parse the markup again to retrieve information.

Clicking outside the menu now consistently closes it. To achieve
this, the element rendering was moved to the top frame, and an
invisible layer acts as a trigger for closing the menu. This layer
spans both the main frame and the content frame, allowing clicks
outside the menu to pass through and initiate new interactions.

Menu items are now structured correctly as a menu, with proper
positioning, setsize, and ARIA labels. The left arrow key now only
closes submenus and no longer closes the context menu when the
selected element is at the root level.

Instead of <li> elements, <button> elements are now used, and
acceptance tests have been adapted accordingly.

Review

  • Code review CR +2 Done
    • Benjamin Kott +2
    • Benjamin Franzke +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Benjamin Kott +2
    • Benjamin Franzke +1
    • Andreas Kienast +1
    • core-ci +1 CI

Issues 2

Files 14

Review log 3354

Show 1629 earlier messages
  1. Benjamin Kott uploaded patch set 1 01/27/25, 09:49

  2. core-ci voted on patch set 1 V +1 01/27/25, 09:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73050

  3. Benjamin Kott uploaded patch set 2 V +1 01/28/25, 15:10

  4. core-ci voted on patch set 2 V +1 01/28/25, 15:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73104

  5. Benjamin Kott uploaded patch set 3 V +1 01/29/25, 09:23

  6. core-ci voted on patch set 3 V +1 01/29/25, 09:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73130

  7. Benjamin Kott uploaded patch set 4 V +1 01/29/25, 14:21

  8. core-ci voted on patch set 4 V -1 01/29/25, 14:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73140

  9. Benjamin Kott uploaded patch set 5 V -1 01/29/25, 15:38

  10. core-ci voted on patch set 5 V -1 01/29/25, 15:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73144

  11. Benjamin Kott uploaded patch set 6 V -1 01/29/25, 15:56

  12. core-ci voted on patch set 6 V -1 01/29/25, 16:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73146

  13. Benjamin Kott uploaded patch set 7 V -1 01/31/25, 09:35

  14. core-ci voted on patch set 7 V -1 01/31/25, 09:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73250

  15. Benjamin Kott uploaded patch set 8 V -1 01/31/25, 15:07

  16. core-ci voted on patch set 8 V -1 01/31/25, 15:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73276

  17. Benjamin Kott uploaded patch set 9 V -1 01/31/25, 15:17

  18. core-ci voted on patch set 9 V -1 01/31/25, 15:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73277

  19. Benjamin Kott uploaded patch set 10 V -1 02/03/25, 09:39

  20. core-ci voted on patch set 10 V -1 02/03/25, 09:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73370

  21. Benjamin Kott uploaded patch set 11 V -1 02/03/25, 10:48

  22. core-ci voted on patch set 11 V -1 02/03/25, 10:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73373

  23. Benjamin Kott uploaded patch set 12 V -1 02/03/25, 11:05

  24. core-ci voted on patch set 12 V +1 02/03/25, 11:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73380

  25. Benjamin Kott uploaded patch set 13 V +1 02/03/25, 13:30

  26. core-ci voted on patch set 13 V +1 02/03/25, 13:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73404

  27. Andreas Kienast commented on patch set 13 CR -1 02/04/25, 09:24

    on it
  28. Andreas Kienast uploaded patch set 14 CR -1 V +1 02/04/25, 09:27

  29. Andreas Kienast commented on patch set 14 V -1 02/04/25, 09:28

    The context menu may show outdated information: Scenario: * Open record list * Open context menu in page tree, wait for rendering * Open context menu in record list For a blink, the previous context menu state is rendered. This may cause issues in case the backend user has a slow connection and loading the new context menu needs some time.
  1. core-ci voted on patch set 14 V +1 02/04/25, 09:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73474

  2. Benjamin Franzke uploaded patch set 15 V +1 02/04/25, 11:25

  3. Benjamin Franzke commented on patch set 15 02/04/25, 11:25

    Reply

    Should be fixed with patchset 15
  4. core-ci voted on patch set 15 V +1 02/04/25, 11:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73485

  5. Andreas Kienast commented on patch set 15 V +1 02/04/25, 11:59

    context-menu.ts:178

    Could be `response !== undefined`. However, this should be checked before calling `resolve()`.

    context-menu.ts:237

    Why? I assume for "fast enough" connections to avoid "flickering"?
  6. Benjamin Franzke uploaded patch set 16 V +1 02/04/25, 14:00

  7. Benjamin Franzke commented on patch set 16 02/04/25, 14:00

    Reply

    Done

    context-menu.ts:178 Reply

    Actually this does not need to be checked at all, also the `Object.keys(response).length` is superfluous, as it checks for the properties on the `AjaxResponse` object, which have always a positive length. This has been wrong before, refactored now.

    context-menu.ts:237 Reply

    ack, adapted the comment.
  8. core-ci voted on patch set 16 V +1 02/04/25, 14:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73495

  9. Benjamin Franzke uploaded patch set 17 V +1 02/04/25, 14:29

  10. Andreas Kienast commented on patch set 17 02/04/25, 14:35

    context-menu.ts:386

    left-over or wip?
  11. core-ci voted on patch set 17 V +1 02/04/25, 14:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73501

  12. Benjamin Franzke uploaded patch set 18 V +1 02/04/25, 14:48

  13. Benjamin Franzke commented on patch set 18 CR +1 V +1 02/04/25, 14:48

    context-menu.ts:386 Reply

    left-over, sorry
  14. core-ci voted on patch set 18 V +1 02/04/25, 14:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73504

  15. Benjamin Franzke uploaded patch set 19 CR +1 V +1 02/04/25, 15:01

  16. Benjamin Franzke voted on patch set 19 V -1 02/04/25, 15:05

  17. core-ci voted on patch set 19 V +1 02/04/25, 15:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73509

  18. Benjamin Franzke uploaded patch set 20 CR +1 V +1 02/04/25, 16:14

  19. core-ci voted on patch set 20 V +1 02/04/25, 16:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73514

  20. Benjamin Franzke uploaded patch set 21 V +1 02/04/25, 16:23

  21. core-ci voted on patch set 21 V +1 02/04/25, 16:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73515

  22. Andreas Kienast commented on patch set 21 CR +1 V +1 02/05/25, 06:34

    Room for improvement: when a context menu is open, the hover state is not applied anymore to any element outside the context menu. However, clicks are passed through, which is kinda unexpected.
  23. Benjamin Kott commented on patch set 21 02/05/25, 07:27

    Reply

    Seems to be different on Mac/Windows/Linux - Windows and Linux pass the click through and it was implemented to restore that default behavior of context menus. MacOS seems to go another route here - not sure about this. But as mentioned it´s room for improvement. But can be addressed in a different patchset.
  24. Benjamin Kott voted on patch set 21 CR +2 V +2 02/05/25, 07:27

  25. Benjamin Kott merged patch set 22 02/05/25, 07:54