Bug 151707 - Add style filters: Applied on this page, applied in this viewport
Summary: Add style filters: Applied on this page, applied in this viewport
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.1.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Sidebar-Styles DoAsMacro
  Show dependency treegraph
 
Reported: 2022-10-22 21:20 UTC by Eyal Rozenberg
Modified: 2023-11-10 10:29 UTC (History)
4 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 Eyal Rozenberg 2022-10-22 21:20:34 UTC
The bottom of the Styles sidebar has a drop-down list of applicable filters (or display modifiers) to the listbox of styles. Items currently include:

* All Styles
* Hierarchical
* Hidden Styles
* Applied Styles
* Custom Styles

I would like to be able to a refinement of "Applied Styles":

1. The styles applied anywhere on the current page
2. The styles applied anywhere visible in the viewport (typically a sub-area of a single page but sometimes parts of multiple pages)

this would be in addition to "Applied styles", which are the styles applied anywhere in the document.
Comment 1 Heiko Tietze 2022-11-04 09:43:58 UTC
The actual use case is probably to see what styles are used, requested in bug 38194 (and regarding direct formatting bug 106556). For other improvements to the style filter see https://design.blog.documentfoundation.org/2019/11/05/proposal-to-conveniently-highlight-and-inspect-styles-in-libreoffice-writer/

*** This bug has been marked as a duplicate of bug 38194 ***
Comment 2 Eyal Rozenberg 2022-11-04 11:24:09 UTC
(In reply to Heiko Tietze from comment #1)
> The actual use case is probably to see what styles are used

Actually, no it isn't; or rather - no more than having "Styles in use" as a filter.

The use case is when you want to choose styles to apply - from within the used styles. Except that in a large document, many dozens of styles may be applied, so "Styles in use" is not enough of a filter.

Now, someone might say that if 38194 is implemented, this feature may not be useful enough; but that's different from marking this bug as a dupe. Plus, 38194 is a "big deal" feature, UI wise, this is just another item in an existing list.
Comment 3 Heiko Tietze 2022-11-04 11:46:46 UTC
I don't buy the viewport use case and such a filter sounds like over-engineering to me.
Comment 4 Dieter 2023-11-05 16:40:33 UTC
(In reply to Heiko Tietze from comment #3)
> I don't buy the viewport use case and such a filter sounds like
> over-engineering to me.

+1

Eyal, bug 38194 is fixed. So what do you think now?
=> NEEDINFO
Comment 5 Eyal Rozenberg 2023-11-05 18:15:50 UTC
(In reply to Heiko Tietze from comment #3)
> I don't buy the viewport use case

A user is obviously interested in information and actions relating to what they currently see. And what they currently see is the contents of the viewport. 

Please explain why you believe the user would not care to know which styles are in use in the viewport. You can't just "not buy it".

(In reply to Dieter from comment #4)
> (In reply to Heiko Tietze from comment #3)
> > I don't buy the viewport use case and such a filter sounds like
> > over-engineering to me.
> 
> +1

> Eyal, bug 38194 is fixed. So what do you think now?

Oh, I think that actually strengthens the viewport use case even more! Have a look at the mockup:

https://bug-attachments.documentfoundation.org/attachment.cgi?id=154693

We see several indicator colors in the margin of the visible text. But not all styles in the sidebar one any of these colors; and they would still not all have one of these colors if I filtered by "Applied styles". But if I filtered by "Applied in viewport"  - I would see one color in the viewport margin for every one style in the sidebar, and vice-versa.
Comment 6 Heiko Tietze 2023-11-06 07:40:47 UTC
(In reply to Eyal Rozenberg from comment #5)
> A user is obviously interested in information and actions relating to what
> they currently see.
The task of styles is to maintain a consistent layout. Meaning to pick a style that is used at any other position. The viewport is out of any interest in this workflow.
Comment 7 Stéphane Guillou (stragu) 2023-11-10 09:53:34 UTC
I agree with Heiko and Dieter that it would be over-engineering, and I also think we should avoid extremely "jumpy" UI that could be problematic or confusing for many users. Imagine scrolling through a document rapidly, how often the listing would have to be updated.

I thought of an alternative like "Style in selection" to only show whatever is used in the currently selected text, but that doesn't really make sense as it would go against the use of the Style sidebar: applying a style to the selection.

I think your usecase is now mostly covered by using Spotlight + Applied styles.
For your idea, I'd recommend having that as an extension instead.
(But as usual, if someone wants to submit a patch for review, they can go for it.)
Comment 8 Eyal Rozenberg 2023-11-10 10:29:56 UTC
(In reply to Stéphane Guillou (stragu) from comment #7)
> I also think we should avoid extremely "jumpy" UI that could be problematic
> or confusing for many users.

How would it be confusing, when users never see this kind of filtering without explicitly choosing it?

> Imagine scrolling through a document rapidly, 
> how often the listing would have to be updated.

Well, two options:

1. No update of the style list until you stop scrolling for a moment.
2. Update every X seconds (or deci-seconds?) while you are scrolling

and it would be what the user expects.

> I thought of an alternative like "Style in selection" to only show whatever
> is used in the currently selected text, but that doesn't really make sense
> as it would go against the use of the Style sidebar: applying a style to the
> selection.

You could make the same argument about "Styles in Use": You can't use that to apply a currently-unused style.

Same thing for only showing the styles of the current page, viewport or selection: You can't use that filtered list to apply a different style. But you _can_ use it to apply one of the styles used to the whole page, viewport or selection.

> I think your usecase is now mostly covered by using Spotlight + Applied
> styles.

No, it is not, because once you have many styles in the document - at any given time, most styles are not visible in the list, so you don't know how to interpret the spotlight. And if you scroll to one style, you again can't see the styles that are not close to it on the list.