Problem/Motivation
At the moment you have four grey buttons close to each other: Date created, Filters, List and Grid. Those four buttons look nearly identical, only exception is the Filters button which happens to have an icon alongside. As a sighted user you have to read or at least visually scan each button and cognitively process its text. Except the aforementioned icon for the Filters button there isn't any visual queue for alternative ways of orientation and processing.

Proposed resolution
The cognitive load, understanding what the function of the last two buttons is, might be lowered. Instead of relying entirely on reading and visually scanning it might be easier to use familiar icons for sighted users for the list and grid buttons. Those might be an icon with three or four horizontal lines for the list button and one icon with four squares in a 2x2 grid for the <code>grid button. Those icons users are already familiar with from web and desktop apps. For screenreader users it would be no difference in the output to before if the aria-label attribute would be added to the buttons.
Remaining tasks
- ✅ File an issue about this project
- ☐ Manual Testing
- ☐ Code Review
- ☐ Accessibility Review
- ☐ Automated tests needed/written?
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | icon-order.png | 4.29 KB | libbna |
Issue fork project_browser-3293937
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
omkar-pd commentedAdded four horizontal lines icon for
listand 2x2 icon forgridas proposed.Comment #5
libbna commentedI will review this
Comment #6
libbna commentedIcons are added perfectly as mentioned in "proposed solution".
Marking this as RTBC.
Comment #7
narendrarComment #8
narendrarImage links can be updated as per suggestion in related issue.
Comment #9
omkar-pd commentedAdded
drupalSettings.project_browser.origin_urlanddrupalSettings.project_browser.module_pathto constants.js and updated the image links using constants.Comment #10
narendrarLooks good to me. Thanks 👍
Comment #11
aarti zikre commentedVerified Merge request on Drupal 9.5.x dev version
https://git.drupalcode.org/project/project_browser/-/merge_requests/185/...
Testing Steps:
* Install a new Drupal instance
* Clone Project browser module using git clone https://git.drupalcode.org/project/project_browser.git
* Add & fetch this issue fork’s repository using
git remote add project_browser-3293937 git@git.drupal.org:issue/project_browser-3293937.git
git fetch project_browser-3293937
* Switch to that branch
git checkout 3293937-add-icons-to
* Clear all catches
* Go to /admin/modules/browse
Test Result
Both list and grid buttons have the icon. By default grid is selected also all switching to another view mode is working as expected.
Refer SS

Test: Pass
Can be move to RTBC
Comment #12
tim.plunkettThis MR now contains parts of #3293424: Be consistent in using origin_url (and consider making it easier to include).
Either we need to remove that from here and fix it all in the other issue, or this issue should wait on the other to be fixed first.
Comment #13
omkar-pd commentedI think this issue is ready to be merged. maybe we can remove it from here and fix all in other issue. What's your suggestion?
Comment #14
libbna commentedYes! We can remove the changes from here and merge this issue because the change is at only one place and removing it will not be a big task.
Comment #15
rkollerI also don't mind where this issue here is fixed. either in this issue or in the one linked in #12. Wherever it is most suitable and convenient from a developer point of view. Only one or two comments about the patch in general since I was finally able to test in the browser.
1) the grid icon isn't in line with the requirement for the iconography in the drupal design system in the drupal wiki (see https://www.drupal.org/docs/core-modules-and-themes/core-themes/claro-th...). outlined versions should be avoided.
2) my initial suggestion in the issue summary was to add the icons without any visible text - and I still would prefer that variant. but by showing an icon with a visible text then the order should be switched and the icon be shown first and the text be appended as shown in the drupal design system figma file: https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/💧-Drupal-Design-system?node-id=553%3A0
already mentioned one caveat in that context in comment #20 [#3293929#comment-14619621]. not sure if non primary buttons are intended to have icons.
Comment #16
omkar-pd commentedMade all the changes.
Summary:-
1. Changed outlined version of grid icon.
2. Switched order of the icon as per #15.
3. Also removed part of the code from Be consistent in using origin_url (and consider making it easier to include).
Comment #17
libbna commentedReviewed the last MR and it LGTM. The constants, ORIGIN_URL and MODULE_PATH has been removed and also the the position of the icon and text is also changed (adding screenshot).
Comment #18
tim.plunkettThanks! Merged