Sitegeist.Archaeopteryx icon indicating copy to clipboard operation
Sitegeist.Archaeopteryx copied to clipboard

Support for new Media UI

Open lorenzulrich opened this issue 8 months ago • 3 comments

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?

lorenzulrich avatar Dec 08 '23 09:12 lorenzulrich

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:

image

But on image select, or when reopening when an asset has been selected, it will show the edit screen without edit capabilities:

image

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.

mhsdesign avatar Feb 02 '24 17:02 mhsdesign

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?

mhsdesign avatar Mar 07 '24 17:03 mhsdesign