87856[BUGFIX] Make table sorting more usable
Commit message
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
- Build/phpstan/phpstan-baseline.neon+1 −1
- Build/Sources/Sass/component/_dropdown.scss+20 −0
- Build/Sources/Sass/component/_table.scss+5 −1
- Build/Sources/TypeScript/backend/element/icon-element.ts+1 −1
- Build/Sources/TypeScript/backend/sortable-table.ts+110 −26
- typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php19+191 −129
- typo3/sysext/backend/Resources/Public/Css/backend.css+7 −4
- typo3/sysext/backend/Resources/Public/JavaScript/element/icon-element.js+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/sortable-table.js+1 −1
- typo3/sysext/core/Resources/Private/Language/locallang_core.xlf4+6 −0
- typo3/sysext/filelist/Classes/FileList.php+38 −17
- typo3/sysext/reactions/Resources/Private/Templates/Management/Overview.html+68 −13
- typo3/sysext/redirects/Resources/Private/Templates/Management/Overview.html+68 −13
- typo3/sysext/webhooks/Resources/Private/Templates/Management/Overview.html+68 −13
Review log 6083
Show 4158 earlier messages
-
Benjamin Kott uploaded patch set 1 01/22/25, 15:30
-
core-ci voted on patch set 1 V -1 01/22/25, 15:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72866
-
Benjamin Kott uploaded patch set 2
V -101/23/25, 08:16 -
core-ci voted on patch set 2 V -1 01/23/25, 08:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72904
-
Benjamin Kott uploaded patch set 3
V -101/23/25, 08:29 -
core-ci voted on patch set 3 V -1 01/23/25, 08:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72906
-
Benjamin Kott uploaded patch set 4
V -101/23/25, 09:09 -
core-ci voted on patch set 4 V -1 01/23/25, 09:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72907
-
Benjamin Kott uploaded patch set 5
V -101/23/25, 09:20 -
core-ci voted on patch set 5 V +1 01/23/25, 09:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72910
-
Benjamin Kott uploaded patch set 6
V +101/23/25, 12:10 -
core-ci voted on patch set 6 V +1 01/23/25, 12:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72923
-
Benjamin Kott uploaded patch set 7
V +101/23/25, 12:57 -
core-ci voted on patch set 7 V +1 01/23/25, 13:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72926
-
Benjamin Kott uploaded patch set 8
V +101/23/25, 13:20 -
core-ci voted on patch set 8 V +1 01/23/25, 13:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72927
-
Benjamin Kott uploaded patch set 9
V +101/23/25, 13:31 -
core-ci voted on patch set 9 V +1 01/23/25, 13:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72928
-
Andreas Kienast commented on patch set 9 CR -1 V +1 01/23/25, 14:03
DatabaseRecordList.php:1506Instead of counting all time time, I'd count once and store the result in a variable.DatabaseRecordList.php:1507Same here regarding shorting the code.DatabaseRecordList.php:2193Either call `trigger_error(..., E_USER_DEPRECATED)` in the method OR drop this as the class is `@internal`.locallang_core.xlf:157Do we need the "button" infix here? It's not a button, but a dropdown. It'd also make the label more generic. -
Benjamin Kott uploaded patch set 10
CR -1V +101/23/25, 14:24 -
Benjamin Kott commented on patch set 10 01/23/25, 14:26
DatabaseRecordList.php:1505ReplyDoneDatabaseRecordList.php:1506ReplyDoneDatabaseRecordList.php:1507ReplyDoneDatabaseRecordList.php:2193ReplyDonelocallang_core.xlf:157Replywould like to keep it generic - the context is of a button - i don´t think the dropdown matters here. -
core-ci voted on patch set 10 V -1 01/23/25, 14:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72933
-
Benjamin Kott uploaded patch set 11
V -101/23/25, 14:41 -
Andreas Kienast commented on patch set 10 01/23/25, 14:41
locallang_core.xlf:157ReplyThat's why I suggest to rename the label to `labels.sorting.asc` to have it the most generic way possible. -
core-ci voted on patch set 11 V +1 01/23/25, 14:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72934
-
Ayke Halder commented on patch set 11 01/23/25, 15:22
DatabaseRecordList.php:1340Here we already know that `$currentIdList` is an `array`. So I'd check for `!empty()` instead of counting the length. Same goes for all array counting where the result is just used to check if it is not empty. ---- And even checking for `empty` is kind of unnecessary - we could actually just put the array itself into the `if`-statement: But I don't recommend this as this is not really readable. ``` if ($this->table && $this->canEditTable($table) && $currentIdList && $this->isEditable($table)) { . ``` * empty array --> bool FALSE * array has entries --> bool TRUE ``` # php -r 'echo !empty([]) ? "TRUE" : "FALSE";' FALSE # php -r 'echo [] ? "TRUE" : "FALSE";' FALSE # php -r 'echo !empty([0 => "something"]) ? "TRUE" : "FALSE";' TRUE # php -r 'echo [0 => "something"] ? "TRUE" : "FALSE";' TRUE . ```DatabaseRecordList.php:1484Result of `count()` is only used like `bool`. So maybe instead of `int` use `bool` from `!empty(…)`. -
Benjamin Kott commented on patch set 11 01/23/25, 21:54
DatabaseRecordList.php:1340Replyempty is a weak check and disallowed with strict phpstan rules. see: https://github.com/phpstan/phpstan-strict-rulesDatabaseRecordList.php:1484Replysee note about empty() usage, we can cast it to a bool here - i have no hard feelings about bool -
Ayke Halder commented on patch set 11 01/23/25, 22:22
DatabaseRecordList.php:1340ReplyThanks for pointing this out. I found this article: https://localheinz.com/articles/2023/05/10/avoiding-empty-in-php/#content-array Let's go for: `$currentIdList !== []` instead of `count($currentIdList) > 0`DatabaseRecordList.php:1484ReplyLet's go for something like: ``` $dropdownExtraHasItems = $dropdownExtraItems !== []; $dropdownSortingHasItems = $dropdownSortingItems !== []; . ``` -
Benjamin Kott uploaded patch set 12
V +101/24/25, 07:21 -
Benjamin Kott commented on patch set 12 01/24/25, 07:22
DatabaseRecordList.php:1340ReplyDoneDatabaseRecordList.php:1484ReplyDone -
Benjamin Kott uploaded patch set 13 01/24/25, 07:24
-
Benjamin Kott commented on patch set 13 01/24/25, 07:25
locallang_core.xlf:157Replygot it -
core-ci voted on patch set 12 V +1 01/24/25, 07:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72954
-
core-ci voted on patch set 13 V +1 01/24/25, 07:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72955
-
Ayke Halder commented on patch set 13 01/24/25, 09:53
DatabaseRecordList.php:2303Checking `overlayEditLockPermissions($table)` without any `$row`-argument is only necessary for `$table !== 'pages'`. `$this->overlayEditLockPermissions($table)` always returns true for `$table === 'pages'` if no `$row`-argument is provided. -
Benjamin Kott commented on patch set 13 01/24/25, 10:07
DatabaseRecordList.php:2303Replythis code is only moved, would prefer to not change the logic here in this patch. -
Benjamin Kott uploaded patch set 14
V +101/24/25, 10:39 -
Benjamin Kott updated the commit message in patch set 15 01/24/25, 10:41
-
Ayke Halder commented on patch set 13 01/24/25, 10:45
In general about the accessibility of sorting implemented in a dropwdown: Is this really accessible like this? I would assume that clicking the column-label directly changes the sorting. Some points to consider about the implementation: * Maybe add `aria-sort` to the active `th`-element * Add a 'sr-only' caption to the table which describes that the table is sortable by using the dropdown menus. * IMO sorting is already indicated by the sorting arrows - so the dropdown-arrow should only be visible if there are other options than sorting in the dropdown-menu (like "Edit field … of the listed records"). * Currently active sorting-entry in the dropdown has an active-indicator - also needs some marking like `<a role="button" aria-pressed="true" …>` * Pressing the active sorting-entry again should do something meaningful like "disable the sorting" - or the active entry should be 'disabled'. Also see: https://www.w3.org/WAI/ARIA/apg/patterns/table/examples/sortable-table/ https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-sort https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-pressed Current code as of: https://review.typo3.org/c/Packages/TYPO3.CMS/+/87856/13 ```html <th class="nowrap"> <div class="dropdown"> <button class="dropdown-toggle dropdown-toggle-link" type="button" data-bs-toggle="dropdown" aria-expanded="false" > Column header name <div class="text-primary"> <span class="t3js-icon icon icon-size-small icon-state-default icon-actions-sort-amount-up" data-identifier="actions-sort-amount-up" aria-hidden="true" >…</span> </div> </button> <ul class="dropdown-menu"> <li> <a class="dropdown-item" href="/typo3/module/web/list?…&sortField=…&sortRev=0" title="Sort ascending" aria-label="Sort ascending" > <span class="dropdown-item-columns"> <span class="dropdown-item-column dropdown-item-column-icon text-primary"> <span class="t3js-icon icon icon-size-small icon-state-default icon-actions-dot" data-identifier="actions-dot" aria-hidden="true" >…</span> </span> <span class="dropdown-item-column dropdown-item-column-title"> Sort ascending </span> </span> </a> </li> <li> <a class="dropdown-item" href="/typo3/module/web/list?…&sortField=…&sortRev=1" title="Sort descending" aria-label="Sort descending" > <span class="dropdown-item-columns"> <span class="dropdown-item-column dropdown-item-column-icon text-primary"> </span> <span class="dropdown-item-column dropdown-item-column-title"> Sort descending </span> </span> </a> </li> <li> <hr class="dropdown-divider" aria-hidden="true"> </li> <li> <button type="button" class="dropdown-item t3js-record-edit-multiple" title="Edit the 'Enabled' field of the listed records" aria-label="Edit the 'Enabled' field of the listed records" data-return-url="/typo3/module/web/list?…" data-columns-only="["hidden"]" > <span class="dropdown-item-columns"> <span class="dropdown-item-column dropdown-item-column-icon"> <span class="t3js-icon icon icon-size-small icon-state-default icon-actions-document-open" data-identifier="actions-document-open" aria-hidden="true" >…</span> </span> <span class="dropdown-item-column dropdown-item-column-title"> Edit the 'Enabled' field of the listed records </span> </span> </button> </li> </ul> </div> </th> ``` -
core-ci voted on patch set 14 V +1 01/24/25, 10:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72966
-
core-ci voted on patch set 15 V +1 01/24/25, 10:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72967
-
Ayke Halder commented on patch set 15 01/24/25, 11:12
DatabaseRecordList.php:2303ReplyAcknowledged -
Benni Mack voted on patch set 15 CR +1 V +1 01/24/25, 11:32
-
Ayke Halder commented on patch set 15 V -1 01/24/25, 12:06
Reply
UX-issue: It's not directly visible if there are any other features than sorting in the dropdown. E.g. see column "Last modified" which has only the sorting options. Therefore I suggest this: * IMO sorting is already indicated by the sorting arrows - so the dropdown-arrow should only be visible if there are other options than sorting in the dropdown-menu (like "Edit field … of the listed records").Even if this change is not about accessibility, please take the mentioned UX-issue into account. -
Benjamin Kott uploaded patch set 16
CR +1V +101/24/25, 13:36 -
Ayke Halder commented on patch set 16 01/24/25, 13:38
Reply
Discussion on Slack: https://typo3.slack.com/archives/C027S88NY/p1737722075100139 Closing this as we are going for absolute identical dropdown-styling all around the TYPO3-backend. -
Benjamin Kott commented on patch set 16 01/24/25, 13:39
Reply
The active button in the dropdown can not have the aria-pressed attribute at it´s only relevant but buttons that change it state on multiple presses, this is not the case here - it´s not a toggle button. -
core-ci voted on patch set 16 V +1 01/24/25, 13:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72976
-
Benjamin Kott commented on patch set 16 01/24/25, 13:43
Reply
Regarding the aria-sort, would love to add this in the future, but in the current way the record and filelist is implemented we have no knowledge about whats rendered inside the columns as we only pass strings and not information around. -
Benjamin Kott commented on patch set 16 01/24/25, 13:46
Reply
regarding pressing the active sorting-entry again should do something "meaningful", is something we should improve upon - but would like to iterate here on a later point as we have no way really to unset the javascript (tablesort) implementation here to restore the original behavior. -
Andreas Kienast voted on patch set 16 CR +1 V +1 01/24/25, 13:51
-
Ayke Halder commented on patch set 16 01/24/25, 13:56
Reply
Regarding active item: It's all about to get any kind of aria-marking: `aria-current`/`aria-selected`/`aria-pressed`/`aria-checked` Thought about toggle like "sorting ascending: on/off" and "sorting descending: on/off" Next thing coming to my mind `<a role="radio" aria-checked="true">` https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/radio_role But maybe `role="listbox` + `<a role="option" aria-selected="true/false">` is even better. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/option_role https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected So these a11y issues are open for improvement in the future. -
Ayke Halder commented on patch set 16 01/24/25, 14:08
May we go for "more usable" here?Same: "usability" -
Benjamin Kott updated the commit message in patch set 17
CR +1V +101/27/25, 08:06 -
Benjamin Kott commented on patch set 17 01/27/25, 08:07
Reply
i am fine adjusting this, even i think the initial wording is totally fine here.Reply
i am fine adjusting this, even i think the initial wording is totally fine here. -
Andreas Kienast voted on patch set 17 CR +1 V +1 01/27/25, 08:09
-
core-ci voted on patch set 17 V +1 01/27/25, 08:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73048
-
Ayke Halder commented on patch set 17 01/27/25, 10:06
Reply
"Accessibility" (A11y) and "accessible" have a well defined meaning: https://www.w3.org/WAI/fundamentals/accessibility-intro/#what > Web accessibility means that websites, tools, and technologies are designed and developed so that people with disabilities can use them. https://developer.mozilla.org/en-US/docs/Web/Accessibility > Accessibility (often abbreviated to A11y — as in, "a", then 11 characters, and then "y") in web development means enabling as many people as possible to use websites, even when those people's abilities are limited in some way. ---- On the other hand wordings like "usability" and "user experience (UX)" can be used without any restrictions.
-
Benjamin Kott commented on patch set 17 01/27/25, 10:58
Reply
The main reason for this change was to improve accessibility, it makes navigation less cluttered and the actions more understandable therefore easier to use. Especially when you are using the keyboard. I understand that this benefits both sides and we can call it UX now. -
Christian Kuhn commented on patch set 17 01/27/25, 13:42
some word missing here. -
Benni Mack updated the commit message in patch set 18
CR +1V +101/27/25, 17:08 -
core-ci voted on patch set 18 V +1 01/27/25, 17:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73061
-
Benjamin Kott commented on patch set 18 01/31/25, 07:25
Reply
Done -
Andreas Kienast voted on patch set 18 CR +1 V +1 01/31/25, 07:34
-
Benni Mack voted on patch set 18 CR +1 V +1 01/31/25, 23:56
-
Benjamin Kott voted on patch set 18 CR +2 V +2 02/03/25, 06:36
-
Benjamin Kott voted on patch set 18 CR -1 V -1 02/03/25, 06:45
-
Benjamin Kott uploaded patch set 19
CR +1V +102/03/25, 07:00 -
core-ci voted on patch set 19 V +1 02/03/25, 07:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73360
-
Andreas Kienast voted on patch set 19 CR +1 V +1 02/04/25, 09:02
-
Benjamin Kott uploaded patch set 20
CR +1V +102/05/25, 14:57 -
core-ci voted on patch set 20 V -1 02/05/25, 15:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73590
-
Benjamin Kott rebased onto patch set 21
V -102/05/25, 15:11 -
Benjamin Franzke voted on patch set 21 V +1 02/05/25, 15:11
-
core-ci voted on patch set 21 V +1 02/05/25, 15:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73591
-
Benjamin Kott uploaded patch set 22
V +102/05/25, 15:31 -
core-ci voted on patch set 22 V +1 02/05/25, 15:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73592
-
Benjamin Kott uploaded patch set 23
V +102/05/25, 15:40 -
Benjamin Franzke voted on patch set 23 CR +1 V +1 02/05/25, 15:40
-
Andreas Kienast voted on patch set 23 CR +1 V +1 02/05/25, 15:42
-
core-ci voted on patch set 23 V +1 02/05/25, 15:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73596
-
Benjamin Kott voted on patch set 23 CR +2 V +2 02/05/25, 15:52
-
Benjamin Kott merged patch set 24 02/05/25, 16:04
DatabaseRecordList.php:1505