-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Compare 2 versions of a file #39140
Comments
What file formats should be covered by that feature? One option could be to generate a picture of both files, compare those pictures to create a diff, and overlay the diff on both files. Might not be easy, but would be generic. The non-generic way would be to implement a diff algo for each file format. Maybe there is some open source one available already. |
The idea is to just display 2 versions next to each other for the ones where we have a viewer available. |
@nextcloud/designers it would be good to have a mockup for this, how to select the 2 versions and compare them. :) |
I'm taking this on :) The requirements are not very clear from the issue so can we formulate a problem statement for this feature? What is the goal? Is the comparison of the two files oriented at picking one of the two? Is it only for text files or also for other files like spreadsheets, pictures, videos and so on? |
@marcoambrosini it would be a very simple side-by side comparison of 2 documents. To keep it simple:
@artonge do you need mockups beyond this? |
For the time being @juliushaertl's team will take over lending the files team a hand in getting this implemented quickly |
No further input needed for now from the design side I think. @skjnldsv This would require us to have some sort of API to trigger a side-by-side rendering in viewer. My suggestion also considering the short time available would be to simply add an optional parameter to pass a second file info object:
This would align with the work already done in https://github.com/nextcloud/server/pull/39171/files#diff-8c16136a0fe1baf1357890af01439aebe1da2380f96f80afb1eab039157311b8R191-R198 It would then just use the existing viewer__content element and render an additional component for the fileInfoCompare passed object as a split view https://github.com/nextcloud/viewer/blob/ac5413b8cf4b60b8303182f2ea5226c1217dcc84/src/views/Viewer.vue#L114 Any concerns or objections on that? |
I'm actually not sure about this. Any other app would benefit from this feature otherwise? If this is about making it possible to view ANY file in the viewer as side-to-side, sure, then we need it in Viewer. WHile than can be really messy and the layout needs to be updated.
We need clearer definitions of expectations please. As it seems supporting any mime seems like a bad idea, please provide which mime needs to be supported and we can tackle the technical dilemma :) EDIT: TLDRDoes this viewer feature needs to be a documented standard:
|
Yes, Collabora, ONLYOFFICE, files_pdfviewer would be obvious others, for image files I'd also consider it useful. But I agree that we probably want to exclude audio/video files for now.
Handling mobile view has been discussed above as that we just not show the split view then but switch to the single version view. Slideshow should probably just hide the split view and move to the next file. As a user you would need to pick a new version from the sidebar then anyways to compare to.
Moving this to text or other apps seems likes adding a lot of complexity there for what is now a "simple" component to just render a file and would also mean to duplicate a lot of effort bringing this to more apps. |
How would you load two times the UI of collabora/onlyoffice next to each others? Or do you have a preview component available that do simple rendering without any edit option? |
Yes, there is a simplified preview mode that can be loaded separately. This needs some sort of support in the app to load from the passed source url (like https://github.com/nextcloud/files_pdfviewer/pull/646/files#diff-84f92d7129f879a2f201fbc32ac9281b7a84dc921ea4a1ba2754788046234b3a) instead of the file id which is otherwise used to initiate the editing session, but those parts are already there in the viewer from nextcloud/viewer#1338 |
Alright, considering the short deadline, As a quick tip, I suggest using Permission.READ to have the views render the |
Anything but the current version shall always be read-only according to Frank and Jan (and I agree). If the current version could be editable (given the user has the permissions) would be a plus. So MVP can be read-only for everything. What do you think @jancborchardt ? |
Actually using the current file state editable is more straight forward from the implementation side as we can just reuse the existing viewer logic for that. The read only mode hint would be for the version of the file then that is opened on the left of the comparison |
Super nice @juliushaertl! I would say that's awesome for the MVP! |
Very nice Julius! |
Provide an option to compare 2 versions of a file by marking them and opening both side-by-side in some kind of a "dual-pane", so the user can scroll both to visually compare them.
The text was updated successfully, but these errors were encountered: