Repository navigation
Conversation
|
Size Change: +372 B (0%) Total Size: 7.72 MB 📦 View Changed
|
|
Flaky tests detected in e79b003. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/29392009273
|
|
This works well. I thought that maybe it'd also select the list view tab when selecting one of the blocks that's shown there, but it doesn't. So it's a lot more minimal than I expected, and that might be a good thing this close to beta. 😄 I tested the 'Edit navigation' button changes from Navigation: select list view tab on contentOnly. Alternative with explicit solution, and that still works. However, if you click 'Edit navigation' and then select a different block that doesn't have list view support, the List View tab still remains open, so the behavior feels a bit inconsistent there. |
Thanks for testing. I'll take a look 👀 |
1a3b66f to
8e0fb02
Compare
|
I'll keep this one simmering and see if I can crack something that's consistent. Might need more thorough testing. Cheers! |
|
I'm listing some preliminary scenarios (need validating) to handle so I can come back to test: Content block selection while on List View → switches to Content tab
List child selection while on Content tab → switches to List View
Intentional List View switches are preserved (not undone by reset)
No-op scenarios (tab stays where it is)
|
0b7ef83 to
f98d3e1
Compare
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Sorry I forgot to reply to this. I just retested according to the steps in #75578 Kapture.2026-03-06.at.11.22.51.mp4Are you still seeing the list view tab remaining open, or am I looking in the wrong place? |
f98d3e1 to
dc35086
Compare
dc35086 to
a44940f
Compare
a44940f to
31e087a
Compare
31e087a to
6cbb4b2
Compare
6cbb4b2 to
1bd4937
Compare
1bd4937 to
169e1d2
Compare
169e1d2 to
f3bb57a
Compare
When editing a pattern, the block inspector could get stuck on the List View tab. Clicking a list-view-enabled content item such as Buttons in the Content tab switches to List View, but selecting a different block afterwards left the tab there, because the section block's clientId never changes and the existing reset only ran on that. Track the selection instead: - Selecting a content item while on List View returns to the Content tab. - Selecting a block inside a list-view-enabled content item switches to List View and opens that item's panel, leaving panel state alone when it is already open so focus is not dropped. - Explicit switches, from the content list or from requestInspectorTab, record the block they were made for so the reset does not undo them. Add getListViewChildParentId as a private store selector, re-query the List View content popover anchor after the list remounts, and cover the behaviour with store, component and end-to-end tests.
e493134 to
afbf605
Compare
|
Not sure if this one is still required, but I'll keep it rebased just in case - it fixes the block inspector getting stuck on the List View tab while editing a pattern, but it tracks the selected tab as state with lots of effects and flags to track things. #83048 is a draft alternative - it derives the tab from the selection instead, so the flags aren't needed. |
🤖 PR meta 🤖📦 Bundle sizeSize Change: +317 B (0%) Total Size: 8.21 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
|
|
@ramonjd Honestly, I think the PR description is a little lacking in the usual details that PR descriptions have. No linked issue so there's a lot of context missing. I think I also mentioned in private that folks that work on the nav block should be pinged for review, as they implemented some of this code for the nav block, and might like to check that this still works as expected. Giving this a re-test, and it does work nicely, so no reason it can't be shipped. |
Thanks @talldan It's very stale this one, so just wanted to see if it still worked after a rebase. You're right. I'll update the PR desc to explain what's going on and why a bit better, and see what other folks think. There is no issue for this - I remember noticing the inconsistency back in the original pattern editing days. I can create one if it helps |
|
No issue is fine, a good PR desciption can make up for a lack of issue 👍 |
|
Added @getdave as a reviewer just to make sure nothing funny is happening when selecting navigation blocks either in patterns or templates (I checked both). This PR uses 2026-09-17.13.36.09.mp4 |
talldan
left a comment
There was a problem hiding this comment.
It works pretty well for me when tested.
The comments are mostly nits, but feel a bit more important than normal with the way the code is quite complex.
| * Used to auto-switch the inspector to List View when a child of a list-view- | ||
| * enabled content block (e.g. a Button inside Buttons) is selected in the canvas. |
There was a problem hiding this comment.
The selector can in the future be called from other code too and used for other purposes, so I think this part of the doc block isn't needed.
Rename getListViewChildParentId to getListViewSupportAncestor and make it general purpose: it now takes a client ID instead of reading the selection, and no longer takes the inspector's content client IDs. It returns the outermost ancestor with List View support, the same rule ListViewPanel uses to decide which block renders a panel. The content item checks move into InspectorControlsTabs, which is the only caller that needs them. Shorten the comments this PR adds, and add a test for selecting a different content item after a tab request, as "Edit navigation" does.
|
The interaction feels coherent ✨ When a block is selected from the List View panel, Canvas, or the Inspector tab (Content and List View), the active selection should be communicated across all three UI regions. Each area not only highlights the current selection but also offers actions specific to its region. |
What?
This PR syncs the block inspector's tab item selection with the list view, and makes sure what's selected in the list view, canvas and in the block inspector match.
Selecting a block in any of the three now shows it in the other two, including which inspector tab and which List View panel is open.
Related
Why?
Selection is already shared between the canvas and the left hand sidebar List View.
The inspector was the odd one out. It held whichever tab it was last left on, so the selected block was often not the one the inspector was showing.
For example, in trunk, selecting a child item from a Button or List block in the content tab didn't select the corresponding block in the list view.
Similarly, clicking away from a child block to a higher block in the list view didn't update the block inspector list.
See the "Before" screencast below.
How?
"List View tab" below means the tab in the block inspector on the right, not the Document Overview on the left.
getListViewSupportAncestor, to work out which item a selection sits inside.Testing Instructions
tab switches back to List View.
Before
Kapture.2026-04-16.at.14.38.32.mp4
After
Kapture.2026-04-16.at.14.37.31.mp4
Navigation block (inside a template part)
The Navigation block is a special case: it always offers a List View, regardless of how its menu is locked or populated. It is also the block reached by the "Edit navigation" toolbar button, which asks for a specific
inspector tab and panel.
Kapture.2026-02-20.at.16.09.29.mp4
Alternative approach
#83048 is a draft that derives the tab from the selection rather than correcting it with effects. It removes the suppression flags this PR adds, but it is a larger change that replaces existing coordination. Opened for comparison, not as a replacement.
Use of AI Tools
Claude (via Claude Code) was used to help implement this change, write its tests, and draft this description. All of it has been reviewed by me and I take responsibility for it.
Follow-ups
ListViewPanel(hooks/list-view.jsx) andBlockCardeach work out whether a block sits inside another List View block with their owngetBlockParents( …, false ).find( shouldRenderBlockListView )lookup. They could callgetListViewSupportAncestorinstead. Left for a separate PR to keep this one focused.