Problem/Motivation
Some administrative lists and tables can be viewed in a compact mode where descriptions are hidden to reduce clutter. One example is the permissions page.
Unlike other front-end settings, this flag is stored as a cookie. A call to the system.admin_compact_page is made in order to set/unset it. This is the last usage of user_cookie_save() and is also inconsistent with other frontend only flags which are stored in localStorage.
Steps to reproduce
Proposed resolution
Option 1: https://git.drupalcode.org/project/drupal/-/merge_requests/15582
Lightweight service that toggles the cookie
Option 2:
Refactor the admin compact mode into a flag in localStorage, similar to tabledrag, form user info, toolbar, etc.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3584347
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 #2
znerol commentedComment #3
nicxvan commentedI think we should take care of this here #3571172: Deprecate system_sort_themes() and system_check_directory() in system module
Comment #4
andypostNot sure it replacable with local storage as any controller which respects compact display of data will be affected
Comment #5
nicxvan commentedYeah, all of the core interactions with this do it server side, I'm not sure a localStorage replacement is appropriate.
I will work on a quick MR that just converts it to a singleton service.
Comment #7
nicxvan commentedI put option1 in the MR, if you see a way to put it in localStorage without refactoring all of the code using it significantly please let me know.
Comment #8
nicxvan commentedComment #9
nicxvan commentedComment #10
nicxvan commentedComment #11
nicxvan commentedComment #12
mstrelan commentedWondering if this should be an option on the user account instead, similar to how Gin theme allows accounts to configure their preferred appearance.
Comment #13
nicxvan commented@mstrelan I had a discussion in slack with @catch and @andypost about this.
We ended up settling on moving it to session and remove the cookie entirely.
I added a new CR for this and renamed
Drupal_visitor_admin_compact_modetoadmin_compact_mode.Comment #14
nicxvan commentedI need to figure out how to manage the functional test which is using Mink's cookie management.
Comment #15
nicxvan commentedAdded credit from slack so I don't forget.
Catch, Andypost, and Godotislate helped me get the session stuff worked out.
Comment #18
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.