Bug 153525

Summary: Styles Preview should be able to show a grid of list styles (Tabbed UI)
Product: LibreOffice Reporter: Rafael Lima <rafael.palma.lima>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: enhancement CC: heiko.tietze, krassowski.michal, martin.sourada, stephane.guillou, vsfoote
Priority: medium    
Version: 7.5.0.3 release   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=157580
https://bugs.documentfoundation.org/show_bug.cgi?id=154953
https://bugs.documentfoundation.org/show_bug.cgi?id=139429
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 107237, 107328    
Attachments: Styles Preview in Writer
Styles Preview in MS Word
Grid view of all styles (MS Word)
Annoying scrolling behaviour when fully expanded

Description Rafael Lima 2023-02-10 13:37:52 UTC
Created attachment 185289 [details]
Styles Preview in Writer

A Styles Preview widget was implemented in Writer's Tabbed UI to mimic the widget available in MS Word. This was a good idea, but the way it was implemented in Writer has a few limitations that I believe should be improved.

First, in Writer we only show 3 styles at a time which is too few considering the high number of styles that a document usually contains. If the user relies on this widget to explore/discover the existing styles in a document, they won't have a good experience. See first screenshot to see the current widget and notice that it could be wider and occupy more space horizontally (the empty space is highlighted in the screenshot).

In MS Word we can see 12 styles at a time and the Styles Preview extends to use all the horizontal space available in the ribbon (see second attached image).

The second issue is that we should provide a better way to show all available styles. In MS Word there is a down-arrow icon in the Styles Preview that shows a grid with all available styles. This is great for discoverability and I believe we should have this grid in Writer as well (see third image).

So in summary, what I propose is:
1) Implement the grid view of all styles
2) Allow the widget to automatically use the available horizontal space in its tab
Comment 1 Rafael Lima 2023-02-10 13:38:22 UTC
Created attachment 185290 [details]
Styles Preview in MS Word
Comment 2 Rafael Lima 2023-02-10 13:38:49 UTC
Created attachment 185291 [details]
Grid view of all styles (MS Word)
Comment 3 V Stuart Foote 2023-02-10 15:08:23 UTC
Not a fan. The Sidebar's Styles deck *already* provides treeview list of all styles -- with preview (default) or not.  

Expanding the 3 column w/scroll Styles widget on the Tabbed NB is not necessary. And the SB treeview already provides details a pop-out dialog might.

The MUFFIN NB framework is not the MS Ribbon, it does not function like Ribbon (or really even look much like it). Waste of time to try to do so. The 3 column 'Styles Preview' suffices and increasing column count comes at expense of other Home tab entries when UI is dragged narrower.

