Bug 126352 - “Create Style” Dialogue Does not Work Correctly if Opened via Menu or Toolbar: (often/always) shows other styles than the 'own styles', sometimes inactive when it shouldn't ..
Summary: “Create Style” Dialogue Does not Work Correctly if Opened via Menu or Toolbar...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
6.2.5.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Styles-Management Styles-Dialog
  Show dependency treegraph
 
Reported: 2019-07-11 19:52 UTC by Harald Koester
Modified: 2022-03-03 11:10 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Mockup for New Style with Stylefamily (14.75 KB, image/png)
2022-03-03 11:10 UTC, Heiko Tietze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Koester 2019-07-11 19:52:58 UTC
In order to reproduce the bug:

[1] Create new text document.
[2] If sidebar is displayed close sidebar, close document and create new document again.
[3] Start to create a new style with menu: Styles > New Style… The Create Style dialogue is displayed. In a list box all “list” styles are displayed. Why are these styles displayed here and now? I would expect an option to choose the style type (paragraph style or character style or …).
[4] Click Help in dialogue. According to the displayed help page the “user-defined” styles should be displayed in the list box. This is definitively not the case, “all” list styles are displayed.
[5] Click a list style in the list box. The style is taken over to the text box “Style Name”. Then OK. A message is displayed that the style already exists. The message is OK but what is the sense of this takeover when you can't create a new style with a name of an existing style? Close message.
[6] Insert a new name. Then OK. The current paragraph style is changed to the new style. I only expect that a new style is created and that the current style is not changed.
[7] Start to create another new style with the menu: Styles > New Style… Now the “used” paragraph styles (Default Style and new style) are displayed. Expected: Only display of user-defined styles. Then Cancel.
[8] Display styles with F11.
[9] Start to create another new style with the menu: Styles > New Style… Now all paragraph styles are displayed. Expected: Only display of user-defined styles.

Furthermore:

(1) I did not find a possibility to create other types of styles than paragraph styles with the menu function.
(2) If you use the icon New Style in the toolbar Formatting at steps 3, 7 and 9 the behaviour is nearly equal, only at step 3 the listed styles are different. Expected: Behaviour should be equal.
(3) The New File function from the horizontal toolbar of the deck Styles in the sidebar also uses the Create Style dialogue. In this case the listed styles are correct, i.e. only the user-defined styles are listed.
(4) Also in Calc the Create Style dialogue is used with similar problems.
(5) Bug occurred first with the introduction of the menu item Styles in Writer (version 5.1.0).

Proposal: 

I do not really see an advantage to list existing or used styles if you like to create a new style. So the list box User-defined Styles can be omitted. Instead a possibility to choose a style type is needed. After such a choice the respective style dialogue with the register Organizer should be opened.
Comment 1 V Stuart Foote 2019-07-13 03:47:49 UTC
Confirmed with 6.2.5.2 on Windows -- bad labeling. IMHO NAB

But, I think this was resolved for 6.3 by https://gerrit.libreoffice.org/plugins/gitiles/core/+/6acf4af3c90cca4edbad4fceb9c07bf90805a224%5E%21 [1]

"New Style..." was removed; and IIUC essentially changes to menu action labeling to clarify the New would always be based on currently active style of selection-- i.e. Default in the STR here (that is a new document, no text to canvas, so what is the "selection") list includs all the parent style types. 

Otherwise never truly a New style rather, always with inheritance.  And, behavior is correct when an actual selection from canvas has an applied style, not direct formatting, applied--result will be recorded as a Custom style, and shown as an Applied style.

@Cor, Roman -- thoughts? Everything as expected?

=-ref-=
[1] https://gerrit.libreoffice.org/#/c/66974/
Comment 2 Cor Nouws 2019-07-13 09:15:37 UTC
Thanks Stuart,, Harald,

