Improve consistency of "Open With" UI by always showing top app inline
ClosedPublic

Authored by ngraham on Mar 22 2018, 3:14 AM.

Details

Summary

This patch adjusts the Open With UI to improve the strings and always display the top app inline, outside of the sub-menu.

This presents the following advantages over the status quo:

  • The same UI is used whether there's one or 10 apps: the first one is shown inline, and the other ones go into the sub-menu
  • Access to the top app is faster since you don't have to bother with the sub-menu
  • It's now clear from the context menu what app will open the file by default
Test Plan
  • Right-click on a file in Dolphin with no handlers:
  • Right-click on a folder in Dolphin with one handler:
  • Right-click on an image in Dolphin when there are 5 image handlers:
  • Click on any of the menu items in the above cases; all work
  • Open Gwenviewnavigate to an imageright-click: no change, Gwenview uses a custom implementation in fileopscontextmanageritem.cpp rather than this nice API, boo

Diff Detail

Repository
R241 KIO
Branch
open-with-usability (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
ngraham created this revision.Mar 22 2018, 3:14 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 22 2018, 3:14 AM
ngraham requested review of this revision.Mar 22 2018, 3:14 AM
ngraham edited the summary of this revision. (Show Details)Mar 22 2018, 3:16 AM
ngraham edited the test plan for this revision. (Show Details)
This comment was removed by ngraham.
ngraham updated this revision to Diff 30182.Mar 22 2018, 3:38 AM

Use a header for 1-4 apps; it looks better and there's no redundant text

ngraham edited the summary of this revision. (Show Details)Mar 22 2018, 3:41 AM
ngraham edited the test plan for this revision. (Show Details)
abetts added a subscriber: abetts.Mar 22 2018, 4:25 AM

Would it look good also that if there were less handlers and they are presented in the same menu that it goes like this:

Open With

  • Gwenview
  • GIMP

I am talking about right justification instead of

Open With
Gwenview
GIMP

anthonyfieroni added inline comments.
src/widgets/kfileitemactions.cpp
663

This introduce one more so menu can grow with 6 items which is much. Why not keep same approach, but we can show every time the *preferred* one

---------------------------
Open with Gwenview
Open with other application -> { submenu if present others, or ... if not }
---------------------------
ngraham added inline comments.Mar 22 2018, 5:04 AM
src/widgets/kfileitemactions.cpp
663

Hey, I like that idea!

ngraham updated this revision to Diff 30226.Mar 22 2018, 1:41 PM

Always show top app inline, and others in the sub-menu

ngraham retitled this revision from Improve usability of "Open With" UI to Improve consistency of "Open With" UI.Mar 22 2018, 1:46 PM
ngraham edited the summary of this revision. (Show Details)
ngraham edited the test plan for this revision. (Show Details)
ngraham marked 2 inline comments as done.
ngraham updated this revision to Diff 30227.Mar 22 2018, 1:52 PM

Add a separator to the top menu when there's a submenu

ngraham edited the test plan for this revision. (Show Details)Mar 22 2018, 1:52 PM

+1 on this! Easy access to apps!

anthonyfieroni added inline comments.Mar 22 2018, 2:25 PM
src/widgets/kfileitemactions.cpp
654

Use offers.takeFirst(), it will get and remove.

656

Remove.

ngraham updated this revision to Diff 30233.Mar 22 2018, 2:29 PM

Use takeFirst() to avoid a separate remove() invocation

ngraham marked 2 inline comments as done.Mar 22 2018, 2:30 PM
ngraham retitled this revision from Improve consistency of "Open With" UI to Improve consistency of "Open With" UI by always showing top app inline.Mar 22 2018, 2:33 PM
rkflx added a comment.EditedMar 22 2018, 2:34 PM

@ngraham Thanks for setting me as a reviewer, I try to have a look before Frameworks string freeze on Saturday. Focussing on Apps string freeze today ;)

"Open With..." are quite memorable labels used in Windows, I fear "Open With Application" will take away the recognizability of "Öffnen mit …" in German to "Mit Anwendung öffnen". But I won't object.

I have two questions regarding this "open with" topic.
Is the displayed app the one which is also set as default for this file type or the first alternative (2nd app) ? If it's the default one why should someone make a right click on a file to open it with his/her default app instead of making a single/double click on it?
The second point: Shouldn't the "Open with" stuff be at the very beginning of the menu when we have a file selected for quick access? (1. opening, 2. create new files (for folders), 3. direct file operations, 4. additional file operations, 5. everything else)

I have two questions regarding this "open with" topic.
Is the displayed app the one which is also set as default for this file type or the first alternative (2nd app) ? If it's the default one why should someone make a right click on a file to open it with his/her default app instead of making a single/double click on it?

It's rather odd that there's no Open item in Dolphin's context menu in the first place, and this patch remedies that. Also, this is a general API, so other clients can potentially benefit from it even when it's not used in a context menu. (e.g. Gwenview could adopt this to make it easier to open images in other apps, where currently the only option is to use a sub-menu)

The second point: Shouldn't the "Open with" stuff be at the very beginning of the menu when we have a file selected for quick access? (1. opening, 2. create new files (for folders), 3. direct file operations, 4. additional file operations, 5. everything else)

I would approve of that. It's what macOS does, FWIW:

As you can see from the above image, macOS doesn't tell you what app will launch in response to the Open action, so this patch would actually represent a usability improvement over that. However, re-ordering the menu would need to be changed in Dolphin, not here in KIO. That change (if we do it) should go into 18.08.0, to make sure that it can rely on this change (if it's accepted).

