Repository navigation
[6.x] Only render Bard toolbar buttons when they're needed - #15768
Merged
Merged
Conversation
duncanmcclean
marked this pull request as draft
November 2, 2026 14:17
# Conflicts: # resources/js/components/fieldtypes/bard/BardFieldtype.vue # resources/js/tests/components/fieldtypes/bard/BardFieldtype.test.js
duncanmcclean
marked this pull request as ready for review
November 2, 2026 18:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves performance on entries with lots of Bard fields by only rendering an editor's toolbar buttons once it's within 500px of being scrolled into view. Bard fields inside collapsed sets, collapsed sections or other tabs get their buttons once they're shown.
Only the buttons are deferred — the editors themselves (and the sets they live in) still mount straight away, so nothing changes about how values are handled.
The
IntersectionObserveruses the Control Panel's scroll region as its root, since that's what actually scrolls. Otherwise, the 500px margin wouldn't apply and toolbars would only render once they were already on screen.On an entry with 43 Bard fields (~1,400 toolbar buttons), this took the time until every editor had loaded from ~4.3s to ~3.6s.
Related: #13385