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

Open media in separate browser window #6269

Merged

Conversation

thomaslow
Copy link
Collaborator

Fixes #5887.

This pull request adds another menu item to the context menu of the metadata editor. It allows to open a page in a new browser window (depending on browser settings, usually a new tab). The media is shown similar to the media detail view in the meta data editor, meaning, images can be zoomed using OpenLayers, videos and audio is shown with a standard html5 video tag. There is no communication between the new window and the metadata editor. It is a simple static view of the media.

Demo video:

2024-10-20_Kitodo_Open_Window_Demo.mp4

@BartChris
Copy link
Collaborator

It would be very nice if we can also achieve the same behaviour, with a Ctrl/Str+Click on the node or the thumbnail.

@solth
Copy link
Member

solth commented Oct 22, 2024

It would be very nice if we can also achieve the same behaviour, with a Ctrl/Str+Click on the node or the thumbnail.

I think CTRL + Click is currently reserved for multi-selecting pages so that would probably produce a conflict in the shortcuts.

@BartChris
Copy link
Collaborator

It would be very nice if we can also achieve the same behaviour, with a Ctrl/Str+Click on the node or the thumbnail.

I think CTRL + Click is currently reserved for multi-selecting pages so that would probably produce a conflict in the shortcuts.

Right... Maybe Alt+Click then?

@thomaslow
Copy link
Collaborator Author

thomaslow commented Oct 28, 2024

@BartChris I tried to implement your idea to open a new window with an alt+click. Unfortunately, there are multiple problems that are difficult to solve.

When using the mouse down event of a thumbnail, jQuery gets confused and thinks that the user wants to drag the thumbnail. So, when the user returns to the metadata editor, suddenly the thumbnail is being dragged around:

2024-10-28.19-39-24.mp4

Unfortunately, the mouse up event can also not be used, because Primefaces prevents it from being triggered consistently. There is a Primefaces click handler that stops the mouse up event if the mouse is clicked quickly. The window is only opened when clicking "slowly" (like waiting 1 second between mouse down and mouse up).

Then there is the issue that the correct URL to open the window is current only updated when a thumbnail is selected.

All in all, I can only offer a alt+(double)-click. Meaning, if the thumbnail is not yet selected, there needs to be two clicks (one for selecting the thumbnail, and one for opening the window). If the thumbnail is already selected, a single alt+click is sufficient. Here is a demo:

2024-10-28.20-13-02.mp4

Personally, I wouldn't recommend to include this inconsistent mouse click behavior, which is probably confusing to the user. Unfortunately, I do not see a better solution at the moment.

@BartChris
Copy link
Collaborator

BartChris commented Oct 29, 2024

@thomaslow Thanks a lot for your investigation. I agree, that given the circumstances it would be of little value to add that. Maybe we can revisit this at a later point in time. The right-click menu is already a big improvement.

@thomaslow thomaslow marked this pull request as ready for review October 29, 2024 15:00
@solth solth requested a review from BartChris October 30, 2024 09:48
@solth solth modified the milestone: Kitodo.Production 3.8.0 Nov 2, 2024
Copy link
Collaborator

@BartChris BartChris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything works as expected. Code looks good!

I would only suggest to maybe move the menu entry "View page in new browser windows" to the second position in the menu, to not have it directly next to "Remove element".

@thomaslow
Copy link
Collaborator Author

@BartChris Thank you for your feedback. I agree with your idea to move the context menu entry to the second position. I updated the pull request accordingly.

@solth solth merged commit 3d32ea1 into kitodo:master Nov 5, 2024
5 checks passed
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 this pull request may close these issues.

Add option to open select pages in the metadata editor gallery in a separate browser window
3 participants