Bug 161730 - Make RightClick+D delete columns too, not just rows
Summary: Make RightClick+D delete columns too, not just rows
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.2.4.2 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyBeginner, easyHack, skillDesign, topicUI
Depends on:
Blocks: Shortcuts-Accelerators UNO-Command-Label
  Show dependency treegraph
 
Reported: 2024-06-21 12:34 UTC by excepters
Modified: 2024-06-25 14:38 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description excepters 2024-06-21 12:34:24 UTC
Description:
I just migrated from Excel, where you can quickly delete a row or column by right-clicking its header and pressing D on the keyboard.

For some bizarre reason in LibreOffice this only works with rows, and not with columns. Right-clicking a column header and pressing D on the keyboard does nothing. This is annoying and affects usability.

There is no reason for this inconsistency. This functionality must be consistent for both rows and columns. Just like with rows, it should be possible to delete a column by right-clicking its header and pressing D on the keyboard.

Steps to Reproduce:
1. Right click the header of a row which contains some data
2. Press D on your keyboard
3. Notice how the row is instantly deleted
4. Right click the header of a column which contains some data
5. Press D on your keyboard
6. Notice how nothing happens

Actual Results:
Only rows can be deleted by right-clicking their header and pressing D on the keyboard

Expected Results:
Both rows and columns can be deleted by right-clicking their header and pressing D on the keyboard


Reproducible: Always


User Profile Reset: Yes

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: SpreadsheetDocument

Version: 24.2.4.2 (X86_64) / LibreOffice Community
Build ID: 51a6219feb6075d9a4c46691dcfe0cd9c4fff3c2
CPU threads: 12; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 1 ady 2024-06-21 14:36:12 UTC
Unfortunately, these keyboard accelerators (and shortcuts in general) have changed more than once, for several reasons, and sometimes just because lack of thought about the implications.

Sometimes the keyboard accelerators / shortcuts depend on UI language. There are several considerations.

The Delete Rows keyboard accelerator assigned to "D" might also be just a coincidence. IDK.

Although using the same keyboard accelerator for both content menus (Rows/Columns Headers) for "Delete Row(s)" and for "Delete Column(s)" (at least in en_US) makes sense, there might be other considerations too.

CC'ing Heiko.

Side note: there are shortcuts to delete rows or columns too, after selection, which also has its own shortcuts too, but that's not the point of the ticket.
Comment 2 Heiko Tietze 2024-06-24 13:39:11 UTC
Right clicking the col/row header opens the respective context menu. And keys execute the function associated with the mnemonic. This is not a shortcut. 

Mnemonics can be hard-coded like _Delete or assigned automatically. If two commands have the same mnemonic, ie. in case of too many items, you need to press the key repeatedly to iterate through the content menu (and execute per enter). 

I'm currently on macOS where this is the default (mnemonics are not visible but keys jump to the position). And in both cases, row or column, D + enter run the expected action.

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 8; OS: macOS 14.5; UI render: default; VCL: osx
Locale: de-DE (en_DE.UTF-8); UI: en-US
Calc: threaded
Comment 3 ady 2024-06-24 15:44:45 UTC
(In reply to Heiko Tietze from comment #2)

> I'm currently on macOS where this is the default (mnemonics are not visible
> but keys jump to the position). And in both cases, row or column, D + enter
> run the expected action.

It is "C" on:
Version: 24.2.4.2 (X86_64) / LibreOffice Community
Build ID: 51a6219feb6075d9a4c46691dcfe0cd9c4fff3c2
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (es_AR); UI: en-US
Calc: CL threaded

But, again, languages matter, and "D" used to be the accelerator in some past versions.

So, IDK what was the reasoning (or lack of it, or some "automatic" change in some other menu entry) for the mnemonic keyboard accelerator to change in this case.
Comment 4 ady 2024-06-24 16:51:12 UTC
I am setting this to NEW. If "D" is seen on other OS's, then someone at least should take a look at the reasons for the keyboard accelerator / mnemonic to be different on Windows (while it was "D" in some older versions). Perhaps this is a negative unwanted consequence of some other change; a change that might have been well-intended.
Comment 5 Heiko Tietze 2024-06-25 08:46:46 UTC
Confirming for master/25.2 on Linux

.uno:DeleteRows in defined in CalcCommands.xcu (no mnemonic) and .uno:DeleteColumns in GenericCommands.xcu (with a mnemonic on C). I moved the Calc command into Generic for bug  114286 in https://gerrit.libreoffice.org/c/core/+/131680, reverted by Julien in https://gerrit.libreoffice.org/c/core/+/152169 (why?) with a modification to the label my myself in https://gerrit.libreoffice.org/c/core/+/160834.

Removing the C is an easyhack but I wonder why we need this mix of scope.
Comment 6 Julien Nabet 2024-06-25 11:32:44 UTC
(In reply to Heiko Tietze from comment #5)
> Confirming for master/25.2 on Linux
> 
> .uno:DeleteRows in defined in CalcCommands.xcu (no mnemonic) and
> .uno:DeleteColumns in GenericCommands.xcu (with a mnemonic on C). I moved
> the Calc command into Generic for bug  114286 in
> https://gerrit.libreoffice.org/c/core/+/131680, reverted by Julien in
> https://gerrit.libreoffice.org/c/core/+/152169 (why?) ...
As indicated in the patch:
"Reason: cause of tdf#155442
Accelerator to delete row(s) conflicts with the one for adding row(s)"


I must have already told about it but shortcuts part is quite a mess since you must take into account:
- no dup for all languages (this one only is almost impossible sometimes)
- the different envs (gtk, kde, etc.)
- search of compatibility with MsOffice
- special keys with macOS
- etc
So not interested in this one, uncc myself.
Feel free to revert any commit I did related to this.
Comment 7 ady 2024-06-25 13:29:45 UTC
IOW, keyboard accelerators conflict between (Column header) context menu and main menu ("Sheet").
Comment 8 Heiko Tietze 2024-06-25 14:38:51 UTC
@excepters: Labels are defined for commands (.uno:*) and are used on all places in the UI. While it might work on the context menu to have D hard-coded for both,  this ends up in a conflicting situation on the main menu under Sheet.

You can, however, assign shortcuts to commands via Tools > Customize. Using the same shortcut like ctrl+D (you would have to clear the current assignment in this case) to both commands is likely also not helpful.

Ultimately this is a WONTFIX.