Open lorenzulrich opened 9 months ago
Actually there is some crazy cool logic involved. Its not just the old basic media selection screen but better.
At first it will show the actual selection screen:
But on image select, or when reopening when an asset has been selected, it will show the edit screen without edit capabilities:
Im documenting this, because swapping out the image selection is not as easy as just using the same the neos ui uses for the secondary editor. at least not without possibly loosing that cool feature.
With the introduction of allowing secondary editors to fully work in the node creation dialog https://github.com/neos/neos-ui/pull/2870, the new media ui also was adjusted.
When the media ui is active in the node creation it avoids to fold the site navigation and adjusts its styling. So the secondary editor component has no know that its in a special rendering mode.
But as described by sebastian, he had no choice to look at ui.nodeCreationDialog.isOpen
as there is no other context information.
So I looked through the code and I don't understand all of it, but looks fine in general. Also could not find problems with functionality so far. So I assume I could check for
ui.nodeCreationDialog.isOpen
to adjust the layout of my secondary inspector.
The check is hardcoded here: https://github.com/Flowpack/media-ui/blob/34ab06a5d365d3d8a166c97b90a4ff04f91a5b48/Resources/Private/JavaScript/media-selection-screen/src/MediaSelectionScreen.tsx#L177C5-L177C29
To support a similar usecase (this feature) the new media ui should behave in the archaeopteryx similarly to when in the node creation. For that we would have to first create a good api, which should also be used by the core to make checks against ui.nodeCreationDialog.isOpen
obsolete. By that we then can easily consume the media ui selection screen without it having to know itself about archaeopteryx.
Maybe a special SecondaryEditorRenderingType
enum with elevated
or default
as options?
@sebobo What is your take on this? I think it is a valid requirement, but the solution seems a bit complex. Should we arrange a meeting?
@lorenzulrich I've never looked into the code of this plugin, so first I would take some time to understand the inner workings of the latest version and see what would be required. If it's at the end mainly a Neos.UI change, then we could maybe make it possible in 8.4 somehow.
I don't know how this could be achieved, but it would be great to support the new Media UI if installed. This is already possible for the Image and Asset property editor in Neos, but it doesn't work here. I assume it's a hardcoded dependency to the "old" Media UI?