(In reply to V Stuart Foote from comment #1)

> But, I think this was resolved for 6.3 by
> https://gerrit.libreoffice.org/plugins/gitiles/core/+/
> 6acf4af3c90cca4edbad4fceb9c07bf90805a224%5E%21 [1]
Indeed: "New style from selection" at least sets expectations right.

However..

(In reply to Harald Koester from comment #0)
> [3] Start to create a new style with menu: Styles > New Style… The Create
> Style dialogue is displayed. In a list box all “list” styles are displayed.
If I start the dialog in an empty document, page styles are displayed :)
And if I add some text, paragraph styles.
> Why are these styles displayed here and now? I would expect an option to
> choose the style type (paragraph style or character style or …).
Indeed. All these are wrong.

> [4] Click Help in dialogue. According to the displayed help page the
> “user-defined” styles should be displayed in the list box. This is
> definitively not the case, “all” list styles are displayed.
And that is what you'll see if you start the Create New Style dialog from the widget in the Styles dialog (Side Bar)

So this definitely is a bug. Could you pls change this bug report accordinly, Harald?
Furthermore: you've mentioned quite some things here. Maybe even separate but related issues, that deserve a separate bug report?

Cor
Comment 3 V Stuart Foote 2019-07-13 13:01:44 UTC
(In reply to Cor Nouws from comment #2)

But if you make selection of a word or character with some 'Character' style applied you get exactly that style and its parents.  So again the logic of the "Create Style" dialog is based on what selection is made.

Remaining issue when opening a new "empty" document and getting the 'List' styles is wrong. It acts like no selection on canvas defaults to the 'List' styles, and that is not right it should probably be 'Paragraph' styles.

But by giving it a touch, i.e. first opening 'Character' dialog or 'Page' dialog, the Create Style dialog responds to use that as parent style type. So there is ability to control the style type when no paragraph, word or character selection is made.

Unfortunately opening the 'Paragraph' dialog, or the 'Bullets and Numbering' dialog on an new "empty" document still results in the 'List' style type default--so something is not correct. 

=> NEW
Comment 4 Cor Nouws 2019-07-13 21:10:40 UTC
(In reply to V Stuart Foote from comment #3)
> (In reply to Cor Nouws from comment #2)
> 
> But if you make selection of a word or character with some 'Character' style
> applied you get exactly that style and its parents.  So again the logic of
> the "Create Style" dialog is based on what selection is made.
:) Did I try to deny that or suggest otherwise ?

> Remaining issue when opening a new "empty" document and getting the 'List'
> styles is wrong. It acts like no selection on canvas defaults to the 'List'
> styles, and that is not right it should probably be 'Paragraph' styles.
It behaves odd.
There is *no* logic or regular behavior for me.
After first opening with a list, closing, removing list, typing text... the meny entry "New Style From Selection" is greyed out.. SHft+F11 work and show the Page Style in my situation.
Comment 5 Heiko Tietze 2019-07-14 07:08:37 UTC
New Styles is also available in the sidebar (right-most menu icon on top). And it lists here the hierarchy beginning with the current (newly created) item. So what happens is that Default is shown and since the other styles haven't been created until the sidebar is opened nothing else (I guess that happens). 

Even when the list is okay, do we really need this dialog for just entering the style name? If you right click the actual style, New does what I expect - it shows the paragraph style dialog with name 'Untitled' being focused.
Comment 6 Cor Nouws 2019-07-14 11:36:02 UTC
(In reply to Heiko Tietze from comment #5)
> Even when the list is okay, do we really need this dialog for just entering
> the style name? If you right click the actual style, New does what I expect
> - it shows the paragraph style dialog with name 'Untitled' being focused.
That is not the same as doing some fancy direct formatting and then from that text create a new style.

And there are even more way's to accomplish this task. But that doesn't solve the broken dialog launched via the menu (and toolbar - which I didn't check to be honest).
Comment 7 Heiko Tietze 2019-07-15 07:21:21 UTC
(In reply to Cor Nouws from comment #6)
> That is not the same as doing some fancy direct formatting and then from
> that text create a new style.

I'm trying to get rid of the 'create style' dialog and we could show the paragraph formatting dialog per New (all New) populated with the Default properties or with your fancy direct formatting. The name field is editable so there would be no regression.
Comment 8 Harald Koester 2019-07-17 16:27:14 UTC
(In reply to Heiko Tietze from comment #7)
...

> I'm trying to get rid of the 'create style' dialog and we could show the
> paragraph formatting dialog per New (all New) populated with the Default
> properties or with your fancy direct formatting. The name field is editable
> so there would be no regression.

In my initial report I proposed that first a user should choose the type of style and afterwards the formatting dialog will be opened. If only paragraph styles should be created with menu/toolbar, as you proposed, the menu items and icon tips should be renamed: "New Paragraph Style" instead "New Style". Otherwise, I think, a user may be irritated, if s/he likes to create another type of style.
Comment 9 V Stuart Foote 2019-07-17 16:57:08 UTC
(In reply to Harald Koester from comment #8)

> In my initial report I proposed that first a user should choose the type of
> style and afterwards the formatting dialog will be opened. If only paragraph
> styles should be created with menu/toolbar, as you proposed, the menu items
> and icon tips should be renamed: "New Paragraph Style" instead "New Style".
> Otherwise, I think, a user may be irritated, if s/he likes to create another
> type of style.

So the dialog should have a set of radio buttons?  When a selection is made from canvas it would pre-select that radio button.  If no selection, then picking a radio button would set that style type (as currently customized, or with defaults for the type?).

Seems reasonable way to adjust what is otherwise a useful dialog.
Comment 10 sdc.blanco 2021-01-14 16:22:33 UTC
(In reply to Heiko Tietze from comment #7)
> I'm trying to get rid of the 'create style' dialog 
I would like to defend it, for the reasons given in comment 6.  It is possible (and easy) to customize a character style or list style using direct formatting and the nice spin boxes in the sidebar.  Or decide post-facto that it would be nice to save a particular direct formatting.  

(In reply to V Stuart Foote from comment #9)
> (In reply to Harald Koester from comment #8)
> 
> > In my initial report I proposed that first a user should choose the type of
> > style and afterwards the formatting dialog will be opened. If only paragraph
> > styles should be created with menu/toolbar, as you proposed, the menu items
> > and icon tips should be renamed: "New Paragraph Style" instead "New Style".
> > Otherwise, I think, a user may be irritated, if s/he likes to create another
> > type of style.

Bug 107120 suggests exactly this menu change.   But the next suggestion dissolves the need for that change.

> So the dialog should have a set of radio buttons?  When a selection is made
> from canvas it would pre-select that radio button.  If no selection, then
> picking a radio button would set that style type (as currently customized,
> or with defaults for the type?).

I would like to make the same suggestion.  

In effect, such a design would move the current "radio buttons" step from the Style deck into the dialog box (and dissolve the OP of this bug about difference between menu and sidebar) and bug 107120

And it might not be too hard (i.e., EasyHack), if Caolán finishes a patch that would make the Style Family available to the dialog box. ( https://gerrit.libreoffice.org/c/core/+/108159 )

In the following mockup, which builds on the existing "New Style from Selection" dialog box, %STYLEFAMILY refers to {Paragraph, Character, Page, Frame, List, Table}

(no strong opinions intended about layout, just to communicate basic idea)

-------------------------------------------
 [x] Paragraph [ ] Character [ ] Frame 
 [ ] Page      [ ] List      [ ] Table  

 Enter new %STYLEFAMILY style name:
   __________________

 Custom %STYLEFAMILY styles for current document


----------------------------------------------

- Radio buttons are active (or deactivated) depending on current cursor position or selection.

- "default" is always ambiguous because a cursor in an empty document could still be "page" or "paragraph" style ==> some simple rules like: 
  "if in frame, start with frame"
  "if in table, start with table"
  "if in list, start with list"
  elseif characters selected, then start with "character" as default, else "paragraph"
Comment 11 sdc.blanco 2021-01-14 16:59:38 UTC
Forgot to mention - that this dialog box is also used for Calc, Draw, and Impress.
Calc has "Cell" and "Page Style", while Draw and Impress only have "object" so probably do not need radio buttons.
Comment 12 sdc.blanco 2021-03-05 21:57:34 UTC
Adding UXEval (in relation to comment 10) and can clarify that %STYLECATEGORY  in the unmerged patch (https://gerrit.libreoffice.org/c/core/+/108159 ) provides what is called %STYLEFAMILY in comment 10.

To summarize:
1.  Proposal in comment 10 fits well with bug 116497, because with this change, "new style" conditionality would move from being set before the dialog is opened to the dialog itself, so it would always be relevant/applicable.
2. Would make bug 107120 unnecessary, in effect, transforming it into WF.
3. Would address OP of this bug.
4. Would improve usability, comprehensibility of "New Style from Selection" (formerly "Create Style") dialog box.
Comment 13 sdc.blanco 2021-03-05 22:05:15 UTC
5. May also address/resolve bug 106782
Comment 14 Heiko Tietze 2022-03-03 11:10:14 UTC
Created attachment 178635 [details]
Mockup for New Style with Stylefamily

The issue here is that "New Style from Selection" started from the Stylist adds PS, CS, or LS depending on the currently visible tab. Started from the main menu it always adds PS.

Solutions:
a) The ticket duplicates bug 107120 where the decision was to label the main menu accordingly: ”New Paragraph Style from Selection”.
b) The same topic however with a request to add UNO commands is done in bug 106782.
c) This ticket suggests to solve the problem by adding a target selection to New Style dialog.

Remarks:
a) Sounds easy to do in contrast to b)
b) It multiplies the UNO commands by the style families, not the best for maintenance and customization
c) The style family could be preselected according the active Stylist tab. Don't see an issue for UX and rather the advantage of showing what is possible