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:
Refactor the admin compact mode into a flag in localStorage, similar to tabledrag, form user info, toolbar, etc.
Option 2:
Lightweight service that toggles the cookie
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.
Comment #19
nicxvan commentedComment #20
znerol commentedComment #21
znerol commentedTagging for frontend FM review.
Comment #24
nicxvan commentedComment #25
nicxvan commentedComment #27
nicxvan commentedI think this is ready, all of my feedback has been addressed.
This still needs front end framework signoff, but I think we can mark it now and get reviews.
I've reached out in slack a couple of times for FFM review.
Comment #29
quietone commentedI added "()" after the function and method name in the @trigger messages, per the "how to deprecate' documentation. Since that is all I did I am leaving this at RTBC.
Comment #30
znerol commentedThanks @quietone.
Comment #31
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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.
Comment #32
znerol commentedResolved a merge conflict in
system.post_update.php.Comment #33
nicxvan commentedLooks good, thanks!
Same caveats as 27 though.
Comment #34
znerol commentedI pinged accessibility folks in slack, follow-up to improve that part: #3593539: [PP-1] Replace compact mode link with a switch to improve accessibility.
Comment #35
kentr commentedFTR, I think this also needs an event handler for the
SPACEkey. It's functioning as a button in the MR, and buttons are operable by theSPACEkey. But since it's still a link in the markup, that could also cause confusion.So, unless we also change it to a
buttonor addrole="button"here, I'm not sure that waiting to add that event handler in the accessible makeover #3593539: [PP-1] Replace compact mode link with a switch to improve accessibility will make things worse.Comment #36
znerol commentedIt hardly can be worse than the UX in
mainright now. Just recall that clicking that link currently results in a whole new page load. While not perfect, at least the reading position is preserved with this MR.Comment #37
longwaveAdded some review feedback, MR also needs rebasing.
Comment #38
znerol commentedComment #39
nicxvan commentedAll of the feedback has been addressed.
The test changes look good, but I'm not super familiar with this type of testing.
Comment #40
nicxvan commentedComment #41
longwavePushed a small change that swaps SimpleXML for DOM so we can use
Html::load()and use more correct XPath, leaving at RTBC while tests run.Comment #42
nicxvan commentedI reviewed the most recent updates to the test, they look good, but same caveat as 39.
Comment #43
jurgenhaasComment #44
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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.
Comment #45
znerol commentedRebase after #3586221: Remove the Stable 9 theme.
Comment #46
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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.
Comment #47
znerol commentedRebased after #3572350: Disable the default /node listing view, replace Olivero hardcoded welcome page from /node with welcome message
Comment #48
nicxvan commentedRebase looks good, I bumped the deprecation from 11.4 to 11.5.
I'll keep an eye on tests.
Comment #49
znerol commentedBack to NR for the CSS change, also the functional test had to be adapted slightly.
Comment #50
nicxvan commentedChanges look good!
Comment #51
longwaveWhat happened to #41, did it get lost in a rebase? It makes the test simpler if we use DOM instead of SimpleXML:
https://git.drupalcode.org/project/drupal/-/merge_requests/15633/diffs?c...
Comment #52
znerol commentedUh, I have no idea how this happened. I've cherry-picked the commit. For reference:
Comment #53
nicxvan commentedWeird, yeah that must have been a bad rebase or something, I've been checking the commits for the changes each RTBC cycle.
Comment #54
nicxvan commentedCleaning up the IS so the icons work.
The failure is random, it's the theme settings Functional js test.
Comment #56
larowlanCommitted to main.
Moving to patch to be ported for 11.x backport - doesn't apply cleanly - conflict on system.site.yml
Comment #57
larowlanHolding off publishing the change record until it is in 11.x
Comment #60
longwaveComment #61
nicxvan commentedUnfortunately there are a bunch of failures, it looks like migrate tests.
Comment #62
mstrelan commentedI mostly see "MySQL has gone away" errors, let's see if re-running it helps.
Comment #63
nicxvan commentedI compared the two, the changes are identical, the migration fixtures have the config key that was deprecated so it's throwing an error. I did see some of those other errors too.
Comment #64
nicxvan commentedIt's much fewer, but still legitimate:
Do we just ignore the deprecations?
Comment #65
nicxvan commentedPushed up ignore deprecations for each, not sure if the expect user deprecation is required or not, but I'm not sure it's necessary here since these tests have been removed in main already.
Comment #66
nicxvan commentedI think it's ok for me to RTBC here, it's a bit of a stretch.
My only contribution was adding the
IgnoreDeprecationsattribute to the four tests that use the deprecated configuration that have already been removed in main: https://git.drupalcode.org/project/drupal/-/merge_requests/16682/diffs?c...I compared the commit in 55 to the MR in 59 and they were identical.
Comment #67
longwaveI think we should remove the migration instead of ignoring the tests?
Comment #68
nicxvan commentedThat is a better fix!
Thanks for taking care of that.
The backport is exactly the same except it pulls out migrating the admin_compact_mode setting and removes the explicit test for it.
Comment #69
nicxvan commentedComment #71
larowlanCommitted and pushed 3e3315d6037 to 11.x. Thanks!
Published change record