Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for new Media UI #50

Open
lorenzulrich opened this issue Dec 8, 2023 · 5 comments · May be fixed by #73
Open

Support for new Media UI #50

lorenzulrich opened this issue Dec 8, 2023 · 5 comments · May be fixed by #73

Comments

@lorenzulrich
Copy link
Contributor

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?

@mhsdesign
Copy link
Collaborator

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
Copy link
Collaborator

mhsdesign commented Mar 7, 2024

With the introduction of allowing secondary editors to fully work in the node creation dialog neos/neos-ui#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?

@lorenzulrich
Copy link
Contributor Author

@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?

@Sebobo
Copy link

Sebobo commented Jul 24, 2024

@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.

@Sebobo
Copy link

Sebobo commented Oct 23, 2024

I got it working with a few changed lines by mounting the registered component for the secondary editor from the Neos UI API and adding a sprinkle of CSS:

CleanShot 2024-10-23 at 11 56 54@2x

Sebobo added a commit to Sebobo/Sitegeist.Archaeopteryx that referenced this issue Oct 26, 2024
Resolves: sitegeist#50

With this change any registered MediaSelectionScreen secondary editor is used
instead of the fixed dependency on the media browser.
This way the Flowpack.Media.UI will be used when it is installed a project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants