Bug 458091 - Make multiple selection keyboard navigable
Summary: Make multiple selection keyboard navigable
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: Selection Mode (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: usability
: 458900 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-08-20 10:14 UTC by Natalie Clarius
Modified: 2025-01-21 11:43 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Natalie Clarius 2022-08-20 10:14:30 UTC
SUMMARY
***
I currently see no keyboard navigable way to select multiple elements in Dolphin, as arrow keys will clear the previous selection.
The new selection mode is very convenient for single clickers, and I think it would make sense to adapt the behavior of keys in selection mode similarly: Arrow keys to navigate between elements would highlight them without resetting the previous selection, but also without permanently adding the element to the selection yet so that the next arrow press would just highlight the next element as current, and the enter key would confirm to add the current element to the selection, like single click adds to the current selection rather than opening it when in selection mode.
***

STEPS TO REPRODUCE
1. Enter selection mode
2. Click 1st item
3. Click 3rd item
4. Down arrow key
5. Down arrow key
6. Enter key
7. Down arrow key

OBSERVED RESULT
4. 1st and 3rd item are unselected as 4th item is highlighted
5. 5th item is highlighted, 4th item is unselected
6. 5th item is opened

EXPECTED RESULT
4. 4th item is highlighted, 1st and 3d item remain selected
5. 5th item is highlighted, 4th item is no longer highlighted, 1st and 3d item remain selected
6. 5th item is added to the selection
7. 6th item is highlighted, 1st, 3d and 5th item remain selected
...
Comment 1 Felix Ernst 2022-08-26 10:21:36 UTC
>I currently see no keyboard navigable way to select multiple elements in Dolphin,
>as arrow keys will clear the previous selection.

Yes, that indeed doesn't seem to be possible currently. Dolphin in general needs some work towards making it more convenient to use with keyboard only.

Your suggestion of adapting selection mode to make this possible sounds good to me!

It adds a bunch of complexity though. I hope whoever is ever implementing this will write the necessary autotests.
Comment 2 Felix Ernst 2022-09-09 09:20:01 UTC
*** Bug 458900 has been marked as a duplicate of this bug. ***
Comment 3 Bug Janitor Service 2024-12-05 19:06:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/871
Comment 4 Felix Ernst 2024-12-29 11:27:22 UTC
Git commit 3696213ccbbe27e9ef3fc85eb97dd32fd669066f by Felix Ernst.
Committed on 29/12/2024 at 11:27.
Pushed by felixernst into branch 'master'.

Have special keyboard controls in selection mode

Prior to this commit keyboard controls and behaviour of Dolphin's main
view were identical no matter if selection mode was enabled or not.
While selection mode makes it impossible to accidentally clear the
selection by singular mouse clicks, any press of an arrow key on the
keyboard would still clear the full selection which goes against
selection mode's objective.

Furthermore, keyboard-only users had no reason to ever enable selection
mode because it made no difference to them.

This commit changes this by offering a changed control scheme for key
presses while in selection mode. Arrow key presses without modifier now
only move focus between items but do no longer clear or change the
selection. Similarly, Page Up/Down, Home, and End key presses only move
keyboard focus. Enter, Return, and Space key presses now only toggle
the selection for the current item.

The above controls are however mostly unchanged when combining them
with Modifier keys like Shift or Control.

The type-ahead feature is also changed in selection mode to only move
keyboard focus without changing the selection.

This way keyboard users are less likely to clear their selection by
mistake. Regression tests are added for these selection mode controls.

The code changes to change this keyboard behaviour are quite minimal.
Most of the added code is for making selection mode accessible. That's
because we need to make sure the changed control scheme is properly
announced and communicated or a blind user will be left utterly
confused why the normal keyboard controls "stopped working".

Enabling or disabling selection mode is announced to accessibility
software. Furthermore whenever focus goes to the main view, the
selection mode state is also mentioned when active.

M  +31   -0    src/kitemviews/accessibility/kitemlistviewaccessible.cpp
M  +7    -0    src/kitemviews/accessibility/kitemlistviewaccessible.h
M  +13   -5    src/kitemviews/kitemlistcontroller.cpp
M  +20   -11   src/selectionmode/topbar.cpp
M  +2    -0    src/selectionmode/topbar.h
M  +92   -3    src/tests/kitemlistcontrollertest.cpp
M  +6    -0    src/views/dolphinview.cpp

https://invent.kde.org/system/dolphin/-/commit/3696213ccbbe27e9ef3fc85eb97dd32fd669066f