Skip to content

Selection Mode

Felix Ernst requested to merge felixernst/dolphin:selection_mode_for_copy into master

To potential code reviewers

I know that this is quite a lot of code to ask for review in a single merge request. Sorry about that. I've tried to separate changes which make sense by themself into separate merge requests (mentioned below). Also note that it is probably not as much as it looks because I write a lot of documentation which is supposed to make it quite easy to understand the general structure of the changes but also the specific responsibilities of the various classes and functions. I hope you'll be able to get a good understanding and an overview just by looking at the header files.

Since these new behaviours aren't really triggered by using Dolphin in the old ways, I hope that nothing bad will happen to upgrading users even if bugs happen to slip through.

Thanks for considering doing code review.


Cinematic Introduction

Single-clickers and double-clickers have been fighting each other for decades. The double-clickers outnumber the others 10 to 1 and they have a super power which is "selecting singular items with ease". The only thing the single-clickers have going for them is their nimbleness. They are twice as fast at navigating.

In this hopeless situation one single-clicker tries to create a manner to "select any amount of items with ease". An ability that both sides so far have had their struggles to master. Will it be a turning point in this story or will it be another failed attempt of single-click acceptance?


Proof of Concept Video showing the old initial state of this MR: (The first 33s are just showcasing the existing problem.)

2021-09-12_18-27-12

A ton has changed since this proof of concept video was created. It doesn't reflect the current state of things anymore in a lot of ways.

Entering Selection Mode

  • Triggering an action that needs a selection without having anything currently selected enters selection mode. Examples: Cut, Copy, Rename, Move to Trash. To make it less likely that users have already accidently selected an item it would be favourable if https://bugs.kde.org/show_bug.cgi?id=424723 was fixed.
  • Long pressing the view triggers selection mode.
  • Activating the Selection Mode action. I called it "Select Files and Folders". This is shortened to "Select" for an action that can be placed on the toolbar which also has the actions to invert selection or select all in the long-press/right-click-menu.
  • Therefore if you keep using Dolphin the same way you have until now, none of the things added in this MR will ever show up.

Leaving Selection Mode

  • Switching to any location by any of the usual means exits selection mode. Opening a folder by single-click obviously doesn't work for this but double-clicking still does the trick.
  • Pressing Escape will leave selection mode. (When not in selection mode, pressing Escape will clear the selection like it does currently.)
  • Closing the top bar that signifies that one is in Selection Mode also exits it.
  • Pressing an "Abort " button in the bottom bar (if one is there) exits it.
  • Using an action that implies that one is done with selecting like Cut, Copy, Duplicate, Move to other split view, Copy to other split view exits it. Here is a good time to mention that this isn't true for the Rename action because one might want to keep selecting and renaming multiple files one at a time so selection mode isn't exited after renaming a single file.

Selection Mode Behaviour

  • Selection Mode is currently pretty similar to double-click mode while having the Control key constantly pressed down.
  • Selection Mode is specific to one view. (In split view the selection mode of the left and right view can be independently toggled.)

UI and UX Decisions

  • A very visible way to signify selection mode seemed imperative to me because it breaks muscle memory that a single click doesn't open an item. With the colourful bar right above the view everything stays obvious. It's a good thing we normally use colours sparingly or this could be too easily overlooked. The bottom bar is also coloured the same way as the top one to show their affiliation.
  • The bottom bar guides users through the process for the action they have selected. Since the whole selection mode thing is a slower process than using keyboard shortcuts to select and e.g. copy items, we can embrace this slower alternate way as one for users that struggle with using hidden keyboard shortcuts or when not getting any feedback when copying.
  • When selection mode is entered without a specific action, the bottom bar contains pretty much the same actions one would get when opening a context menu with right-click. This means users that don't know when/why to right-click will now be able to fully use pretty much all of Dolphin's functionality. Because selection mode can be triggered through a visible action, this also alleviates touch users from having to figure out that they need to press-and-hold the view to open a context menu.
  • And much more but I don't know what seems important enough that it would need further explanations. I've attached a more exhaustive/boring video but it doesn't reflect all of the latest changes anymore: (Sound warning: low volume speaking, some crackling; had to compress this to 10 MB to upload)

testplan

Already merged changes which made sense to be separated

!355 (merged), !356 (merged), !357 (merged)

Related discussion

Edited by Felix Ernst

Merge request reports

Loading