Open capi1O opened 6 years ago
An internal previewer for Files has been considered before and, so far, has been rejected - partly to keep Files as simple as possible and also because elementary apps are supposed to open fast enough to make it unnecessary (although I appreciate that could be unwieldy for previewing lots of files).
In principle, this functionality could be supplied by a third-party plugin.
For what it's worth, macOS Finder solved this in the following ways, both of which I find elegant enough:
In column mode, clicking on a file opens a new column to the right with some file information (size, creation/modification dates, codec information if a video,etc) and a small preview window where it would be possible to e.g. play the video or view the photo.
Pressing the SPACEBAR opens up a preview window immediately, which can also be full-screened, etc. This is quite handy for going through a number of photos or text documents for example. It's also a nice way to preview videos.
@eljefri: It is not elementaryos policy to make Files anymore complicated than it is. The simple truth is that there isn't the developer/reviewer resource to emulate MacOS Finder (at the moment anyway). There are already enough bugs in the basic operations to deal with ;-)
Of course I understand that. I hope it is okay to dream big though!
I noticed that the image preview programm opens when i hit spacebar in files with a selected image.
But when i hit the spacebar again, i get the next file. I would assume it was closed. (like in Finder)
Could you implement that?
@davidak: Files does not have a preview program (see discussion above). Pressing the space bar simply launches the separate Photos app with the selected file(s). So any subsequent keyboard presses will go to that app unless you refocus Files. If you launch the Photos app directly and view a photo you will find that the space bar proceeds to the next file in the folder.
So any issues about the UX of the Photos app should be raised in that project at https://github.com/elementary/photos/issues.
BTW spacebar opens any file in it's default app, not just photos. It's a "synonym" of Enter key (in Files and any other file manager, like Nautilus, with one weird exception - Finder, where Enter triggers renaming).
@jeremypw just came across gnome-sushi - sad to hear it does not make it into elementary in its current state of development. However, a file preview feature would be awesome to have somehow/somewhen. So I figured to leave my +1 on this issue.
I guess it may be possible for a 3rd party to provide a plugin via AppCenter that provides communication with the Gnome Sushi dbus service but plugins may not (I think) add keyboard accelerators so would it would have to be opened/closed via a menu option. However, once open it could update according to the current file selection.
Might give this a try. Asked the sushi developers for help on how to get started, as I never did anything like creating a VAPI based upon a existing project before: https://gitlab.gnome.org/GNOME/sushi/-/issues/32
@jeremypw would highly appreciate, in case you have any more information which points me towards the right direction.
@marbetschar I am not sure a plugin would work for preview with the current interface (Marlin.Plugins.Base
) as there isn't a hook for when a file is hovered/selected/clicked, so you would need to get that added to the master code. There is an update_file_info
hook, but that gets called for every file displayed whether or not hovered/selected/clicked. I guess there may not be an objection to adding a suitable hook if it is ignored by the core plugins. Depending on how the preview is to be presented you may need to get one or more further hooks into the master code to expose e.g. the ViewContainer
@jeremypw understood. Would the possibility to define Shortcuts for Context Menu Plugins easen the integration? I'm not 100% sure I understood the codebase correctly, but I think the Send by Email
, ... etc. items can be extended by creating a plugin with support for the context_menu
hook. And this plugin gets notified which files are selected by the List<GOF.File> files
argument - right?
If so, preview might be just one of these hooks - and if it can be assigned a keyboard shortcut, then preview may render the passed List<GOF.File> files
.
I guess that's an oversimplified version of whats needed - but would this be a viable approach? Or is is way off, of whats needed?
Here's a Screenshot of the context menu items i meant above:
@marbetschar There is a hook for when the context menu is shown and it is this that the contractor plugin uses (the contractor plugin supplies entries like "Send by Email" depending on the type(s) of file selected and the available contracts). However I do not see how shortcuts can be used - there is currently no facility for plugins to set or react to shortcuts.
A preview contractor would need the context menu to be shown - which rather defeats the object. And then it would only preview the currently selected file(s).
I am quite willing to add a hook for file-hover as it could be useful for refactoring the OverlayBar as a core plugin. It would need to approved of course.
@jeremypw I hacked together a quick proof of concept, leveraging Sushi's DBus Service as well as the Files Plugin facility. You can see a demo of the functionality in the corresponding Pull Request: https://github.com/elementary/files/pull/1289
As I mentioned in the associated comment on the PR linked above https://github.com/elementary/files/pull/1289#issuecomment-896809684, losing Mac OS's "Quick Look"/QuickLook functionality when moving to Elementary was definitely a downside and I'd be keen for Elementary to support such functionality.
I addressed a couple of specific points raised in the PR in that comment but have some other related info/links I'll drop here.
For reference, here's some documentation on how Quick Look (and associated render plugins) operates and is implemented:
qlmanage
man page -- tool for interacting with QL including displaying a preview via the command line.gnome-sushi
/Gnome (an example file type I mentioned):
gnome-sushi
"jumping" window position issueFor future reference, specifically in relation to gnome-sushi
integration, I seem to recall seeing a remark about the preview window position "jumping" around when first opened which I also observed.
This appears to be a known issue which may have a fix but is at least described in detail here: https://gitlab.gnome.org/GNOME/sushi/-/issues/2
(Also, it wasn't immediately obvious that gnome-sushi
seems to be primarily implemented in JavaScript so FWIW it at least seems easily modifiable. :) )
quicklook
script hackIn case it's useful in the interim, I threw together this quicklook
helper script that calls gnome-sushi
(needs to be installed) to display a preview:
#!/bin/bash
set -e
TARGET_FILE=file://`realpath "$1"`
echo "${TARGET_FILE}"
gdbus call --session --dest org.gnome.NautilusPreviewer --object-path /org/gnome/NautilusPreviewer --method org.gnome.NautilusPreviewer.ShowFile "${TARGET_FILE}" 0 false > /dev/null
I used it in a terminal like so:
quicklook ~/Downloads/example.pdf
Turning this into an "application", then setting that application as the default application for any file type you might want to view and then extending the application so it detects when it wasn't called via a press of the space bar in Files & then opens the original default application for the file type is a terrible hack that is left as an exercise for the reader. :D
First off, thank you for developing a "macOS like" File Manager with Miller Columns! It is currently the only one in Development for any *nix system! Keep up the great work!
I just wanted to add my two cents on this Feature Request, which I believe actually has 3 parts:
I too miss the Next Column File Thumbnail Preview Feature (and the Quick Look Popup Feature) included with the macOS Finder, but most of all, I really miss the File Information Properties Preview Feature under the File Thumbnail Preview Feature in the Next Column when selecting a File with a single "left-click". This is the most needed Feature IMHO.
Since it was mentioned previously that everything in elementaryOS is intended to be "Single-Click", I would like to point out that I have to "right-click" a File (sometimes "left-click" then "right-click" because sometimes just a "right-click" doesn't also select the File for the File Menu), navigate to "Properties" and "left-click" to see the File Information, then "left-click" close when I want to move on. This has to be done to view the File Information Properties for each and every File (3-4 clicks each).
I use the File Information Properties Preview in macOS more than anything else. I'm always looking at the file information (size, creation/modification dates, codec information, image resolution, etc), because I work a lot with similar files, versions, configs, etc., and like to quickly see the File Information Property differences between files. This is the reasoning behind my request for this Feature.
Thanks again for the great work!
Dang! Bummed to see that file preview is getting so much push back. It is BY FAR one of my favorite parts of MacOS.
ALL THE TIME I am opening folders with multiple samples, images, or even videos and then quickly perusing them with preview. Just hit space and then up and down arrows.
I find file management in EOS to be... not really worth it. I just let my stuff get messy because there's no good way to see what a file is without opening and closing apps over and over again.
@SephReed well, it may be revisited at some stage. Last attempts to implement something were not too successful. For now I rely on where a file is, what it is named and sometimes the thumbnail.
preview is useful
Most of the time while browsing file I don't need to open them in app, I just want to see what's inside.
easier file selection
I understand the concept of elementary where everything is one click, however in a file manager it makes it hard to select files, because in pantheon-files one click just opens the file in whatever application (except if
ctrl
is pressed).I think a good compromise (between people like me used to double-click to open) would be to show a preview right inside pantheon-files on click (no dialog/pop-up like in nautilus with gnome-sushi), similar to what windows explorer (preview pane) and finder are doing (in some mode).
consistent behavior
In columns view (millers view) it is also more consistent as click on a folder result in displaying its contents on the right, thus click on a file should display its content on the right also in my opinion (inside a preview column).