Closed (fixed)
Project:
Display Builder
Version:
1.0.x-dev
Component:
UI/UX/Islands
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Dec 2025 at 17:08 UTC
Updated:
24 Oct 2026 at 08:13 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
pdureau commentedComment #3
pdureau commentedComment #4
pdureau commentedComment #5
mogtofu33 commentedComment #6
mogtofu33 commentedComment #7
pdureau commentedComment #9
pdureau commentedThe main issues are fixed:
DeclarativeShadowDomRenderer::render()call to ProfileViewBuilder and by moving the existing call from DisplayBuilderEventsSubscriber to HtmxTrait::addOutOfBand()So, Drupal side, we are good.
However, we have 2 JS issues to solve:
link rel="stylesheet"calls are not applied in the DSDthe shadowroot is lost after an OOB swap✅ a workaround has been foundComment #10
pdureau commentedThe proposal has changed: now we render the display builder with admin theme and we display builder & preview panels with front theme (and let's not forger the preview popovers in library).
It was the opportunity of cleaning and fixing a lot of thing in the
DeclarativeShadowDomRendererbut it sill don't work:A proposal:
DeclarativeShadowDomRendererat the panel level anymore, so we remove the entry fromDrupal\display_builder\Attribute\IslandDeclarativeShadowDomRenderer::render()for each source: the blocks and components in the shadow root, the dropzone in the slotted areaChristian will continue the work. Careful, only PageLayout has been moved to admin theme. We need to move EntityView, EntityViewOverride and Views to admin theme too.
Comment #11
pdureau commentedComment #14
pdureau commentedNew commit on MR https://git.drupalcode.org/project/display_builder/-/merge_requests/183.
Rebased ✅ The pipeline is green ✅
Loaded with admin theme by default:
Logic moved out the island plugin attributes:
DeclarativeShadowDomRenderer::render()for each source: the blocks and components in the shadow root, the dropzones in the slotted area > ⚠️ TODOApiPreviewControllerApiPreviewControllerRemaining work:
link rel="stylesheet"calls are applied in the DSD however, there is still a little something wrong: with UI Suite DaisyUI, most of the styles are missing; with UI Suite Bootstrap, most of them are OK but sometimes missing at the root level. Maybe we are not retrieving all the asset libraries inDeclarativeShadowDomRenderer::addThemeLibraries(), maybe there is something to do at the shadow dom levelDeclarativeShadowDomRenderer::wrapInShadowDom()(div { color: red }), it can be removed.Comment #15
christian.wiedemann commentedComment #16
pdureau commentedComment #17
pdureau commentedComment #18
pdureau commentedJust talked with Christian.
We keep the goal to render everything with backend theme, except those 3 parts in frontend theme:
BuilderPanel: only the blocks and components markup (the dropzones stays in backend theme)PreviewPanel: everythingComponentLibraryPanel&BlockLibraryPanel: only the preview popupAnd we will keep trying with declarative shadow dom, because we never trigger AJAX/HTMX events from the shadow dom:
But we will replace the
renderInContextmechanism from https://git.drupalcode.org/project/display_builder/-/merge_requests/183 bysubrequest(inspired from the work in https://git.drupalcode.org/project/display_builder/-/merge_requests/206 ) mostly becauserenderInContextshare caching with the main rendering task, so stuff are not properly loaded and rendered.So, it will be a work in 2 steps:
renderInContextmechanism from https://git.drupalcode.org/project/display_builder/-/merge_requests/183 bysubrequestWe are "afraid" the result may be slow because:
subrequestis slower than code>renderInContextBut we will evaluate this after having a working proposal.
Comment #19
christian.wiedemann commentedI add the subrequest handling to an own branch and updated the shadow dom handler to support it. I used an application handler to seperate the CSS and JS for htmx updates. The display is rendered and updated correct but klicks inside the shadow dom not working anymore and i am not sure why. Probpalby something wrong with the sloted stuff. Let's discuss tommorow
Comment #20
pdureau commentedInside the Shadow Dom, we are OK if the markup behave like https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attri... attribute (and we are still OK if it is not):
It is not a bug, it is a feature :)
That's why we put the dropzones (the main interactive elements of the builder panel) in the slotted content instead of the shadow dom.
Comment #24
pdureau commentedNot very visible here because we work on a specific branch out of the current MR, but we do great progress.
However, if we need more time to finish and we can't land this in the beta3 coming soon, we can propose a very small issue to reduce the gap: #3575339: Clean leftovers of first Declarative Shadow Dom attempt
Comment #25
pdureau commentedComment #29
pdureau commentedSome news of the current work. We work on 2 branches.
3562060-follow-up-render-ui
MR targeting
1.0.x.: https://git.drupalcode.org/project/display_builder/-/merge_requests/183With one Declarative Shadow Dom by component or block in BuilderPanel.
Works already pretty well, but some issues:
3562060-follow-up-render-ui-event-bubbler
MR targeting
3562060-follow-up-render-ui: https://git.drupalcode.org/issue/display_builder-3562060/-/merge_requests/2With a single Declarative Shadow Dom and a single sub-request for all BuilderPanel. So, the 2 performance risks of the other branch are addressed, but:
For both branches
Topics to discuss:
PageLayoutSourceplugin can be rendered only in the "context" of the front theme, whcih is missing in DSDDeclarativeShadowDomRenderermust be a render element instead of a service ?html--ds-shadow-dom.html.twigandpage--ds-shadow-dom.html.twig? We need to project ourselves, and Drupal, in a world withoutThemeManager::render()Comment #30
pdureau commentedTalked with Christian. Priority to #3555110: Symmetric translation for now.
Comment #31
pdureau commented100 days later, I have rebased 1.0.x on https://git.drupalcode.org/project/display_builder/-/merge_requests/183
And https://git.drupalcode.org/project/display_builder/-/merge_requests/183 on https://git.drupalcode.org/issue/display_builder-3562060/-/merge_requests/2
And squashed both branches into a single commit each, easier to rebase
The dream would be to have best of both branches:
Comment #32
pdureau commentedBut, this is still not the priority now.
Comment #33
pdureau commentedSome news about: https://git.drupalcode.org/project/display_builder/-/merge_requests/183
The proposal with one Declarative Shadow Dom by component or block in BuilderPanel.
It works like that:

