Bug 465489 - Selection Mode still gets triggered by Space, even after reassigning the shortcut
Summary: Selection Mode still gets triggered by Space, even after reassigning the shor...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: Selection Mode (show other bugs)
Version: 22.12.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KFM Developers
URL:
Keywords:
: 466050 466163 468749 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-02-08 20:00 UTC by akb825
Modified: 2023-04-29 16:08 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 23.08


Attachments
Video showing the expected behavior, as on v22.12.1 (45s) (722.83 KB, video/mp4)
2023-02-22 03:48 UTC, mydarkstar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description akb825 2023-02-08 20:00:55 UTC
SUMMARY
Prior to Dolphin 22.12 you could press space to toggle the selection, which was convenient as a quick way to select the first element in a file listing. This streamlined tasks such as navigating, renaming, or deleting items in a folder with a keyboard as using the arrow keys to select would move the cursor off of the first item. This is how I used the shortcut, though I'm sure others had different uses as well.

With Dolphin 22.12, Selection Mode was assigned to "space" by default. However, it was possible to restore the previous behavior by unassigning space from activating selection mode. As of 22.12.2 this no longer works as the default keyboard assignments for "Select" and "Select Files and Folders" is unassigned and space will always enable selection mode.


STEPS TO REPRODUCE
1. Open "Configure Keyboard Shortcuts" in Dolphin and verify that "Select" and "Select Files and Folders" are set to the default of "None".
2. Open a folder in Dolphin.
3. Press "space" with the intent to toggle the selection of the first element.

OBSERVED RESULT
Selection mode is activated with a prompt to click files to select them.

EXPECTED RESULT
The selection is toggled unless "space" is assigned as a keyboard shortcut to activate selection mode.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux 
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
When searching if there was an existing bug, there appears to be others unhappy with the current situation, such as with this thread on Reddit: https://www.reddit.com/r/kde/comments/10tovgu/spacebar_behavior_in_dolphin/
While some pointed out the workaround of unassigning the key shortcut, that unfortunately appears to no longer be an option.
Comment 1 Felix Ernst 2023-02-09 01:13:14 UTC
>Prior to Dolphin 22.12 you could press space to toggle the selection

Space would select the first file, not toggle the selection. One couldn't de-select a file with Space, but only with Ctrl+Space.

>which was convenient as a quick way to select the first element in a file listing.

This can still be done using Ctrl+Space. Do you think you could get used to pressing Ctrl+Space the same way you got used to pressing Space to select the first file in a file listing?

There is a certain technical obstacle that makes it a bit difficult to implement the Space shortcut being re-assignable. It is possible to implement anyway (potentially not in a 100% bug-free manner though), but I currently don't believe it is worth the extra code complexity/maintenance burden just so users don't need to press the extra Ctrl key.

I also think that selecting the first file in a folder isn't really a general enough task to warrant having the most easily triggerable keyboard shortcut. After all, if one wants to act on any file other than the first, the arrow keys to go there will already select the file in the process. Does this make sense to you?

Another question: A lot of users want to have a quick preview feature similar to Apple's Mac's Finder's QuickLook feature, that is also bound to Space there. Would you be opposed to having that on the Space key?

>When searching if there was an existing bug, there appears to be others unhappy
>with the current situation, such as with this thread on Reddit:
>https://www.reddit.com/r/kde/comments/10tovgu/spacebar_behavior_in_dolphin/

Well, the person who created that (Popov) disliked the selection mode in every shape and marked the selection mode feature with a dislike button even before it was assigned to any keyboard shortcut. He is now lobbying against this on reddit and writes passive aggressive comments to me. I don't really think that discussion points to many people having an issue with the new behaviour. Everyone I talked with about the Space shortcut so far didn't know that they could simply use the Ctrl+Space shortcut instead which is more generally useful anyway because it also allows de-selecting.
Comment 2 akb825 2023-02-09 03:48:07 UTC
> Space would select the first file, not toggle the selection. One couldn't de-select a file with
> Space, but only with Ctrl+Space.

My mistake, other threads mentioned toggling, though I primarily use it for selection without needing to toggle so I wasn't sure about that distinction.

> Do you think you could get used to pressing Ctrl+Space the same way you got used to pressing
> Space to select the first file in a file listing?

Given enough time I probably could. I double checked that this also works in Windows, which is my primary concern: I often swap back and forth between Windows and KDE and it's disruptive to have that muscle memory disrupted. (similar to the recent issue where Shift + Delete defaulted to cancel)

> I also think that selecting the first file in a folder isn't really a general enough task to warrant
> having the most easily triggerable keyboard  shortcut. After all, if one wants to act on any file
> other than the first, the arrow keys to go there will already select the file in the process. Does
> this make sense to you?

In my experience selecting the first file is quite common. For example, sometimes directory structures are mandated by tools and lead to a lot of directories with a single element. If you're iterating on a file it may often be first if you're sorting by modification time. Overall, when looking at the window, it's straight-forward to say "this is third to the right, so press right three times", but if it's first and there's no easy shortcut it gets very awkward.

