Repository navigation
Conversation
|
Size Change: +88 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in d669a97. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4115677675
|
There was a problem hiding this comment.
I don't understand: how are they useful if nobody reads them?
There was a problem hiding this comment.
I don't 100% get it either. I think it means they are stored in memory, so that they don't get lost when a mutation happens. This is old code that might be possible to write in a clearer way, but I think that's outside of the scope of this PR.
There was a problem hiding this comment.
If you remove these lines it breaks :)
There was a problem hiding this comment.
Since it's not generic the name should reflect that findNavigationLinkById
There was a problem hiding this comment.
Nit: I wonder if we should not instead filter pages and use createNavigationLinks on the filtered pages?
There was a problem hiding this comment.
I thought about that, but it's technically more complex as pages isn't a nested array, so we'd have to filter on a parent id, and then all the parents of that id, and then all the parents of that one etc. I think this approach is simpler.
draganescu
left a comment
There was a problem hiding this comment.
This works great! Left a couple nits but otherwise the code looks good too.
What?
When converting a Page List block to a list of links we should respect the selected parent, rather than using all pages.
Why?
This is the expected behaviour.
How?
We need to do some quite complex recursion over the innerBlocks to ensure that we find the right block to use as a parent. The
findByIdfunction could be made more general.Testing Instructions
Testing Instructions for Keyboard
As above
Screenshots or screencast
Screen.Recording.2023-02-01.at.15.42.01.mov