CollaboraOnline / online

Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
https://collaboraonline.com
Other
1.82k stars 697 forks source link

Use also Ctrl or Alt when dragging rows, columns, cells #8033

Open timur-g opened 9 months ago

timur-g commented 9 months ago

In Online Calc 23.05.7 it is possible to select rows, columns, cells and drag them. Note that previous requests are resolved: #1917 #3745) . A recent imporovement is that selection follows the mouse, when we click on a row/column header and drag the mouse. This is enhancement request to be also able to use Ctrl or Alt when releasing, so that we can insert or move, as in Core. Simple drag moves the content and overwrites destination. Ctrl duplicates content, Alt insert it. Used after moving, before releasing mouse button.

raxod502 commented 9 months ago

I'm running Nextcloud 28.0.1 using Nextcloud Office 8.3.0 and CODE Server 23.5.604. As of yet, I haven't been able to figure out any key or mouse sequence that will reorder rows or columns. Do I just need to update to a later version, or am I running the wrong distribution of Collabora Online, or am I just misunderstanding the appropriate shortcut to use?

timur-g commented 9 months ago

"Reorder" by dragging involves moving, inserting and not overwriting, and holding Ctrl or Alt are used for that, this bug.
@raxod502 you may try to make it work yourself, if you can, someone would review and merge.

raxod502 commented 8 months ago

I'm afraid I don't quite understand. I've attached a screen recording that shows what happens when I try to drag and drop a row in a spreadsheet in Nextcloud. Regardless of whether I select the row first or not, or if I'm holding Ctrl, Alt, or both, nothing happens.

https://nextcloud.intuitiveexplanations.com/s/ocJMGLoZBxx69HC

It sounds like you're saying that there is currently some way to drag and drop rows or columns in a spreadsheet. This doesn't seem to be the case in the Nextcloud instance I'm using. I'm trying to understand if this is expected behavior, or unexpected behavior.

Tex2002ans commented 8 months ago

Hey @raxod502, I'm attaching your video here so that we don't lose it (in case your shared link goes down):

https://github.com/CollaboraOnline/online/assets/5774324/0a1a9a40-037b-46ef-9978-0e50d99cb9f2


I'm running Nextcloud 28.0.1 using Nextcloud Office 8.3.0 [...] I haven't been able to figure out any key or mouse sequence that will reorder rows or columns.

Yeah, I believe that's what @timur-g meant with this Enhancement.

You can't do this using the mouse+shortcuts in Collabora Calc 23.05 right now.

For more info, see:

You can use various combos of Alt + Ctrl + Shift with drag/drop in order to insert/overwrite cells.


For example, in...

LibreOffice 24.2

1. Highlight the things you want to move by:

2. Depending on what you want to do:

3. While still holding the above shortcuts:

4. Then:

(While doing this, you should notice a new dark line/box appearing, showing you where the data will be dropped.)

5. Then:

All highlighted data from Step 1 now moves/shifts/duplicates.

For example:

  1. Highlight your B2->B10.
  2. Hold Alt.
  3. Left-Click+Hold your mouse inside B2.
  4. As you move your mouse around, you'd see a dark line/border showing where this data will move.
  5. Release mouse, and your data will Move.

In Collabora 23.05.7, these Alt+Ctrl methods don't work.


Side Note: Also See Related Discussion

I was able to finally these shortcuts working in LibreOffice Calc—but it definitely is extremely awkward/clunky, ESPECIALLY when dealing with rows/columns.

(Personally, I always just used cut/paste. Never bothered too much with a mouse-method.)

raxod502 commented 8 months ago

Ah, silly me, I forgot that GitHub actually supported video attachments directly. Should have done that in the first place.

I'd actually not be so bothered with drag-and-drop if I could figure out a workflow pasted on cut-and-paste that worked well for reordering rows. The problem is when I paste a row or column it just overwrites the existing one. Is there a way to cause it to insert the selection in between existing rows or columns, rather than overwrite? As a workaround I manually right-click on the margin and insert the correct number of rows or columns, then paste to overwrite them. But this is tedious and error-prone. I'm curious what your preferred workflow is in Collabora, @Tex2002ans?

Tex2002ans commented 8 months ago

I'm curious what your preferred workflow is in Collabora, @Tex2002ans?

Ahh, personally I actually don't do TOO much work in spreadsheets.

And when I do, it's only basics (like moving/cutting 1/2 columns), or always appending to the final row/column.

So, for me, usually it's just as easy to:

@raxod502 But, it should be possible to do it with "Paste Special" (Ctrl+Alt+Shift+V)—almost the same as in LibreOffice. :)


The problem is when I paste a row or column it just overwrites the existing one. [...] Is there a way to cause it to insert the selection in between existing rows or columns, rather than overwrite?

Using "Paste Special" + the "Text Import" Dialog

❗ Important❗With an entire row/column of data cut/copied...

In LibreOffice Calc

  1. Edit > Paste Special (Ctrl+Alt+Shift+V)
  2. Choose "Use text import dialog".
  3. In the "Paste Special" menu...

Under "Shift Cells", you'll see 3 radio buttons:

I then:

LibreOffice 24 2 0 - Paste Special - Text Import Dialog

  1. Press OK.

Now, the newly pasted row/column will automatically shift the other data down (or to the right).

In Collabora Calc

You can do a similar thing, except you have to...

  1. Press Ctrl+Alt+Shift+V.

Now you'll see this odd popup:

Collabora 24 04 0 - Paste Special - Ctrl+Alt+Shift+V Popup

Your browser has very limited access to the clipboard.

Please press now: Ctrl+V to see more options.

Close popup to ignore paste special.

  1. Press Ctrl+V.

This will get you to the "Text Import" dialog:

Collabora 24 04 0 - Paste Special - Text Import Dialog

Continue with steps 3+ above.


Side Note: Currently, I think this "Paste Special" menu isn't easily done/supported—(and is a little awkward/buggy)—because of browsers severely interfering with clipboards. See:

But, there is work being on it. :P

(And prettifying it too!)


Side Note 2: If you want some more technical info on supporting copy/paste between browsers/OSes/applications, also see:

That talk goes into some of the horrors of shifting data around and all the different ways it can be done in Windows/Mac/Linux + Chrome/Firefox/Edge... and then you throw Android/iOS and their keyboards in the mix too. :P


I'd actually not be so bothered with drag-and-drop if I could figure out a workflow pasted on cut-and-paste that worked well for reordering rows.

@raxod502 And what is the use-case? Why are you moving/shifting this so often? Can you give some examples?

Anyway, instead of clogging enhancement request up... maybe we can:

Looking forward to talking with you further. :)

raxod502 commented 8 months ago

Thank you, that trick with Paste Special is exactly what I was looking for, and is good enough to act as a workaround for me at least for now.

I made a forum thread for any further discussion: https://forum.collaboraonline.com/t/reordering-rows-columns-in-spreadsheet/2380