rkflx added a comment.Mar 23 2018, 9:35 PM

Looked at this now: The first iterations with the long list of apps and the header were not all that great (in particular for folders the list got much too long), but after @anthonyfieroni's idea I guess the current version is quite good. Showing the default app again at the first level is not that useful (@mmustac also noticed that), but if it helps consistency I'm not against it…

As for adding "Application" everywhere, I agree with @broulik. I don't feel that's necessary to achieve a good flow. Also macOS and Windows are simply using "Open With … Other …", counteracting your work elsewhere to make users from those platforms feel more at home. In general shorter descriptions are faster to read, and for some languages longer descriptions can make the menu almost too wide to still look reasonable. For me the following compromise would work well:

Open With…
Open With Gwenview, Open With…
Open With Gwenview, Open WithOther Application…


Code LGTM.

+1 on this! Easy access to apps!

Not sure how this patch makes access easier?


Open Gwenviewnavigate to an imageright-click: no change, Gwenview uses a custom implementation in fileopscontextmanageritem.cpp rather than this nice API, boo

There are two good reasons for this:

  • Gwenview implemented this in fc120d0fcab1 in 2008, but the feature was available in kdelibs only one year later in b128c0d4a516.
  • The action is not only used in the context menu, but also in the regular menu and most importantly in the sidebar, where there is only space for a single item. However, the generic code would result in more than one item.

I'm not against changing Gwenview to this, but first we'd need to make more space and/or reorganize the long list, which is easier said than done because we cannot lose existing functionality. Solving Bug 211756 is another prerequisite.

This may be different than this patch is intending to address. Let me know if that's the case. Another thing that adds more characters to the menus are the long names that our applications have.

Firefox Web Browser
Gwenview Image Editor
GIMP Image Editor

I feel that users would know better as to the application they want to use. Could the app names be shortened to just

Firefox
Gwenview
GIMP

?

rkflx added a comment.Mar 23 2018, 9:48 PM

the long names that our applications have.

@ngraham I don't see that on my system. Is this a custom Kubuntu patch changing some default again in your screenshot? For Open With the mimetype is well-determined, so showing the longer description interferes more than it helps.

The names are determined entirely by the distro packaging. Ubuntu tends to lengthen the names, e.g. "Firefox Web Browser" instead of just "Firefox".

ngraham updated this revision to Diff 30584.Mar 26 2018, 4:23 AM

Remove excessive wordiness

ngraham edited the test plan for this revision. (Show Details)Mar 26 2018, 4:25 AM
ngraham edited the summary of this revision. (Show Details)
rkflx accepted this revision.Mar 26 2018, 8:34 PM

You probably had your reasons for also changing back Open WithOther Application…, but I guess this way it's fine too. Accepting for now.

If there are no further objections until Thursday (i.e. it's been a week under review in total), I think this can land (because the string freeze does not apply anymore).

This revision is now accepted and ready to land.Mar 26 2018, 8:34 PM

I rather prefer Open WithOther Application... myself, and can change it back if folks prefer (I thought you wanted it this way, sorry!).

rkflx added a comment.Mar 26 2018, 9:02 PM

I rather prefer Open WithOther Application... myself, and can change it back if folks prefer (I thought you wanted it this way, sorry!).

That's what I reckoned, and even recommended above :)

Open With…
Open With Gwenview, Open With…
Open With Gwenview, Open WithOther Application…

If you change it, make sure though to wait until the string freeze is over…

I'll leave the string the way it is for now so this can go into Frameworks 5.45, and change it after the string freeze.

+1 from me, other than the inline comment.

src/widgets/kfileitemactions.cpp
654

Please use true rather than menu as 2nd argument

ngraham updated this revision to Diff 30940.Mar 30 2018, 1:45 PM

Implement review comments

ngraham marked an inline comment as done.Mar 30 2018, 1:45 PM

Any remaining objections, or can I land this?

abetts accepted this revision.Mar 30 2018, 2:22 PM
dfaure accepted this revision.Mar 30 2018, 4:40 PM

Looks good to me. Can you just make sure that kde/applications/konqueror/libkonq/autotests/konqpopupmenutest.cpp still passes after these changes?

Sure, I'll check that out later today.

Good catch @dfaure, the test does indeed fail after this is patch deployed. I've submitted a fix for the failing test: D11836, and marked this as a dependency. If and when D11836 is accepted, can I land both?

This revision was automatically updated to reflect the committed changes.

I didn't notice that this change also affects the context menu of folders. That doesn't make much sense and just clutters the menu, imho.

Why would I want an "Open with Gwenview" action if 99% of my folders do not contain pictures?

I'll leave the string the way it is for now so this can go into Frameworks 5.45, and change it after the string freeze.

@ngraham Are you still planning to do this? Or should I open a Diff?

I didn't notice that this change also affects the context menu of folders. That doesn't make much sense and just clutters the menu, imho.

Why would I want an "Open with Gwenview" action if 99% of my folders do not contain pictures?

@ngraham Ping?

I'll submit some more patches tomorrow.

I'll leave the string the way it is for now so this can go into Frameworks 5.45, and change it after the string freeze.

@ngraham Are you still planning to do this? Or should I open a Diff?

D12207: Use text "Other Application..." in "Open With" submenu

I didn't notice that this change also affects the context menu of folders. That doesn't make much sense and just clutters the menu, imho.

Why would I want an "Open with Gwenview" action if 99% of my folders do not contain pictures?

@ngraham Ping?

D12206: Don't show top "Open With" app for folders; only for files