Skip to content

Block Editor: Simplify InspectorControlsFill rendering logic - #81286

Merged
im3dabasia merged 1 commit into
trunkfrom
cleanup/inspector-controls-fill-flow
Aug 7, 2026
Merged

Block Editor: Simplify InspectorControlsFill rendering logic#81286
im3dabasia merged 1 commit into
trunkfrom
cleanup/inspector-controls-fill-flow

Conversation

@Mamaduka

@Mamaduka Mamaduka commented Aug 6, 2026

Copy link
Copy Markdown
Member

What?

I was experimenting with deferred inspector rendering and realized the component exit points became a bit hard to follow. This is my attempt to simplify it a little bit.

Changes

  • Names the three context reads as locals (isSelectedBlockisPatternEditingisInListViewTree) instead of repeating symbol lookups.
  • Merges the two visibility checks into one if/else if. The second check's condition was exactly the else branch of the first.
  • Splits the List View popover case into a rendersInListView flag plus its own guard, so routing (which fill to use) is separate from gating (is this the selected block).
  • Returns once, with a single StyleProvider wrapping either fill.
  • Passes children as JSX children rather than as a prop.

Testing Instructions

I think this should have decent e2e test coverage, but a smoke test controls for various blocks - Navigation, Template Parts, Text blocks. Confirm they are rendered as before.

Testing Instructions for Keyboard

Same.

Use of AI Tools

Assisted by Claude.

@Mamaduka Mamaduka self-assigned this Aug 6, 2026
@Mamaduka
Mamaduka requested a review from ellatrix as a code owner August 6, 2026 13:02
@Mamaduka Mamaduka added [Type] Code Quality Issues or PRs that relate to code quality [Package] Block editor /packages/block-editor labels Aug 6, 2026
@Mamaduka
Mamaduka requested a review from talldan August 6, 2026 13:02
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Size Change: -6 B (0%)

Total Size: 7.81 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 434 kB -6 B (0%)

compressed-size-action

@im3dabasia im3dabasia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on the issue!

LGTM ✅

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: im3dabasia <im3dabasia1@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@im3dabasia
im3dabasia merged commit 3f224e6 into trunk Aug 7, 2026
54 of 55 checks passed
@im3dabasia
im3dabasia deleted the cleanup/inspector-controls-fill-flow branch August 7, 2026 14:15
@github-actions github-actions Bot added this to the Gutenberg 23.8 milestone Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block editor /packages/block-editor [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants