Bug 160317 - Pressing Tab with partially selected numbered paragraphs deletes content instead of changing level
Summary: Pressing Tab with partially selected numbered paragraphs deletes content inst...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Bullet-Number-Outline-Lists
  Show dependency treegraph
 
Reported: 2024-03-22 16:40 UTC by Gabor Kelemen (allotropia)
Modified: 2024-04-05 12:37 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file for testing (11.98 KB, application/vnd.oasis.opendocument.text)
2024-03-22 16:40 UTC, Gabor Kelemen (allotropia)
Details
Highlighting that works in this context, both in Word 2021 and Writer nightly (49.56 KB, image/png)
2024-03-22 16:41 UTC, Gabor Kelemen (allotropia)
Details
Highlighting that does not work in this context (22.09 KB, image/png)
2024-03-22 16:42 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2024-03-22 16:40:54 UTC
Created attachment 193242 [details]
Example file for testing

When one of several numbered paragraphs is highlighted fully, pressing Tab key increases its outline level.
However if one numbered paragraph is highlighed fully and the next one is half highlighted, pressing the Tab key replaces the content with the tab character.
In contrast, in Word both paragraphs outline level is increased.
It would be desirable to have this behavior in Writer.

1. Open attached file
2. Highlight the second paragraph and press Tab
-> it becomes indented, numbering changes - good
3. Highlight the third paragraph and half of the fourth, and press Tab
-> a tab character replaces the highlighted part.

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 09c6204b6309321aa25c542f918fde9f5f3f7fe2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: threaded
Comment 1 Gabor Kelemen (allotropia) 2024-03-22 16:41:39 UTC
Created attachment 193243 [details]
Highlighting that works in this context, both in Word 2021 and Writer nightly
Comment 2 Gabor Kelemen (allotropia) 2024-03-22 16:42:04 UTC
Created attachment 193244 [details]
Highlighting that does not work in this context
Comment 3 Bogaboga Man 2024-03-22 16:53:51 UTC
I think that's how the editor is supposed to "behave" ... deletion also happens when just part of the text on a line is selected and the `tab' button is hit. I will let others change status if called for.
Comment 4 Stéphane Guillou (stragu) 2024-03-22 23:49:10 UTC
(In reply to Gabor Kelemen (allotropia) from comment #0)
> 2. Highlight the second paragraph and press Tab
> -> it becomes indented, numbering changes - good
This only works when it is selected by hand up to the next line, including the paragraph break / numbering. If using triple-click selection, text is replaced.

I agree that the expected interaction when selection _several_ paragraphs (full or partial) and pressing Tab or Shift + Tab is to change the level. Not as sure about what should happen after a triple-click paragraph selection though.

Copying in UX/Design for opinion.

Behaviour is inherited.
Comment 5 Heiko Tietze 2024-03-26 10:46:56 UTC
There should be means to insert a literal tab character. Lately we had a discussion on bug 146762 requesting to "Demote level of first list item with tab (and promote with shift+tab) and introduce ctrl+shift+tab to indent the whole list" where this was discussed too. 

See also bug 150848 "Tab key should ignore indent", resolved WF.
Comment 6 Heiko Tietze 2024-04-05 12:37:07 UTC
We discussed the topic in the design meeting.

In principle, tab inserts a literal character when running inside the paragraph but increases the list level when done at the beginning. Same is true for MSO (although all items become indented when tab is inserted on the first item), and adding the tab inside the paragraph does the same as LibreOffice and overwrites the content. But not when it starts before the paragraph - then MSO increases the level for all selected paragraphs.

To avoid the necessity of placing the cursor at the exact position some believe it makes sense to always change the level on tab/shift+tab in case of multi-selection.

However, it's not clear what should happen with other selection types, where adding selection inserts at the beginning while extend does on the end. And in case of a block selection it could be the users' expectation that all selected characters are replaced with the inserted content (which would be inconsistent with add/extend).

So if this is going to be implemented we should do only for regular selections.