-1
Comment 4 Rafael Lima 2023-02-10 17:15:10 UTC
(In reply to V Stuart Foote from comment #3)
> Not a fan. The Sidebar's Styles deck *already* provides treeview list of all
> styles -- with preview (default) or not.  

> The MUFFIN NB framework is not the MS Ribbon, it does not function like
> Ribbon (or really even look much like it). Waste of time to try to do so.
> The 3 column 'Styles Preview' suffices and increasing column count comes at
> expense of other Home tab entries when UI is dragged narrower.

I respect your opinion, but if we follow this line of thinking, than the Styles Preview (from the Tabbed UI) should not have been implemented in the first place. The fact that we also have this functionality in the sidebar is not a reason to not improve the Styles Preview in the Tabbed UI.

My argument is that the current implementation is very limited and I honestly don't know what use case it serves for. The current Styles Preview is not good for discovering and applying styles, so this is why I resort to the sidebar to apply styles.

The Styles sidebar is really good and I believe we should also have a good implementation of the Styles Preview for Tabbed UI users. Since we already have this widget in the Tabbed UI, we should seek to improve it and offer a complete experience. Otherwise I can hardly see myself using it.
Comment 5 V Stuart Foote 2023-02-10 18:13:42 UTC
(In reply to Rafael Lima from comment #4)
> I respect your opinion, but if we follow this line of thinking, than the
> Styles Preview (from the Tabbed UI) should not have been implemented in the
> first place. 

I've said as much ;-)

> The fact that we also have this functionality in the sidebar is
> not a reason to not improve the Styles Preview in the Tabbed UI.
> 

Maybe. Or, we could just dump the NB Tabbed UI... it is not and never can be fully functional--so we just disappoint MS Office users.

> My argument is that the current implementation is very limited and I
> honestly don't know what use case it serves for. The current Styles Preview
> is not good for discovering and applying styles, so this is why I resort to
> the sidebar to apply styles.
> 

> The Styles sidebar is really good and I believe we should also have a good
> implementation of the Styles Preview for Tabbed UI users. 

Guess we could simply provide a "more..." and just open the Stylist (i.e. <F11> pop open the SB deck).

> Since we already have this widget in the Tabbed UI, we should seek to improve > it and offer a complete experience. 

Why?  The 3 column grid and scrollbar exposes the previews. Otherwise <F11> launches the full treeview listing in the SB Styles deck.
Comment 6 Heiko Tietze 2023-02-13 11:37:22 UTC
OTOH, I agree with Rafael- the Tabbed UI should be familiar for users migrating from Windows/MSO and is supposed to work without sidebar. But besides the visualization defects it has also functional limitations in that you cannot create new styles. Stuart's "More..." is a possible solution - and ditching the whole Tabbed UI too.
Comment 7 Rafael Lima 2023-02-13 12:30:08 UTC
(In reply to Heiko Tietze from comment #6)
> ditching the whole Tabbed UI too

FTR I don't think that "ditching Tabbed UI" should be an option. This would be too extreme and goes against what many users want.

The current implementation of the Tabbed UI is good (not excellent), and we should seek to overcome its limitations, as discussed in bug 135501.

As per this request, it's not only about minimizing the transition from MSO, but also about giving this widget more functionality. We don't need to "copy" exactly the Styles Preview from MS, but being able to show more styles and make them more discoverable would be great for users.

Looking at the existing code, I believe this enhancement is technically possible, but would take a good amount of development time.
Comment 8 Pedro 2023-02-15 08:53:29 UTC Comment hidden (off-topic)
Comment 9 John Mills 2023-02-15 09:42:10 UTC
(In reply to Rafael Lima from comment #1)
> Created attachment 185290 [details]
> Styles Preview in MS Word

Yes, a great idea, I think this will be a big improvement for those that use the tabbed UI. Due to the tabbed UI not using the sidebar this is a good approach and it appears there is space for this.
Comment 10 V Stuart Foote 2023-02-15 16:24:17 UTC
(In reply to Rafael Lima from comment #7)

@Rafael,

Fair enough, and I realize this MUFFIN NB construct is released and so deserves additional dev effort. My "ditch it" was sarcasm. 

And by the way thank you Rafael for all your contributions over the years! 

Stuart

"Doers decide..."
Comment 11 John Mills 2023-02-15 17:09:19 UTC Comment hidden (off-topic)
Comment 12 Heiko Tietze 2023-02-16 07:51:16 UTC
We discussed this in the design meeting.

Improvements to the styles preview widget in the notebookbar is needed. The idea to have a More... option, could also be some kind of expander at the right bottom, might simplify the implementation but does not meet the user expectations.

The proposed maximize function sounds like a low hanging fruit. The expand thing could be more challenging. Maybe split these topics into separate tickets.
Comment 13 krassowski.michal 2023-04-19 10:04:52 UTC
As a user I find the current UX difficult to use. Changing multiple styles from "default" or "text body" to "Heading 3" or "Heading 4" is very challenging - each time I click on the line which I want to denote as a heading 
the style preview selects "default" style which scrolls it back to the top so and I need to scroll down again; this is really distressing for some reason. I would really appreciate a change to make the styles preview box expand to full width available.

If you are discussing a larger redesign, I also miss ability to customise styles as these appear to be hard-coded; for example, I would like to add "Heading 5".

For now I am applying a manual workaround by modifying `svx/ui/stylespreview.ui` file (for me on Linux it is in `/usr/lib/libreoffice/share/config/soffice.cfg/svx/ui/stylespreview.ui`) as follows:

1. In `<object class="GtkScrolledWindow">`, increasing the requested width, for me it is 1200: `<property name="width_request">1200</property>`
2. Replacing hard-coded `3` columns with `-1` to fit as many columns as possible in `<object class="GtkIconView" id="stylesview">`: `<property name="columns">-1</property>`

I experimented with setting expand/fill/hexpand (to replace hard-coded `width_request`) and I think that none of these work because the size is set in code by `StylesPreviewWindow_Impl::SetOptimalSize` method implemented as `SetSizePixel(get_preferred_size());`).
Comment 14 krassowski.michal 2023-04-19 10:15:14 UTC Comment hidden (off-topic)
Comment 15 krassowski.michal 2023-04-19 10:18:00 UTC
Apologies, part of the scrolling behaviour issue appears to be already tracked in https://bugs.documentfoundation.org/show_bug.cgi?id=141335.
Comment 16 Stéphane Guillou (stragu) 2024-05-30 00:47:04 UTC
Some relevant other reports:

* other ideas related to efficient use of space in the Tabbed UI:
   - bug 157580: visibility of elements based on space available, not just order
   - bug 154953: allow "sliding" the tab contents horizontally

* general Styles widget improvements in bug 139429, in which I shared relevant screenshots comparing alternative office suites' behaviour with their Styles widget:
   - default look in attachment 194234 [details]
   - "expanded" look in attachment 194235 [details]

Description of the attachments:
- Top: MS 365. Shows a maximum of 3 styles, which can reduce depending on window size. Down arrow shows more styles in a dropdown list.
- Middle: OnlyOffice 8.0.1.31. Number of styles adapts to window size, from 1 to  more than 10. Down arrow expands to a multi-row grid that accommodates all styles.
- Bottom: WPS 11.1.0.11719. Minimum of 3 styles, but can drag divider to show more. Like OnlyOffice, down arrow expands to a multi-row grid that accommodates all styles.