Bug 152666 - Can't hide unwanted styles in the Toolbar Formatting - Paragraph Style dropdown
Summary: Can't hide unwanted styles in the Toolbar Formatting - Paragraph Style dropdown
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Heiko Tietze
URL:
Whiteboard: target:7.6.0 inReleaseNotes:7.6
Keywords:
Depends on:
Blocks: Sidebar-Styles Writer-Styles-Paragraph-Combobox
  Show dependency treegraph
 
Reported: 2022-12-24 14:29 UTC by Th3go
Modified: 2023-09-09 03:14 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Further info on hidden HTML text remaining visible in paragraph styles drop down on toolbar (30.06 KB, image/png)
2023-01-05 20:25 UTC, Th3go
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Th3go 2022-12-24 14:29:25 UTC
Description:
I have created my own styles which I use all the time, but I cannot remove some of the styles in the drop down list, which means every time I want to use my styles i have to select the "more styles". This is inhibiting my effectiveness. 
I have tried hiding all the styles I don't use but they still appear on the list. This is very frustrating.
The best solution would be to make the paragraph styles fully customisable in what we want to appear in that drop down list. I don't use or ever want to see quotations, subtitle, preformatted text or Headings 1,2,3, or 4. 
It would also work much better if the list could also have a scroll bar so that we don't have to show more styles

Steps to Reproduce:
1.In the formatting Tool bar have the "paragraph styles select box.
2.try hiding all the styles so you only see the custom styles you have created... I have 30 custom styles. I only want to use those styles.


Actual Results:
I have hidden all the styles in the sets of list Chapter, List,Index, Special. Default Paragraph style cant be hidden obviously, but in HTML style the following I have hidden are still appearing in that list.: 
Default Paragraph, Endnote, Footnote, Heading, Heading 1,2,3,4,5,6, Sender, Table Content, Table Heading and Text Body
Text Styles continues to show Heading 4.Conditional Styles shows text body, Automatic shows Heading 4.
The  main drop down list from the box" paragraph styles" still shows: Default Paragraph style, Text Body,Title,Subtitle, Heading 1,2,3,4,Quotations, and preformatted text.

Expected Results:
After that I created a template and removed all instances of any paragraph style formatting in the document. I made sure I hid all the styles except my custom ones and I expected to see the drop down select list to reflect this. It did not.
I expect styles I have hidden to not appear in any list or in the main drop down lsit


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.3.7.2 (x64) / LibreOffice Community
Build ID: e114eadc50a9ff8d8c8a0567d6da8f454beeb84f
CPU threads: 16; OS: Windows 10.0 Build 19044; UI render: default; VCL: win
Locale: en-AU (en_AU); UI: en-GB
Calc: threaded
Comment 1 Stéphane Guillou (stragu) 2022-12-27 13:17:58 UTC
I agree that hiding styles in the sidebar should also hide them from the toolbar dropdown, but the UX team can judge.
If that is implemented, it should in my opinion be made consistent and the "dropdown in dropdown" menu should offer to hide the style too.

Furthermore, it would be interesting to be able to go the other way and "pin" favourite styles at the top of the toolbar combobox, on top of the existing automatic populating based on use. This would make it quicker for people who want to prioritise a handful of styles. Should probably be a different bug report.
Related to favouriting styles, we have an enhancement request for the Styles sidebar deck in bug 93111.

Th3go, just checking: you are aware of the filters at the bottom of the sidebar, which allow you to only show "applied styles" and "custom styles"?

Tested in:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 29c2bba1f3ef216d226c97197185066880fc1ab5
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 2 Heiko Tietze 2023-01-05 11:16:29 UTC
The toolbar dropdown contains of a couple of predefined entries and what is used in the document. It serves the use case to set-up a new document with styles and to manage while editing; starting with a blank document you may need Title and Subtitle but never again.

The Stylist (the sidebar tab shown per "More Styles...") is the supposed control to deal with styles. Admittedly it's not ideal for those who use the Tabbed UI layout or have a very small display. But this control has a couple of filters including "Applied Styles". And the idea to solve your use case is to respect this filter setting on the static items of the dropdown.

Prolly a technical challenge since the two controls are completely unrelated. MIke, what do you think? Another concern comes from the fact that we pick one single item; makes not much sense to show List Styles, for example, in the Stylist and the toolbar drodpwon. Or does it?
Comment 3 Mike Kaganski 2023-01-05 12:15:57 UTC
The hardcoded list is defined in SvxStyleToolBoxControl::Impl::InitializeStyles. It is used in SvxStyleToolBoxControl::FillStyleBox.

