Bug 17179 - Advanced editor: Add keyboard shortcuts to repeat (duplicate) a field, and cut text
Summary: Advanced editor: Add keyboard shortcuts to repeat (duplicate) a field, and cu...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low new feature (vote)
Assignee: Nick Clemens
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 21411
Blocks: 27769
  Show dependency treegraph
 
Reported: 2016-08-24 00:31 UTC by Nick Clemens
Modified: 2021-12-13 21:09 UTC (History)
11 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This patchset introduces an internal clipboard to the advanced editor and provides some new functionality to make use of it; The following default shortcuts are provided but can be edited as per bug 21411. Changed: * `Ctrl-X`: Now cuts a line into the clipboard area * `Shift-Ctrl-X`: Now cuts current subfield into clipboard area Added: * `Ctrl-C`: Copies a line into the clipboard area * `Shift-Ctrl-C`: Copies current subfield into clipboard area * `Ctrl-P`: Pastes the selected item from the clipboard at cursor * `Ctrl-I`: Copies the current line and inserts onto a new line below
Version(s) released in:
19.11.00


Attachments
Bug 17179 - Add keyboard shortcuts to repeat (duplicate) a field, and cut text (5.81 KB, patch)
2017-07-18 19:29 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 17179 - Add keyboard shortcuts to repeat (duplicate) a field, and cut text (5.94 KB, patch)
2017-10-07 23:45 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17179: Followup - Use Ctrl-Shift-V instead of Ctrl-P and fix error (3.61 KB, patch)
2017-10-27 10:19 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 17179: Add keyboard shortcuts to repeat (duplicate) a field, and cut text (5.86 KB, patch)
2019-02-20 17:36 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 17179: Add keyboard shortcuts to repeat (duplicate) a field, and cut text (6.94 KB, patch)
2019-03-04 19:00 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 17179: Add keyboard shortcuts to repeat (duplicate) a field, and cut text (7.66 KB, patch)
2019-03-04 21:18 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 17179: Add keyboard shortcuts to repeat (duplicate) a field, and cut text (7.60 KB, patch)
2019-08-21 15:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 17179: Add keyboard shortcuts to repeat (duplicate) a field, and cut text (7.66 KB, patch)
2019-10-03 13:41 UTC, Alex Sassmannshausen
Details | Diff | Splinter Review
Bug 17179: (follow-up) Correct typos, add default select. (2.92 KB, patch)
2019-10-03 13:42 UTC, Alex Sassmannshausen
Details | Diff | Splinter Review
Bug 17179: Add keyboard shortcuts to repeat (duplicate) a field, and cut text (7.66 KB, patch)
2019-10-04 08:09 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 17179: (follow-up) Correct typos, add default select. (2.97 KB, patch)
2019-10-04 08:09 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 17179: Add keyboard shortcuts to repeat (duplicate) a field, and cut text (7.72 KB, patch)
2019-10-07 21:38 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17179: (follow-up) Correct typos, add default select. (3.03 KB, patch)
2019-10-07 21:38 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17179: (follow-up) Add to kyeboard_shortcuts.sql (1.00 KB, patch)
2019-10-07 23:26 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 17179: Add keyboard shortcuts to repeat (duplicate) a field, and cut text (7.77 KB, patch)
2019-10-08 20:03 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17179: (follow-up) Correct typos, add default select. (3.08 KB, patch)
2019-10-08 20:03 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17179: (follow-up) Add to keyboard_shortcuts.sql (1.06 KB, patch)
2019-10-08 20:03 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2016-08-24 00:31:45 UTC Comment hidden (obsolete)
Comment 1 Nick Clemens 2017-07-18 19:29:16 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2017-10-07 23:45:07 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2017-10-07 23:45:47 UTC
This is a cool feature. Maybe the clipboard could be mentioned in the bug title for the release notes?
Comment 4 Marcel de Rooy 2017-10-27 09:23:35 UTC Comment hidden (obsolete)
Comment 5 Nick Clemens 2017-10-27 10:19:01 UTC Comment hidden (obsolete)
Comment 6 Marcel de Rooy 2017-11-03 06:48:16 UTC Comment hidden (obsolete)
Comment 7 Nick Clemens 2019-02-20 17:36:50 UTC Comment hidden (obsolete)
Comment 8 Nick Clemens 2019-03-04 19:00:50 UTC Comment hidden (obsolete)
Comment 9 Nick Clemens 2019-03-04 21:18:47 UTC
Created attachment 86041 [details] [review]
Bug 17179: Add keyboard shortcuts to repeat (duplicate) a field, and cut text

