Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Work in progress Stale

83637[FEATURE] Add filter to selectCheckBox fields

Marcin Sągol CR 0 V 0 Normal +187 −0 updated 08/07/26, 19:44

Commit message

The `selectCheckBox` render type is widely used in the
Backend User and Groups management module for setting
various types of permissions. Over time, these checkbox
lists can become lengthy, making it difficult to locate
specific items.

This change introduces a new TCA configuration option
for TCA `select` fields with the render type
`selectCheckBox`, named `showFilter`:

'columns' => [
    ...
    'permissions' => [
        'label' => 'Permissions',
        'config' => [
            'type' => 'select',
            'renderType' => 'selectCheckBox',
            'showFilter' => true,
            'items' => [
                ...
            ],
        ],
    ],
],

The new option is enabled by default and can therefore be
disabled by setting it to `false`.

The filter input will be displayed above the specified
field, allowing users to filter the list by the entered
text. It is also available for read-only fields.

If no items on the list match the filter text, the entire
list will be hidden, and an information message will be
shown, informing the user that no items matched the filter
criteria.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 24
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/37/83637/24 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/37/83637/24 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Issues 1

Files 5

Review log 5983

Show 4158 earlier messages
  1. Marcin Sągol uploaded patch set 1 04/02/24, 11:11

  2. Marcin Sągol uploaded patch set 2 04/02/24, 11:13

  3. Marcin Sągol uploaded patch set 3 04/02/24, 11:16

  4. core-ci voted on patch set 1 V -1 04/02/24, 11:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55151

  5. core-ci voted on patch set 2 V -1 04/02/24, 11:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55152

  6. core-ci voted on patch set 3 V -1 04/02/24, 11:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55153

  7. Marcin Sągol uploaded patch set 4 V -1 04/02/24, 11:26

  8. core-ci voted on patch set 4 V +1 04/02/24, 11:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55154

  9. Marcin Sągol updated the commit message in patch set 5 V +1 04/02/24, 11:35

  10. Marcin Sągol updated the commit message in patch set 6 04/02/24, 11:37

  11. Garvin Hicking commented on patch set 6 04/02/24, 11:40

    With things like this you wonder "hasn't this already existed" :-D Great work on this usability improvement. I wonder though if we really need an extra complexity of the TCA? How about adding that filter input for every checkbox selection that has like more than 5 items? Then an editor could use it directly everywhere, and extensions wouldn't need to be specifically adapted for it...?
  12. core-ci voted on patch set 5 V +1 04/02/24, 11:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55156

  13. core-ci voted on patch set 6 V +1 04/02/24, 11:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55157

  14. Simon Schaufelberger commented on patch set 6 04/02/24, 11:55

    SelectCheckBoxElement.php:83

    This can be simplified to: `(bool)($config['showFilter'] ?? false) === true`
  15. Marcin Sągol uploaded patch set 7 V +1 04/02/24, 12:08

  16. Marcin Sągol commented on patch set 7 04/02/24, 12:11

    Reply

    I am opened for suggestion :) I think more people should share their thoughts on this. I have followed the hideSuggest configuration approach here - to make it configuratble.

    SelectCheckBoxElement.php:83 Reply

    Fixed
  17. core-ci voted on patch set 7 V +1 04/02/24, 12:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55158

  18. Oli Bartsch commented on patch set 7 04/02/24, 14:55

    a

    select-check-box-filter.ts:23

    Let's make this a web component.

    select-check-box-element.ts:98

    Would not be needed as soon as this a web component.

    SelectCheckBoxElement.php:83

    Not sure whether this should better be an `appearance` config.

    be_groups.php:125

    We could make it TRUE by default

    Feature-103515-AddAnOptionToRenderFilterAboveSelectCheckBoxFieldType.rst:14

    TCA Type "select" with render type "selectCheckBox"

    Feature-103515-AddAnOptionToRenderFilterAboveSelectCheckBoxFieldType.rst:17

    let's use :php: instead

    Feature-103515-AddAnOptionToRenderFilterAboveSelectCheckBoxFieldType.rst:45

    This is only because we set it to true in corresponding TCA. I would mention this. Otherwise it sounds like the default is FALSE and we have some special handling for Backend User / Groups.
  19. Simon Schaufelberger wrote 04/02/24, 15:03

    Removed cc Simon Schaufelberger.
  20. Marcin Sągol uploaded patch set 8 V +1 04/09/24, 08:41

  21. Marcin Sągol commented on patch set 8 04/09/24, 08:44

    select-check-box-filter.ts:23 Reply

    I have created first draft of the component.

    select-check-box-element.ts:98 Reply

    Done

    SelectCheckBoxElement.php:83 Reply

    I followed the suggestion 'hideSuggest' => true setting, which wasn't inside the `appearance` group.

    Feature-103515-AddAnOptionToRenderFilterAboveSelectCheckBoxFieldType.rst:14 Reply

    Done

    Feature-103515-AddAnOptionToRenderFilterAboveSelectCheckBoxFieldType.rst:45 Reply

    Done
  22. core-ci voted on patch set 8 V +1 04/09/24, 08:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55592

  23. Andreas Kienast commented on patch set 8 04/09/24, 09:27

    alert.ts:20

    We should limit this to the same capabilities as in `@typo3/backend/notification`. You may make use of `SeverityEnum.notice`.

    select-check-box-filter.ts:29

    IMO this is redundant to the `alert` property.

    select-check-box-filter.ts:68

    This looks superfluous, `typo3-backend-alert` is already registered in `HTMLElementTagNameMap` to be an Alert element.
  24. Marcin Sągol uploaded patch set 9 V +1 06/24/24, 13:36

  25. core-ci voted on patch set 9 V +1 06/24/24, 13:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60176

  26. Marcin Sągol rebased onto patch set 10 V +1 06/30/24, 10:50

  27. Marcin Sągol uploaded patch set 11 06/30/24, 10:55

  28. core-ci voted on patch set 10 V -1 06/30/24, 11:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60664

  29. core-ci voted on patch set 11 V +1 06/30/24, 11:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60665

  30. Marcin Sągol uploaded patch set 12 V +1 06/30/24, 11:40

  31. Marcin Sągol commented on patch set 10 06/30/24, 11:42

    be_groups.php:125 Reply

    I am not sure if this is a good idea. If some list is very short, the filter field might not make sens. Wouldn't it be better to leave the decision to developers if they want to enable this filter or not?

    Feature-103515-AddAnOptionToRenderFilterAboveSelectCheckBoxFieldType.rst:17 Reply

    Done
  32. Marcin Sągol commented on patch set 12 06/30/24, 11:44

    alert-element.ts:1

    To be able to finish this task (make it complete) i had to use the new Alert component, which was introduces as a separate feature patch here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84535
  33. Marcin Sągol commented on patch set 12 06/30/24, 11:46

    alert.ts:20 Reply

    Done

    select-check-box-filter.ts:68 Reply

    Done
  34. core-ci voted on patch set 12 V +1 06/30/24, 11:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60669

  35. Georg Ringer commented on patch set 12 CR -1 V +1 07/04/24, 19:52

    be_groups.php:125 Reply

    IMO we should have it true by default as this is best for the editors. if it is not useful, the developer can decide to disable it - otherwise the setting would be mostly forgotten

    Feature-103515-AddAnOptionToRenderFilterAboveSelectCheckBoxFieldType.rst:1

    please change to 13.3
  36. Garvin Hicking commented on patch set 12 07/04/24, 20:20

    Reply

    as mentioned by Georg, I agree a on having it as a default and opt-out. Resolving this in favor of georgs comment.

    be_groups.php:125 Reply

    I agree. are there core fields where we should disable it?
  37. Marcin Sągol uploaded patch set 13 CR -1 V +1 07/05/24, 08:44

  38. Marcin Sągol commented on patch set 13 07/05/24, 08:47

    be_groups.php:125 Reply

    I think not, for those packages that I have installed, it is used mainly in `be_groups` and `be_users` and for one field in the `sys_workspaces`.

    Feature-103515-AddAnOptionToRenderFilterAboveSelectCheckBoxFieldType.rst:1 Reply

    Done
  39. core-ci voted on patch set 13 V +1 07/05/24, 08:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61023

  40. Oli Bartsch uploaded patch set 14 V +1 07/05/24, 08:59

  41. Oli Bartsch commented on patch set 14 07/05/24, 09:00

    select-check-box-filter.ts:63

    Let's show the icon here. Additionally, this should be "info"

    select-check-box-filter.ts:94

    we can use toggle here

    select-check-box-element.ts:16

    Lets add the module in the element since this component is not directly using it.
  42. Oli Bartsch commented on patch set 14 07/05/24, 09:00

    select-check-box-filter.ts:29 Reply

    Done

    select-check-box-filter.ts:63 Reply

    Done

    select-check-box-filter.ts:94 Reply

    Done

    select-check-box-element.ts:16 Reply

    Done

    SelectCheckBoxElement.php:83 Reply

    Acknowledged
  43. Oli Bartsch uploaded patch set 15 07/05/24, 09:02

  44. Oli Bartsch commented on patch set 15 07/05/24, 09:03

    I really like this feature. Can we please get the alert component in as separat patch? @a.fernandez@scripting-base.de
  45. core-ci voted on patch set 14 V +1 07/05/24, 09:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61024

  46. core-ci voted on patch set 15 V +1 07/05/24, 09:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61026

  47. Marcin Sągol voted on patch set 15 CR +1 V +1 07/05/24, 09:12

  48. Oli Bartsch commented on patch set 15 CR -1 07/05/24, 09:54

    Reply

    -1 until the alert element is merged.
  49. Marcin Sągol commented on patch set 15 07/05/24, 10:53

    Reply

    The patch with Alert component only: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84535
  50. Oli Bartsch uploaded patch set 16 CR +1 V +1 07/05/24, 13:59

  51. core-ci voted on patch set 16 V +1 07/05/24, 14:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61058

  52. Oli Bartsch uploaded patch set 17 V +1 07/10/24, 07:55

  53. Oli Bartsch commented on patch set 17 CR +1 V +1 07/10/24, 07:55

    Reply

    Done

    alert-element.ts:1 Reply

    Done
  54. core-ci voted on patch set 17 V +1 07/10/24, 08:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61290

  55. Georg Ringer voted on patch set 17 CR +1 V +1 07/10/24, 08:01

  56. Andreas Kienast commented on patch set 17 CR -2 07/10/24, 08:06

    Reviewing
  57. Benjamin Franzke commented on patch set 17 CR -1 07/10/24, 08:15

    select-check-box-filter.ts:56

    The alert should be rendered based on *state* (that is properties) in `render()` and not injected as a side-effect to some "other" place in the DOM.

    select-check-box-filter.ts:68

    The entire filter mechanism suboptimal, as we simply "modify" markup that does not belong to this component. A filter mechanism should render based on state and the list of options would need to be *rendered* by the *filtering* component.

    SelectCheckBoxElement.php:162

    Webcomponents do not support self-closing tags
  58. Marcin Sągol uploaded patch set 18 CR +1 V +1 07/10/24, 08:47

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  1. core-ci voted on patch set 18 V +1 07/10/24, 08:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61299

  2. Marcin Sągol uploaded patch set 19 V +1 07/10/24, 09:50

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  3. Marcin Sągol commented on patch set 19 07/10/24, 09:52

    select-check-box-filter.ts:56 Reply

    Please check now.

    select-check-box-filter.ts:68 Reply

    It would be great if someone more experienced could refactor it, I am not sure how it should be done properly.

    SelectCheckBoxElement.php:162 Reply

    Done
  4. core-ci voted on patch set 19 V +1 07/10/24, 09:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61304

  5. Oskar Dydo uploaded patch set 20 V +1 09/04/24, 12:21

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  6. core-ci voted on patch set 20 V +1 09/04/24, 12:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64752

  7. Oskar Dydo commented on patch set 20 09/04/24, 22:09

    select-check-box-filter.ts:56 Reply Unresolved

    @ben@bnf.dev Could you please verify if the previous changes met your expectations?

    select-check-box-filter.ts:68 Reply Unresolved

    @ben@bnf.dev Do you have any updates on this?
  8. Oskar Dydo uploaded patch set 21 V +1 09/06/24, 08:27

    Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**")
  9. core-ci voted on patch set 21 V +1 09/06/24, 08:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64917

  10. Guido Schmechel commented on patch set 21 V +1 09/07/24, 16:16

    Nice feature! Worked very well.
  11. Andreas Kienast voted on patch set 21 CR 0 09/07/24, 20:08

  12. Garvin Hicking commented on patch set 22 V +1 09/07/24, 20:23

    Published edit on patch set 21.
  13. core-ci voted on patch set 22 V +1 09/07/24, 20:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65026

  14. Garvin Hicking commented on patch set 22 V +1 09/07/24, 20:34

    Works for me, however sadly can't code-review the JS.
  15. Markus Klein commented on patch set 22 09/13/24, 10:50

    Feature-103515-AddAnOptionToRenderFilterAboveSelectCheckBoxFieldType.rst:6 Unresolved

    added an option docs are past tense
  16. Markus Klein commented on patch set 23 V +1 09/13/24, 10:51

    Published edit on patch set 22.
  17. core-ci voted on patch set 23 V +1 09/13/24, 10:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65664

  18. Guido Schmechel voted on patch set 23 V +1 09/13/24, 14:51

  19. Garvin Hicking voted on patch set 23 V +1 09/14/24, 11:18

  20. Benni Mack commented on patch set 23 03/21/25, 14:59

    whats the status here?
  21. Tymoteusz Motylewski commented on patch set 23 03/24/25, 19:21

    Reply Unresolved

    AFAIK - the change worked as expected, however as Benjamin commented, the solution was suboptimal - the authors (Marcin and Oskar) asked for guidance but didn't get it Next steps: - get guidance from the core team how this should be implemented properly - rebase and adapt the patch according to the guidance
  22. Benni Mack marked it work in progress 04/21/26, 14:56

  23. Benni Mack wrote 04/21/26, 14:56

    Removed cc Benni Mack.
  24. Marcin Sągol uploaded patch set 24 V +1 08/07/26, 19:37

  25. core-ci voted on patch set 24 V +1 08/07/26, 19:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106138