Problem/Motivation
The backend parts of these were attempted to be moved in #3611762: Move toolbar hook implementations to the toolbar module but in many cases the utility classes, CSS/JS libraries, etc. stayed around with the modules apparently.
-
1. \Drupal\announcements_feed\LazyBuilders:48 — uses toolbar CSS classes and announcements_feed/drupal.announcements_feed.toolbar library.
2. User module integration in user.services.yml:53 — defines user.toolbar_link_builder and ToolbarLinkBuilder.php itself, despite the hook already moved to Toolbar.
3. Contextual menu integration for Toolbar has this toggle feature that shows ALL the contextually editable things. Navigation does not implement this. It was decided in #3465295: Integrate Top Bar Navigation with Contextual editing 2 years ago not do that. The hook implementation was moved to Toolbar already but contextual.libraries.yml:25 was not.

Steps to reproduce
Proposed resolution
Move the remaining toolbar-only code from the three modules into Toolbar. Icons the modules still use themselves stay where they are and Toolbar references them in place. Icons that are only used in Toolbar move to Toolbar.
User
Drupal\user\ToolbarLinkBuildermoves to user module along with the service definition (and name).- The
.toolbar-icon-userrules move fromuser/drupal.user.iconsinto Toolbar's icon stylesheet and its Claro and Default Admin variants. The library is removed.person.svghad no other users, so it moves tocore/modules/toolbar/icons. big_pipe_testused the old service as an arbitrary lazy builder. It now has its own callback.
Contextual
contextual/drupal.contextual-toolbar(edit mode JS and tab CSS) becomestoolbar/toolbar.contextual. JS namespaces are unchanged.- The
.toolbar-icon-editrules move into Toolbar's icon stylesheets. The pencil icon stays incore/misc/iconsas it is used elsewhere.
Announcements
LazyBuildersandRenderCallbacksand service definition move to Toolbar.announcements_feed/drupal.announcements_feed.toolbarmoves to toolbar. The bell icon stays in the announcements module as the dialog stylesheet uses it too.- The renderer, controller, block, dialog and page libraries stay. The block uses them without Toolbar.
Remaining tasks
Review.
User interface changes
Introduced terminology
API changes
Renamed without deprecation similar to #3620812: Move toolbar support from Workspaces to Toolbar:
Drupal\user\ToolbarLinkBuilderDrupal\announcements_feed\LazyBuildersDrupal\announcements_feed\RenderCallbacksuser.toolbar_link_builderserviceannouncements_feed.lazy_buildersserviceuser/drupal.user.iconslibrary,contextual/drupal.contextual-toolbarlibrary,announcements_feed/drupal.announcements_feed.toolbarlibrary
Data model changes
Release notes snippet
LLM disclosure
LLM was used to find the issues and partially to resolve them. With human review.
| Comment | File | Size | Author |
|---|
Issue fork drupal-3618746
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:
- main
compare
- 3618746-11-x
changes, plain diff MR !17116
- 3618746-move-supporting-php
changes, plain diff MR !16859
Comments
Comment #2
gábor hojtsyComment #4
quietone commentedI created an issue for #1 as a sibling #3618772: Move toolbar_alter hook implementations to the toolbar module.
Comment #5
virag.jain commentedWorking on it. As @quietone has already addressed #1, so I’ll pick up the remaining work.
Comment #6
gábor hojtsyWe can keep announcements in #3618772: Move toolbar_alter hook implementations to the toolbar module I think, but then it needs to cover the library and the PHP class :)
Comment #7
gábor hojtsyRemoved the announcements feed item from the summary.
Comment #8
gábor hojtsyComment #9
quietone commentedI am adding back the items in the announcements module except the moving of the toolbar_alter hook. That is one piece of this that can be scoped separately.
This needs an issue summary update to state how things are being moved around.
Comment #10
quietone commented@virag.jain, For Drupal core, it is preferred that contributors add a comment that they are working on an issue instead of assigning it to themselves. See Assigning ownership of a Drupal core issue. Since you have commented, thank you, I am unassinging this issue.
Comment #11
quietone commentedLet's have a concise title
Comment #12
virag.jain commentedThanks @quietone for the correction. I’ll keep it in mind for future issues.
Should I work on the User, Contextual, or Workspaces pieces? Just checking so we don’t duplicate effort.
Comment #13
quietone commented@virag.jain, anything you like!
Comment #15
longwaveAre the icons used anywhere outside of Toolbar? If not we need to move them to Toolbar itself and remove them from core. Looking at the CSS path references we might need to do that anyway, as we don't know which directory level the contrib version of the module will be installed at (and hence how many
../we need)Comment #16
quietone commented@virag.jain, Drupal core relies on the issue summary here on the issue and that is where reviewers expect to find the overview of what is happening on any issue. Can you move the summary of changes to the 'proposed resolution' section. Thanks.
Comment #17
quietone commented@virag.jain, thanks for your work.
Still to do are Announcements, Contextual and Workspaces
Comment #18
catchSplit workspaces to its own issue #3620812: Move toolbar support from Workspaces to Toolbar for easier review/commit hopefully.
Comment #19
gábor hojtsyRemoved workspaces from issue summary following the breaking that out to #3620812: Move toolbar support from Workspaces to Toolbar. Looking at the rest of the items myself now.
Comment #20
gábor hojtsyAdded coverage for contextual and announcements. (LLM was involved).
Comment #21
gábor hojtsyComment #22
gábor hojtsyComment #23
quietone commented@gábor hojtsy, thanks.
I removed toolbar from comments in two files.
And it is still used in a comment in a twig file.
Comment #24
gábor hojtsy@quietone: good find, that template has nothing to do with how its triggered, so it should not say how it is triggered :) I updated it. Does this look complete now?
Comment #25
quietone commentedAfter applying the diff a simple grep for 'toolbar' in the modules changed in the MR returned no instances.
So we have all the instances. However, I lack the frontend knowledge 'to do a proper review on this, so leaving at needs review.
Comment #26
larowlanLeft a review
Comment #27
gábor hojtsyBack at needs review.
Comment #28
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 #29
quietone commentedComment #30
catchLet's do it.
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
quietone commentedRebased, conflicts due to #3620812: Move toolbar support from Workspaces to Toolbar
And somehow I messed up the rebase and there are not failing tests I am not able to fix. Sorry about that.
Comment #34
godotislateOK, compared diffs for the last good MR tag:
previous/3618746-move-supporting-php/2026-09-10with the current MR branch and looks like the addition of thetoolbar.contextualgot left out. Failing tests pass locally with the change restored, so pushing.Comment #35
godotislateTest pass now. Putting back to NR so that someone can double check the rebase.
Comment #36
catchhttps://git.drupalcode.org/project/drupal/-/merge_requests/16859/diffs?d...
I think the views router rebuild change crept in from another issue.
Comment #37
godotislate@catch are you maybe looking at an old diff? https://git.drupalcode.org/project/drupal/-/merge_requests/16859/diffs Doesn't have the Views changes.
Comment #38
catchNot sure how I managed that, but yes I can't see the views changes in there now.
Comment #39
catchBack to RTBC in fact, the rest looks fine.
Comment #40
longwaveAdded some questions about SVG files.
Comment #41
quietone commentedFirst, thanks for cleaning up my mistakes!
I left comments in the MR to answer the queried by @longwave. The short answer is I think this MR is fine as is and a followup can be made to check all the URLs used in the css files.
I am posting here because comments made on an MR are not being posted here as well.
Comment #42
quietone commentedBetter yet, setting back to RTBC
Comment #44
catchCommitted/pushed to main, thanks! Moving to 11.x for backport.
I opened #3622941: Copy icons into toolbar for the icons.
Comment #46
quietone commented11.x MR ready for review
Comment #47
smustgrave commentedSeems like a good backport.
Comment #49
catchCommitted/pushed to 11.x, thanks!