Bug 151563 - Inconsistent behavior of "New style from selection" in Styles list and Styles menu
Summary: Inconsistent behavior of "New style from selection" in Styles list and Styles...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.7.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: UNO-Command-New Styles Sidebar-Styles
  Show dependency treegraph
 
Reported: 2022-10-16 11:22 UTC by [REDACTED]
Modified: 2024-10-23 11:36 UTC (History)
6 users (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 [REDACTED] 2022-10-16 11:22:28 UTC
Description:
When you select some text apply, formatting by direct formatting until you are content with it, and them want to create a new style from that selection, you can select the Styles menu and select New style from selection, which will always create a paragraph style, or first select the styles category that you want for your new style, then select the New style from selection in the Styles action drop down menu on the far right of the styles list, which will then result in a new style in the correct style category. Same name, different behavior. I think that's misleading. 
I like redundancy in where you can access commands, as some people like clicking toolbars, others menubars and yet other people want keyboard links. But I expect that all commands, regardless of where they are accessed, will do the exact same thing, so that a user doesn't get confused, or, worse, starts thinking that some functionality is simply not available, like, you can't make a new character style from selected text. 
It'd be better if both commands give the same result. After all, both commands get you to the same dialog box, where you can only enter a name. 

I suggest that you add a selection list to that dialog box, where you can select the category (Paragraph, Character, etc.), so that people who don't work much with the Styles list open, can access the menu bar command, enter a name and select the correct category; and people who work with the Styles list open but forget to select the correct category first, still get a chance to get the right one.

Please also see the discussion in https://ask.libreoffice.org/t/different-styles-in-same-paragraph/82884

Steps to Reproduce:
1. Select some text in an open document, apply some formatting (not necessary).
2. Select the Styles list, select the Character styles list. Select Menu - Styles - New style from selection.
3. Open the Styles list, select a category other than Paragraph, select New style from selection in the Styles actions list at the far right of the Styles list.

Actual Results:
For step 2  > A new paragraph style is added, regardless of the selected category in the Styles list.
For step 3  > A new style is added in the correct category.

Expected Results:
You'd expect that if the Character styles list was selected, you´d get a new character style in both cases, but it doesn't.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.4.2.3 / LibreOffice Community
Build ID: 22949782292d40bc0751a2b0b2cf40927460a4f8
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: nl-NL (nl_NL.UTF-8); UI: en-US
Calc: threaded
Comment 1 LeroyG 2022-10-16 18:23:33 UTC
At least add the word "paragraph" to this field in the dialog:

Now: Enter new style name:
New: Enter new paragraph style name:

Fiedl at Menu Styles - New Styles from Selection (Shift+F11)

Same behavior with:
Version: 7.2.7.2 (x64) / LibreOffice Community
Build ID: 8d71d29d553c0f7dcbfa38fbfda25ee34cce99a2
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: default; VCL: win
Locale: es-MX (es_ES); UI: en-US
Calc: CL
Comment 2 Dieter 2023-11-05 16:33:27 UTC
As far as I can see current behaviour is

a) New Style from Selection in styles menu: New style is always a PS
b) New Style from Selection with shift+F11: New style is always a PS
c) New Style from Selection with toolbar icon: New style is always a PS
d) New Style frome Selection in sidebar: If PS are active you create a new PS, if CS is active you create an new CS, if list styles are active you create an new list style

I agree, that this isn't obvious for the user and should be improved within the "Nwe Style From Selection" dialog.

cc: Design-Team

For a solution please take also into account bug 139113.
Comment 3 Heiko Tietze 2023-11-08 14:39:42 UTC
We have the options to 
a) create an alternative command for CS so shift+ctrl+F11 would create a CS
  + drawback is that we have to add another menus entry
    and add one to the toolbar (or remove the option there)
b) make the command depending on the chosen tab in the Stylist
  + not so obvious to users
  + once bug 143987 is implemented this is not a viable solution
c) block keyboard/menu/toolbar access to the function
  + we could also limit the function to PS - and remove the button for CS
 
The function is available for PS, CS, and Page Style.
Comment 4 Mike Kaganski 2023-11-08 16:04:21 UTC
I disliked it back then, when Styles menu was created, that "style" there was implicitly related to "paragraph style", nothing else. It had to become a problem.

The Styles menu, if it exists at all, has to be separated to all the categories, with respective and quite functional submenus... which could become quite complex, but c'est la vie.
Comment 5 Heiko Tietze 2023-11-23 09:35:35 UTC
We discussed the topic in the design meeting.

The functions works as expected in the Stylist but not anywhere else. And while it's not obvious that the command uno:StyleNewByExample is needed as command making it available in the menu/toolbar/shortcut it requires otherwise the use of the sidebar.

So we suggest to first rename the command to "New Paragraph Style From Selection" and then to introduce a new command which does the same for character style. It's unlikely that other style families are needed.

Code pointer for renaming: officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu

However, it's a generic command available in Calc too, where it creates a new cell style. We might need to separate it from GenericCommands into sw/sc....
Comment 6 Cor Nouws 2024-10-23 11:36:48 UTC
(In reply to Heiko Tietze from comment #5)
> So we suggest to first rename the command to "New Paragraph Style From
> Selection" and then to introduce a new command which does the same for
> character style.
Appreciate that.
The idea mentioned by OP - dropdown in the dialog to choose the category for the new style, is not bad either.
> It's unlikely that other style families are needed.
Frame styles is one I do use, and it does create a new style from selection there too.