> Another question: A lot of users want to have a quick preview feature similar to Apple's Mac's
> Finder's QuickLook feature, that is also bound to Space there. Would you be opposed to having
> that on the Space key?

I personally wouldn't use such a feature. However, I understand that others who use often switch between macOS and KDE would very much want to avoid interrupting their muscle memory the same way I'm more familiar with the Windows shortcuts. If this were configurable, perhaps even with a set of common defaults that are more Mac-like, Windows-like, or KDE-native then each group could be happy.

> Well, the person who created that (Popov) disliked the selection mode in every shape and marked
> the selection mode feature with a dislike button even before it was assigned to any keyboard
> shortcut. He is now lobbying against this on reddit and writes passive aggressive comments to me.
> I don't really think that discussion points to many people having an issue with the new behaviour.
> Everyone I talked with about the Space shortcut so far didn't know that they could simply use the
> Ctrl+Space shortcut instead which is more generally useful anyway because it also allows de-selecting.

My intent here was more to show that there was interest apart from me in at least having a path to the old behavior. I saw the other ticket he created requesting a way to fully disable selection mode (I didn't realize when I posted the link that it was the same person), and explicitly decided against adding this to that ticket because the discussion devolved quite quickly.

To give a constructive argument for my own thoughts on the matter, many have created muscle memory from using other systems over the course of decades. It may take days, weeks, or even longer to fully get used to a new routine, and causes a lot of friction if you need to switch between OSs for various tasks. In this specific case an alternative (Ctrl+Space) is available that works across both Dolphin and Windows, though obviously many aren't aware of this alternative. While you've been able to inform myself and some others about this alternative, it does demonstrate that it's a common issue. For those who have this muscle memory and aren't aware of the alternative, they will leave with the impression that Dolphin is clunky and awkward - not because it's a bad feature or not useful, but because it doesn't do what they expect based on years of using other systems. Only a few will generally speak out about it (even if some are a bit overly vocal...), though it may leave a bad impression nonetheless.

For me personally, I don't see myself using the selection mode. I try to use the keyboard to navigate when possible, and when selecting arbitrary files with a mouse am used to the modifier keys. However, I do see that others may find it very useful and streamline their workflows, especially if they incorporate the mouse more in their file browsing, and it doesn't bother me having it be present so long as it doesn't get in the way. Configurability is one of the strong points of KDE, and one of the big reasons why I can't stand GNOME. While it may add some extra complexity, it may help offer a smoother experience overall to allow space to be remapped, especially if those more familiar with macOS would prefer a QuickLook feature mapped to space.
Comment 3 Felix Ernst 2023-02-10 14:44:51 UTC
Yea, after thinking some more about it, I have to say that it would of course generally be an improvement long-term if the Space key could be mapped to other actions. If/when a QuickLook feature would be implemented, users that got used to selection mode on Space would be just as disrupted by the sudden change as you are now by changing it to selection mode.

I doesn't/didn't seem high priority to me because the old functionality on Space couldn't really be changed either.

I'll now explain a way I see how this could potentially be implemented. Maybe someone is interested in picking this up.

The biggest issue for what happens by default on Space is that the Space key needs to be usable for example by blind people to press down the currently focused button. If we were to simply bind the Space key to an action, pressing Space could no longer be used for anything else (https://bugs.kde.org/show_bug.cgi?id=458281), including Dolphin's type-ahead feature (https://bugs.kde.org/show_bug.cgi?id=458282).

So when an action were to be bound to Space by a user, we need to disable it in certain situations so it doesn't interfere with other functionality. The way to disable a keyboard shortcut in certain situations is QAction::shortcutContext (https://doc.qt.io/qt-5/qaction.html#shortcutContext-prop). Unfortunately AFAIK this can't simply be used in our case with our frameworks.

So instead we use QAction::shortcutContext to completely disable all keyboard shortcuts for the action that got assigned to the Space key. To make the shortcut still work, we will need to trigger the action ourselves when the Space key is pressed in the correct context. We do this by telling the view controller that that action is what is supposed to be triggered when the Space key is pressed while the view has focus.

Then everything would be mostly working! Except if that action also has another non-Space keyboard shortcut. We can either let users know that that one doesn't work while Space is also assigned, or we install an eventFilter on the whole application to listen for that other shortcut.
Comment 4 Nate Graham 2023-02-22 00:48:59 UTC
*** Bug 466163 has been marked as a duplicate of this bug. ***
Comment 5 mydarkstar 2023-02-22 03:23:46 UTC
Thank you, Nate.
As my bug report has been closed in favor of this one,
please do check out the information I documented there on this regression as well!

I think the following video I had linked shows the regression very well:
https://bugs.kde.org/attachment.cgi?id=156548

> This screen recording first demonstrates:
> 1. Selection Mode gets triggered by pressing Space (expected behavior)
> 2. Selection Mode does not get triggered by pressing A (expected behavior)
> 
> Then, the shortcut for the Selection Mode gets changed FROM the default TO "A".
> 
> The screen recording then demonstrates:
> 3. Selection mode now gets triggered by pressing A (expected behavior)
> 4. Selection mode STILL gets triggered by pressing Space (bug!)

I can reproduce that on Dolphin 22.12.1, this still works fully as expected.

I hope this information is helpful, as there seems to be a misunderstanding in this report.
Reassigning the shortcut was indeed a feature in Dolphin 22.12.0 and 22.12.1, which worked reliably in those versions,
but is now buggy in version 22.12.2, unless I'm the one misunderstanding something.

Thank you for the hard work on this new feature!
Especially now that Linux tablets are getting more popular, I'm sure Selection Mode will be very helpful to many!
Comment 6 mydarkstar 2023-02-22 03:48:30 UTC
Created attachment 156585 [details]
Video showing the expected behavior, as on v22.12.1 (45s)

I have attached a screen recording of Dolphin version 22.12.1, with the reassigned shortcut fully working as expected.

In version 22.12.2, the shortcut can still be reassigned, but pressing Space will still trigger it regardless, as seen in my video in the previous comment.

This new video first demonstrates:
1. Selection Mode gets triggered by pressing Space (expected behavior)
2. Selection Mode does not get triggered by pressing A (expected behavior)

Then, the shortcut for the Selection Mode gets changed from the default (Space) to "A".

The screen recording then demonstrates:
3. Selection Mode does not get triggered by pressing Space anymore (expected behavior)
4. Selection Mode now instead gets triggered by pressing A (expected behavior)

I feel like Felix' comment on this having to be newly implemented is a misunderstanding.
In the previous version, the shortcut reassignment seems to work perfectly fine, and I have not encountered any bugs with it.
Comment 7 Felix Ernst 2023-02-23 16:12:12 UTC
*** Bug 466050 has been marked as a duplicate of this bug. ***
Comment 8 marge.ullrich55 2023-03-12 18:20:30 UTC
Please, please, please make the concept of "Selection Mode" + space bar behaviour an option to select in Dolphin Settings.  Make it the default if you prefer, though please offer a way to disable "Selection Mode".  Once upon a time, KDE was the pinnacle of desktop environment configurability.  Hard-coding this new behaviour is the opposite of this.

An alternative is to restore the ability to unassign the Space shortcut and rollback to the prior behaviour.

Is there any documentation or any study to indicate why using a keyboard action (space) to offer buttons for mouse clicking (copy, cut, rename, trash) is preferred behaviour with respect to user experience?

Thank you for considering this request.
Comment 9 Bug Janitor Service 2023-04-22 16:31:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/536
Comment 10 Bug Janitor Service 2023-04-23 10:30:27 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/537
Comment 11 Felix Ernst 2023-04-24 10:03:29 UTC
*** Bug 468749 has been marked as a duplicate of this bug. ***
Comment 12 Felix Ernst 2023-04-25 13:05:44 UTC
Git commit 7b6a67e520c04f56b4b05fa26b252177398df6df by Felix Ernst, on behalf of Eugene Popov.
Committed on 25/04/2023 at 13:05.
Pushed by felixernst into branch 'master'.

Fix activating the Selection Mode with a keyboard shortcut

If a spacebar is used as a keyboard shortcut to activate the Selection Mode, then allow this shortcut to be triggered only if the view has a keyboard focus.

M  +14   -0    src/dolphinmainwindow.cpp
M  +3    -0    src/dolphinmainwindow.h
M  +12   -4    src/kitemviews/kitemlistcontroller.cpp
M  +5    -0    src/kitemviews/kitemlistcontroller.h
M  +5    -5    src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp
M  +5    -6    src/kitemviews/private/kitemlistkeyboardsearchmanager.h
M  +5    -0    src/views/dolphinview.cpp
M  +11   -3    src/views/dolphinview.h

https://invent.kde.org/system/dolphin/commit/7b6a67e520c04f56b4b05fa26b252177398df6df
Comment 13 Méven 2023-04-29 16:08:49 UTC
Git commit 335874150d6b509f3651eda8d4c70900b4145cfe by Méven Car, on behalf of Eugene Popov.
Committed on 29/04/2023 at 10:38.
Pushed by meven into branch 'release/23.04'.

Fix activating the Selection Mode with a keyboard shortcut

If a spacebar is used as a keyboard shortcut to activate the Selection Mode, then allow this shortcut to be triggered only if the view has a keyboard focus.
(cherry picked from commit 7b6a67e520c04f56b4b05fa26b252177398df6df)

M  +14   -0    src/dolphinmainwindow.cpp
M  +3    -0    src/dolphinmainwindow.h
M  +12   -4    src/kitemviews/kitemlistcontroller.cpp
M  +5    -0    src/kitemviews/kitemlistcontroller.h
M  +5    -5    src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp
M  +5    -6    src/kitemviews/private/kitemlistkeyboardsearchmanager.h
M  +5    -0    src/views/dolphinview.cpp
M  +11   -3    src/views/dolphinview.h

https://invent.kde.org/system/dolphin/commit/335874150d6b509f3651eda8d4c70900b4145cfe