This patchset introduces an internal clipboard to the advanced editor
and provides some new functionality to make use of this, default shortcuts are provided
but can be edited per bug 21411

The default shortcuts for new/changed functions are:

Changed:
Ctrl-X:       Now cuts a line into the clipboard area
Shift-Ctrl-X: Now cuts current subfield into clipboard area

Added:
Ctrl-C:       Copies a line into the clipboard area
Shift-Ctrl-C: Copies current subfield into clipboard area
Ctrl-P:       Pastes the selected item from the clipboard at cursor
Ctrl-I:       Copies the current line and inserts onto a new line below

To test:
Verify all functionality above and confirm it behaves as expected

Note:
Ctrl-v pastes from the system clipboard - codemirror does not have
access and this is why we use our "Clipboard"

For browser cut/paste please use mouse right click or context menus

Ctrl-P can be accessed as print by focusing outside the editor window
Comment 10 Cori Lynn Arnold 2019-03-05 23:11:55 UTC

I got these to work okay:

Changed:
Ctrl-X:       Now cuts a line into the clipboard area

Added:
Ctrl-C:       Copies a line into the clipboard area
Ctrl-P:       Pastes the selected item from the clipboard at cursor
Ctrl-I:       Copies the current line and inserts onto a new line below

(and I really like Ctrl-I!!, but Control-P if you don't have the cursor in just the right place will pop the print menu)

These did not work:

Expected:
Shift-Ctrl-C: Copies current subfield into clipboard area
Result (in firefox and chrome): Pops up the "Inspector" / Development tools

Expected:
Nothing happens.
Comment 11 Liz Rea 2019-03-07 20:59:05 UTC
Firefox claims so many key combinations :(

I had trouble with ctrl-p (print menu every single time - usability nightmare if it's intermittent), ctrl-l (selects address bar text), ctrl-i (page info, another you have to have the cursor in just the right spot), shift-ctrl-c (inspector).

The one good thing is that with the 21411 bug, you can remap all of the keys to whatever you want. The bad thing is that at least in Firefox, there aren't many key combos left to use that don't have a Firefox feature associated, and often you have to be really careful about where the cursor is when you use them. It could be really, really frustrating for users. Much more frustrating than say, using MARCEdit or some other tool to write your record and then importing the record.

I'm not sure what to do here, none of the options seem perfect. I suppose you could get the cataloguers who use this to install something like https://www.ghacks.net/2016/12/24/disable-keyboard-shortcuts-in-firefox/ so as to unbind and free up a few, but I hate to make people have Firefox addons for what ought to be core features. The use case outlineed in the article there seems very similar to what we are dealing with: an editor window that uses a key binding that also is one that Firefox claims.

If we are going to say "yes, use this plugin for firefox with the advanced editor" then I think I'm ok to let this through basically as is after a bit of retesting with the plugin. But we also need to be aware that not every IT department will allow the usage of Firefox plugins, and that those users will have a sub optimal experience.
Comment 12 Nick Clemens 2019-08-21 15:52:42 UTC
Created attachment 92406 [details] [review]
Bug 17179: Add keyboard shortcuts to repeat (duplicate) a field, and cut text

This patchset introduces an internal clipboard to the advanced editor
and provides some new functionality to make use of this, default shortcuts are provided
but can be edited per bug 21411

The default shortcuts for new/changed functions are:

Changed:
Ctrl-X:       Now cuts a line into the clipboard area
Shift-Ctrl-X: Now cuts current subfield into clipboard area

Added:
Ctrl-C:       Copies a line into the clipboard area
Shift-Ctrl-C: Copies current subfield into clipboard area
Ctrl-P:       Pastes the selected item from the clipboard at cursor
Ctrl-I:       Copies the current line and inserts onto a new line below

To test:
Verify all functionality above and confirm it behaves as expected

Note:
Ctrl-v pastes from the system clipboard - codemirror does not have
access and this is why we use our "Clipboard"

For browser cut/paste please use mouse right click or context menus

Ctrl-P can be accessed as print by focusing outside the editor window
Comment 13 Nick Clemens 2019-08-21 15:55:24 UTC
I would really like to move this one along, the keyboard combos seem to work for me, they may not work on all machines, however, one can now remap these keys to combinations that may work.

I will gladly take suggestions on different default mappings, but I don't think we should consider this a blocker - being web based means we are going to have to make some browser concessions and I don't know that we have a perfect default to provide
Comment 14 Alex Sassmannshausen 2019-10-02 14:31:49 UTC
Hi Nick,

As discussed, I'm failing this because of an error on the Shift-Ctrl-{C,X} keyboard shortcuts.  When they are used, console logs errors that curCursor is not a function.

Also, as a suggested improvement, possibly addressing some of the useability issues raised, it'd be amazing if any cut or copy operation resulted in the latest item in the clipboard being selected immediately.

This would allow users to cut/copy & paste fields and subfields quickly without having to switch to the mouse to select the last copied/cut content and then focusing on the right location in the editor again.

Hth,

Alex
Comment 15 Alex Sassmannshausen 2019-10-03 13:41:48 UTC
Created attachment 93601 [details] [review]
Bug 17179: Add keyboard shortcuts to repeat (duplicate) a field, and cut text

This patchset introduces an internal clipboard to the advanced editor
and provides some new functionality to make use of this, default shortcuts are provided
but can be edited per bug 21411

The default shortcuts for new/changed functions are:

Changed:
Ctrl-X:       Now cuts a line into the clipboard area
Shift-Ctrl-X: Now cuts current subfield into clipboard area

Added:
Ctrl-C:       Copies a line into the clipboard area
Shift-Ctrl-C: Copies current subfield into clipboard area
Ctrl-P:       Pastes the selected item from the clipboard at cursor
Ctrl-I:       Copies the current line and inserts onto a new line below

To test:
Verify all functionality above and confirm it behaves as expected

Note:
Ctrl-v pastes from the system clipboard - codemirror does not have
access and this is why we use our "Clipboard"

For browser cut/paste please use mouse right click or context menus

Ctrl-P can be accessed as print by focusing outside the editor window

Signed-off-by: Alex Sassmannshausen <alex@komputilo.eu>
Comment 16 Alex Sassmannshausen 2019-10-03 13:42:53 UTC
Created attachment 93602 [details] [review]
Bug 17179: (follow-up) Correct typos, add default select.

Correct error whereby object curCursor was invoked as a function.

Added action whereby the most recent entry in the clipboard is
selected after all copy and cut operations.
Comment 17 Nick Clemens 2019-10-04 08:09:22 UTC
Created attachment 93676 [details] [review]
Bug 17179: Add keyboard shortcuts to repeat (duplicate) a field, and cut text

This patchset introduces an internal clipboard to the advanced editor
and provides some new functionality to make use of this, default shortcuts are provided
but can be edited per bug 21411

The default shortcuts for new/changed functions are:

Changed:
Ctrl-X:       Now cuts a line into the clipboard area
Shift-Ctrl-X: Now cuts current subfield into clipboard area

Added:
Ctrl-C:       Copies a line into the clipboard area
Shift-Ctrl-C: Copies current subfield into clipboard area
Ctrl-P:       Pastes the selected item from the clipboard at cursor
Ctrl-I:       Copies the current line and inserts onto a new line below

To test:
Verify all functionality above and confirm it behaves as expected

Note:
Ctrl-v pastes from the system clipboard - codemirror does not have
access and this is why we use our "Clipboard"

For browser cut/paste please use mouse right click or context menus

Ctrl-P can be accessed as print by focusing outside the editor window

Signed-off-by: Alex Sassmannshausen <alex@komputilo.eu>
Comment 18 Nick Clemens 2019-10-04 08:09:25 UTC
Created attachment 93677 [details] [review]
Bug 17179: (follow-up) Correct typos, add default select.

Correct error whereby object curCursor was invoked as a function.

Added action whereby the most recent entry in the clipboard is
selected after all copy and cut operations.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 19 Katrin Fischer 2019-10-07 21:38:06 UTC
Created attachment 93857 [details] [review]
Bug 17179: Add keyboard shortcuts to repeat (duplicate) a field, and cut text

This patchset introduces an internal clipboard to the advanced editor
and provides some new functionality to make use of this, default shortcuts are provided
but can be edited per bug 21411

The default shortcuts for new/changed functions are:

Changed:
Ctrl-X:       Now cuts a line into the clipboard area
Shift-Ctrl-X: Now cuts current subfield into clipboard area

Added:
Ctrl-C:       Copies a line into the clipboard area
Shift-Ctrl-C: Copies current subfield into clipboard area
Ctrl-P:       Pastes the selected item from the clipboard at cursor
Ctrl-I:       Copies the current line and inserts onto a new line below

To test:
Verify all functionality above and confirm it behaves as expected

Note:
Ctrl-v pastes from the system clipboard - codemirror does not have
access and this is why we use our "Clipboard"

For browser cut/paste please use mouse right click or context menus

Ctrl-P can be accessed as print by focusing outside the editor window

Signed-off-by: Alex Sassmannshausen <alex@komputilo.eu>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 20 Katrin Fischer 2019-10-07 21:38:11 UTC
Created attachment 93858 [details] [review]
Bug 17179: (follow-up) Correct typos, add default select.

Correct error whereby object curCursor was invoked as a function.

Added action whereby the most recent entry in the clipboard is
selected after all copy and cut operations.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 21 Katrin Fischer 2019-10-07 21:44:59 UTC
Sorry, going back to failed - just realized changes to installer/data/mysql/mandatory/keyboard_shortcuts.sql are missing :(
Comment 22 Nick Clemens 2019-10-07 23:26:05 UTC
Created attachment 93861 [details] [review]
Bug 17179: (follow-up) Add to kyeboard_shortcuts.sql
Comment 23 Katrin Fischer 2019-10-08 20:03:14 UTC
Created attachment 93897 [details] [review]
Bug 17179: Add keyboard shortcuts to repeat (duplicate) a field, and cut text

This patchset introduces an internal clipboard to the advanced editor
and provides some new functionality to make use of this, default shortcuts are provided
but can be edited per bug 21411

The default shortcuts for new/changed functions are:

Changed:
Ctrl-X:       Now cuts a line into the clipboard area
Shift-Ctrl-X: Now cuts current subfield into clipboard area

Added:
Ctrl-C:       Copies a line into the clipboard area
Shift-Ctrl-C: Copies current subfield into clipboard area
Ctrl-P:       Pastes the selected item from the clipboard at cursor
Ctrl-I:       Copies the current line and inserts onto a new line below

To test:
Verify all functionality above and confirm it behaves as expected

Note:
Ctrl-v pastes from the system clipboard - codemirror does not have
access and this is why we use our "Clipboard"

For browser cut/paste please use mouse right click or context menus

Ctrl-P can be accessed as print by focusing outside the editor window

Signed-off-by: Alex Sassmannshausen <alex@komputilo.eu>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 24 Katrin Fischer 2019-10-08 20:03:18 UTC
Created attachment 93898 [details] [review]
Bug 17179: (follow-up) Correct typos, add default select.

Correct error whereby object curCursor was invoked as a function.

Added action whereby the most recent entry in the clipboard is
selected after all copy and cut operations.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 25 Katrin Fischer 2019-10-08 20:03:22 UTC
Created attachment 93899 [details] [review]
Bug 17179: (follow-up) Add to keyboard_shortcuts.sql

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 26 Martin Renvoize 2019-10-09 13:38:23 UTC
Nice work!

Pushed to master for 19.11.00
Comment 27 Martin Renvoize 2019-11-26 11:27:21 UTC
Added text for the release notes and moved the sponsored by details into a follow-up commit which has been pushed.
Comment 28 Hayley Pelham 2020-01-22 22:47:10 UTC
I feel that this feature has caused some usability issues.

I find it odd that Ctrl-C has been remapped to copy the whole field to the clipboard. I like the feature, but the default should be a different key combination.

I encountered this because I was trying to copy an ISBN as part of testing for bug 21665 and noticed that after selecting the text nothing was happening when I pressed Ctrl-C, no copying to the new clipboard, no copying to my computer's clipboard, nothing.

It took me a while to figure out what was going on and how the new shortcut was supposed to be used, and I imagine a lot of users will encounter similar difficulties.

I am aware that the shortcut can be remapped, but I feel that using Ctrl-C as the default is confusing and frustrating, especially when it functions the same way in basically every other software program.

I propose that for new installations we change the mapping to be Ctrl-E or something similar.

Thoughts?
Comment 29 Phil Ringnalda 2021-02-24 04:17:15 UTC
I filed bug 27769 for that.