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

Issue fork drupal-3584347

Command icon 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

znerol created an issue. See original summary.

nicxvan’s picture

andypost’s picture

Not sure it replacable with local storage as any controller which respects compact display of data will be affected

nicxvan’s picture

Yeah, 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.

nicxvan’s picture

Issue summary: View changes

I 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.

nicxvan’s picture

Title: Save admin_compact_mode per user override in localStorage instead of a cookie » Deprecate and replace system_admin_compact_mode()
nicxvan’s picture

Status: Active » Needs review
nicxvan’s picture

Status: Needs review » Needs work
nicxvan’s picture

Status: Needs work » Needs review
mstrelan’s picture

Wondering if this should be an option on the user account instead, similar to how Gin theme allows accounts to configure their preferred appearance.

nicxvan’s picture

@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_mode to admin_compact_mode.

nicxvan’s picture

Status: Needs review » Needs work

I need to figure out how to manage the functional test which is using Mink's cookie management.

nicxvan’s picture

Status: Needs work » Needs review

Added credit from slack so I don't forget.

Catch, Andypost, and Godotislate helped me get the session stuff worked out.

znerol changed the visibility of the branch 3584347-admin-compact-mode-in-frontend to hidden.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new4.62 KB

The 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.