Good:
To investigate:
html--ds-shadow-dom.html.twigandpage--ds-shadow-dom.html.twig? We need to project ourselves, and Drupal, in a world withoutThemeManager::render()Comment #34
mogtofu33 commentedSome help from AI to detect the problems and solution in relation to #3576683: [meta] UX refresh.
Structural limitations (not fixable — must be accepted or routed around)
Comment #35
pdureau commentedThanks for the help.
Indeed, this is one of the already identified remaining issues.
Interesting, I will investigate.
We are already meeting this issue outside of the current ticket scope, because of our "dropzone" markup in-between a parent component slot and its children. DSD is neither fixing nor making it worse for now, and I am hoping it can help us mitigate it.
We are already meeting this issue outside of the current ticket scope, see #3542003: Responsive viewports with iframes. DSD is neither fixing nor making it worse.
I don't see how it is a problem but I may be missing something. Playwright tests are green without needing adaptions.
Comment #36
mogtofu33 commentedComment #37
pdureau commentedRebased.
Styling boundaries
We still have the issues previously discussed.
Indeed. Can we merge the body attributes into the shadow content attributes?
It may be related to
shadowRootModeproperty inDeclarativeShadowDomRendererwhich is currently managed like that:declarative_shadow_dom.jswhich is opening it after loadSome ideas:
:rootinside each declarative shadow dom?:rootas a wrapper at the top of the root panel, so variable will be initialized and will "pierce"It already works well with the current state of the MR:
DOM manipulation
It was not an issue until the big UX revamp of July, all mechanisms were working well during manual testing and the playwright tests were all green.
However, we now have playwright fails which may be related to DOM traversing:
and some false negative (we don't manually reproduce the issue, we may just need to adapt
element.dragTo(target, {):Comment #38
pdureau commentedComment #39
mogtofu33 commentedComment #40
pdureau commentedEnthusiasm for this task has been warmly expressed during DrupalCon Rotterdam's demos & workshops 😉
So, here is the current state after a big rebase and the addition of
assets/js/shadow_root_styles.jsCore needs a patch
Solution found 🎉 We were missing a Core patch!
I will create a Core issue soon.
What is already OK
General:
.gin--navigation-top-barwhich is always displayed with a breadcrumb for admin pages with Core GinIn Builder/Scaffold:
In Library panels' preview pop-ins:
By spliting DSD in root and non-root versions:
bodyelement (example: DaisyUI), so only copybodystyles in the root shadow dom.shadowrootmode="closed"for the root (it doesn't need to inherit custom properties to ancestors), but it doesn't render properly when closed, so let's keep it open;Tests:
display_builder_theme_testis the only front theme installednavigationmodule is not installed⚠️ Playwright fails in the pipeline don't happen on local environment and may be related to the absence of the Core patch.
Remaining work
scaffold.spec.ts:17:5 › Move tests @extra: it doesn't seem related to the changesNext step?
The proposal add less than 300 lines of PHP and 100 lines of JS (tests excluded), so it is kind of tight, but we may be able to clean it a bit:
db-blockcustom element?$htmx_routefromDeclarativeShadowDomRenderer::executeSubrequest()?$adminfromDeclarativeShadowDomRenderer? It is always FALSE as far as I knowDeclarativeShadowDomPageVariantSubscriber?html--ds-shadow-dom.html.twigandpage--ds-shadow-dom.html.twigtemplates and their associated logic?Christian may have an idea to have a single DSD for the full builder (the current approach has nested DSD, it is totally fine in my opinion, but challengeable if we have better idea).
Comment #42
pdureau commentedIt works :)
3 commits in the MR:
feat: #3562060 Render UI with admin theme: the proper change, but need a Core patchWithout Core patch: less elegant, with one additional JS file, but don't need the Core patchUnrelated phpstan fixesNotice for the reviewer:
OverrideDisplayTabs: Canonical page lists the rendered display only: ✘ Current display is excluded from its own list. Am I wrong?Local tests:
DaisyUI
Bootstrap
DSFR
Next steps / Follow-ups:
Comment #43
pdureau commentedFollowing our today meeting, assigned to you for review. Don't hesitate to ask questions if necessary.
For your information, I have removed the form.css content because it was the most relevant place to check unaltered admin theme rendering.
Comment #45
mogtofu33 commentedSome fixes and cleanup, here is the compare but did not rebase
3562060-follow-up-render-ui, so perhaps including other merged fix.Comment #46
pdureau commentedThanks for the compare, that's convenient. I will push the 3562060-follow-up-render-ui rebase to help me visualizing this.
Comment #47
pdureau commentedMR 468 review.
Feature review
DaisyUI
Bootstrap
DSFR
Cool stuff:
Other feedback:
Code review
A look on the gitlab compare page:
OverrideDisplayTabsphpunit fail (Current display is excluded from its own list) is fixedDeclarativeShadowDomPageVariantSubscriber,db-block,$adminfromDeclarativeShadowDomRenderer...RenderableBuilderTrait::wrapContent()data-db-shadow-body. May be useful.ThemeHooks::stripChrome()now the builder page is not rendered in front theme anymore. However, ⚠️ do we still need_display_builder_full_page_route?hook_themehave been added insrc/Hook/ThemeHooks.phpinstead of manipulating the registry. It is not blocking the MR, but is is sad we are back to rely on ThemeManager API while we are pushing to replace them.display_builder.twig,ApiControllerBase,ProfileViewBuilder) I am struggling to understand and evaluateComment #48
pdureau commentedHi Jean,
Thanks for the new MR which is improving the DSD proposal while removing 90 lines of PHP code.
I move the ticket to RTBC, knowing:
DeclarativeShadowDomRenderer::executeSubrequest(),hook_theme,_display_builder_full_page_route...field:node:article:field_test[value][sources][0][_weight])Comment #51
mogtofu33 commentedComment #53
pdureau commented