Review main Merged

81679[TASK] Add title argument to IconViewhelper

Patrick Schriner CR +2 V +2 Normal +71 −6 updated 12/01/23, 20:00

Commit message

Allow a title argument to be set in the IconViewHelper.
The give title will be passed to the `Icon` object and
will be rendered as title attribute in the icon HTML
markup, enhancing accessibility.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Jochen Roth +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Jochen Roth +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 2939

Show 1014 earlier messages
  1. Patrick Schriner uploaded patch set 1 11/03/23, 15:18

  2. Patrick Schriner uploaded patch set 2 11/03/23, 15:25

  3. core-ci voted on patch set 1 V +1 11/03/23, 15:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48553

  4. core-ci voted on patch set 2 V +1 11/03/23, 15:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48554

  5. Guido Schmechel voted on patch set 2 CR +1 11/04/23, 11:41

  6. Guido Schmechel commented on patch set 2 CR 0 11/04/23, 11:57

    IconViewHelper.php:91

    PHP Warning: Undefined array key "title" in /var/www/html/typo3/sysext/core/Classes/ViewHelpers/IconViewHelper.php line 91
  7. Guido Schmechel commented on patch set 2 11/04/23, 11:58

    IconViewHelper.php:91 Reply

    Shouldn't that be enough here? $icon->setTitle($arguments['title'] ?? '');
  8. Garvin Hicking commented on patch set 2 11/04/23, 21:01

    IconViewHelper.php:91 Reply

    I'd argue against this shortening; if the iconfactory sets the title itself, the title would always be reset to an empty string thn. only access the setter when the argument does contain anything, Couldnt check it atm, but ideally IMO the factory SHOULD set default titles for known icons and only let the viewhelpers override it, so that titles dont need to be placed in each viewhelper call for the same icon time and again?
  9. Oli Bartsch commented on patch set 2 11/05/23, 09:35

    IconViewHelper.php:58

    Could we get an example with the new attribute? Additionally, since this is public API, we should at least add a Important.rst to document the new argument. Better would IMO to change the patch to a feature.

    IconViewHelper.php:76

    This is the default value and can be skipped.

    IconViewHelper.php:91 Reply

    I suggest to just change the check to "$arguments['title'] ?? false".
  10. Patrick Schriner uploaded patch set 3 V +1 11/06/23, 08:04

  11. Patrick Schriner rebased onto patch set 4 11/06/23, 08:04

  12. Patrick Schriner commented on patch set 4 11/06/23, 08:06

    IconViewHelper.php:91 Reply

    1) The warning goes away after a cache flush 2) I want to have this so the current output is not changed. If someone wants to pass an empty string "", that should be fine 3) will add an Important-text-file soon
  13. core-ci voted on patch set 4 V +1 11/06/23, 08:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48610

  14. core-ci voted on patch set 3 V +1 11/06/23, 08:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48609

  1. Patrick Schriner uploaded patch set 5 V +1 11/06/23, 08:25

    Add example usage and rst!
  2. Patrick Schriner commented on patch set 5 11/06/23, 08:26

    IconViewHelper.php:58 Reply

    Done

    IconViewHelper.php:76 Reply

    Done

    IconViewHelper.php:91 Reply

    Done
  3. core-ci voted on patch set 5 V -1 11/06/23, 08:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48616

  4. Patrick Schriner uploaded patch set 6 V -1 11/06/23, 08:39

    Fix unique key in rst
  5. core-ci voted on patch set 6 V +1 11/06/23, 08:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48617

  6. Garvin Hicking commented on patch set 6 11/06/23, 16:43

    Did you check if there's maybe a way to enhance this at the IconFactory-level as well? So that titles could be added to the icon registration, and they would be embedded everywhere the icon is used? The viewhelper could additionally allow a title attribute to override this. Then nobody would need to murmeltier this viewhelper attributr into dozens of usage instances, and it would benefit all other icon usages, too...?
  7. Patrick Schriner commented on patch set 6 11/06/23, 22:01

    Reply

    The same graphic can be used in more than one place - the icon does not have to be connected to a particular function. For accessibility purposes I don't need a "generic" title, I need a specific one?
  8. Garvin Hicking commented on patch set 6 11/06/23, 22:10

    Reply

    I was lead on that path due to the "action-menu" example, which I figure might alway get the same title. I agree though that there definitely will be icons where their title won't match. But if an iconfactory put out a default for all icons that canbe overriden, it might be a start for maybe 50% of icon usages? (that number is totally made up of course 🤡)
  9. Patrick Schriner commented on patch set 6 11/07/23, 10:16

    Reply

    I think that would make this patch unnecessary big and most importantly would change existing behavior / output; Which is why I would see such a change as out of scope.
  10. Garvin Hicking commented on patch set 6 11/07/23, 10:21

    Reply

    Fair enough; would be possible as a follow-up of course. I see this useful for custom extensions, but I think the core needs to take care of it for own backend modules, too. But this'll probably part of a UX/UI-initiative for GSB-Barrierefreiheit anyways.
  11. Willi Wehmeier commented on patch set 6 V +1 CR +1 11/20/23, 10:19

    Does work and would be really helpful to solve some accessibility issues 😊
  12. Jörg Bösche voted on patch set 6 CR +1 11/30/23, 12:44

  13. Michael Telgkamp commented on patch set 6 CR +1 V +1 12/01/23, 06:51

    The title attribute is not the final way to add information for accessibility. It is not available for all screen readers by default and is not available on touch devices. Apart from this, it still is an improvement of the current situation. This is why I nevertheless give my +1 to this patch.
  14. Patrick Schriner commented on patch set 6 12/01/23, 08:11

    Reply

    I agree that this is not ideal; I only propose this change because it's non-breaking and enables to provide some extra information where it's missing. It's a bit contradictory too because these icons all have aria-hidden=true set; but we had test users that were visually impaired (but not blind) and complained that there wasn't enough information in many places (e.g. dashboard, or the drag and drop area above the page tree) where these icons are used + they don't ignore aria-hidden elements.
  15. Oli Bartsch commented on patch set 6 CR -1 12/01/23, 08:58

    Important-102314-TitleCoreIconViewhelper.rst:1

    Changelog file has to go into /12.4.x/

    Important-102314-TitleCoreIconViewhelper.rst:14

    This reads as the current state. As in the commit message we should try to focus on what's possible now, not what was not possible before. We can however include the reasons (accessibility improvements) in the corresponding text. I suggest to start like: "The `IconViewhelper` has been extended for a new argument `title`, which allows to set a title, rendered as title attribute in the icon markup. This improves accessibility ..."
  16. Patrick Schriner uploaded patch set 7 CR +1 V +1 12/01/23, 09:10

  17. Oli Bartsch uploaded patch set 8 12/01/23, 09:27

  18. Oli Bartsch commented on patch set 8 CR +1 V +1 12/01/23, 09:27

    Important-102314-TitleCoreIconViewhelper.rst:1 Reply

    Done

    Important-102314-TitleCoreIconViewhelper.rst:14 Reply

    Done
  19. core-ci voted on patch set 8 V +1 12/01/23, 09:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50201

  20. core-ci voted on patch set 7 V -1 12/01/23, 13:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50200

  21. Jochen Roth voted on patch set 8 CR +1 V +1 12/01/23, 16:34

  22. Oli Bartsch voted on patch set 8 CR +2 V +2 12/01/23, 16:39

  23. Oli Bartsch merged patch set 9 12/01/23, 16:54

  24. core-ci voted on patch set 7 V -1 12/01/23, 18:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50200

  25. core-ci voted on patch set 7 V -1 12/01/23, 20:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50200