I have no suggestions about what should be done to reuse the list of styles shown in the Stylist (or otherwise customize the filter).
Comment 4 Th3go 2023-01-05 20:25:36 UTC
Created attachment 184497 [details]
Further info on hidden HTML text remaining visible in paragraph styles drop down on toolbar

This bug report is about the ability to customise the user's style paragraphs box drop down list on the standard toolbar, by using the hide function for styles that aren’t needed. This is not working for some HTML styles that I have hidden using the Styles Sidebar.  Even though these styles are hidden they continue to appear at the top of the drop down lists. The result is styles that the user doesn't use taking up the top of the list and having to use the "more styles" to open up the styles sidebar/toolbar.

I am fully aware of the style filtering available on the styles bar. I have hidden all styles in a document except the default paragraph in order to have only my custom styles appear in the drop down paragraph style box list. Despite this the hidden HTML styles continue to appear at the top of the list but after a number of “custom styles” are used in a document, you do get a scroll bar eventually.Remove the styles from the document and the list shrinks again though.
Why do I want only custom/frequent styles only  in the Styles drop down box...  for my convenience, except some hidden styles are appearing.

I would add more screenshots to show what happens but it appears I am limited to one. I used green area infill to show the hidden files and how they are still on the list. Hope this clarifies somewhat.
Comment 5 Heiko Tietze 2023-01-06 08:23:00 UTC
I think it's a much better idea to not show those styles that are actively hidden by the user than abusing the filter.
Comment 6 Stéphane Guillou (stragu) 2023-01-06 10:01:26 UTC
(In reply to Th3go from comment #4)
> This bug report is about the ability to customise the user's style
> paragraphs box drop down list on the standard toolbar, by using the hide
> function for styles that aren’t needed.
(In reply to Heiko Tietze from comment #5)
> I think it's a much better idea to not show those styles that are actively
> hidden by the user than abusing the filter.

As in my comment 1, quite happy with that idea, which would fit nicely in workflows that edit a document in stages, starting with some one-off styles like headings, title, subtitle, then moving on to hiding those and focusing on others.

I do think that the option to hide a style should at the same time be added to the dropdown-in-dropdown, which is currently very light (just "Update to match selection" and "Edit").
Comment 7 Heiko Tietze 2023-01-10 09:49:59 UTC
Taking a deeper look the dropdown actually lists only applied styles - and you cannot hide those. But on top of the (potentially larger) list of own styles you always get the default list from the initialization containing "Standard","Text body","Title","Subtitle","Heading 1","Heading 2","Heading 3","Heading 4","Quotations","Preformatted Text". 

So I'd first of all make sure this is what bother you, Th3go.

Potential solution is to hide the init list if the document contains a number of styles, for example. Better solution is to hide styles if the list grows beyond a certain number ideally depending on the usage. And the first to disappear would be the initial list, if not used.
Comment 8 Heiko Tietze 2023-01-10 14:13:21 UTC
Patch at https://gerrit.libreoffice.org/c/core/+/145268
Comment 9 Commit Notification 2023-01-11 08:22:50 UTC
Heiko Tietze committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/95756934cf56e4a9ff58464bc0ed6881c15fe411

Resolves tdf#152666 - Hide default styles for large lists

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Heiko Tietze 2023-01-11 08:25:14 UTC
The list progressively drops the unused default styles now. Would be nice to better sort the items, to add separators between the default styles, if existent, and the last More Styles entry, and to hide parent styles (eg. Headings if just Heading 1 is used). But that's out of my capabilities.
Comment 11 Stéphane Guillou (stragu) 2023-01-12 11:06:45 UTC
Verified fix, the list updates as styles are applied, until the default list is all gone.
This is nearly equivalent to the idea of hiding specific styles from the dropdown as used styles can not be hidden.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 92deea6301a02f5530f17263f58402344f82013c
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Th3go, please do test too. If there is any follow-up needed in you opinion, probably better to open a new, specific bug and link to this one.

Thanks everyone!
Comment 13 Commit Notification 2023-01-23 13:28:37 UTC
Stéphane Guillou committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/1a892431e8d42b0488af3e9bffd4924cd3e06ad1

tdf#152666: explain how the paragraph style combobox is populated