Bug 165756 - The spotlight view does not display colored and numbered boxes beside the names of the styles (GTK3)
Summary: The spotlight view does not display colored and numbered boxes beside the nam...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.2.0.0 alpha0+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.8.0
Keywords: regression
Depends on:
Blocks: GTK3
  Show dependency treegraph
 
Reported: 2025-03-15 15:07 UTC by opp
Modified: 2025-03-23 00:50 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Spotlight view along with the writer guide in the "Using the Styles Spotlight" chapter as it should appear (388.40 KB, image/png)
2025-03-15 15:07 UTC, opp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description opp 2025-03-15 15:07:31 UTC
Created attachment 199822 [details]
Spotlight view along with the writer guide in the "Using the Styles Spotlight" chapter as it should appear

Description:
The spotlight view does not display colored and numbered boxes beside the names of the styles


Steps to reproduce:
1. Have Libreoffice on Linux
2. Create a new Writer file
3. Go to the Styles tab in the Sidebar
4. Write some text and apply the "Heading 1" style
5. Write some text and apply the "Heading 2" style
6. Select the Spotlight option at the bottom of the Paragraph Styles


Actual Results:
Spotlight only displays the colored and numbered boxes in the margins of paragraphs, but not in the Styles tab in the Sidebar


Expected Results:
Have colored and numbered boxes beside the names of the styles


Reproducible: Always


Additional Info:
I only see this bug on Linux, as on windows it works as intended. I also started the safe mode of libreoffice and the issue is still there.
This issue affects 2 of my ubuntu 24.04 PCs.
I include my spotlight view along with the writer guide in the "Using the Styles Spotlight" chapter as it should appear.

The issue is not present in 
Version: 24.8.5.2 (X86_64) / LibreOffice Community
Build ID: 27b361b745d0ea8f99bc93dfcb7a39098dfa5fff
CPU threads: 4; OS: Linux 6.11; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
installed through snap

But the issue is present when installed 25.2 through flatpak and 25.8 (master branch) from .deb files



[Information automatically included from LibreOffice]
Version: 25.2.1.2 (X86_64) / LibreOffice Community
Build ID: d3abf4aee5fd705e4a92bba33a32f40bc4e56f49
CPU threads: 8; OS: Linux 6.11; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Flatpak
Calc: threaded

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 477138a0570589e8dcecdbfe104a055f432638ce
CPU threads: 8; OS: Linux 6.11; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: CL threaded
Comment 1 Buovjaga 2025-03-15 15:36:53 UTC
Bibisected with linux-64-25.2 to e3d7473a5611f414bfcf1a3e812248c82f9e9b83
Add extended tips to styles sidebar

Let's see, if I can fix this.
Comment 2 Buovjaga 2025-03-15 17:50:18 UTC
(In reply to Buovjaga from comment #1)
> Bibisected with linux-64-25.2 to e3d7473a5611f414bfcf1a3e812248c82f9e9b83
> Add extended tips to styles sidebar
> 
> Let's see, if I can fix this.

I don't get it. I reverted the changes, but the issue persists. I did double-check the bibisect result, also in Safe Mode.
Comment 3 Buovjaga 2025-03-16 16:29:40 UTC
I did some debugging with a working UI, kf6, but was unable to figure out what I should be looking at.

I started by locating the most interesting file, sfx2/source/dialog/StyleList.cxx in commit 4bc86f6477c3ed5f0e97b0a530acf7e102b613b3 which originally added the feature.

When we activate Spotlight in the Styles deck, `ControllerItem::StateChangedAtToolBoxControl()` is triggered in https://opengrok.libreoffice.org/xref/core/sfx2/source/sidebar/ControllerItem.cxx?r=6f441eba260db39df386c46c5ee7492e79e25c8c#63

This leads to `SfxTemplatePanelControl::NotifyItemUpdate()` and its `case SID_SPOTLIGHT_PARASTYLES` in https://opengrok.libreoffice.org/xref/core/sfx2/source/dialog/templdlg.cxx?r=6f441eba260db39df386c46c5ee7492e79e25c8c#171

`lcl_Update()` has a section "draw the color rectangle and number image" in https://opengrok.libreoffice.org/xref/core/sfx2/source/dialog/StyleList.cxx?r=6f441eba260db39df386c46c5ee7492e79e25c8c#745

I could not find the exact place where the boxes appear.

Jim: do you have an idea on how to zero in on the issue here?
Comment 4 Jim Raykowski 2025-03-17 07:10:26 UTC
(In reply to Buovjaga from comment #2)
> (In reply to Buovjaga from comment #1)
> > Bibisected with linux-64-25.2 to e3d7473a5611f414bfcf1a3e812248c82f9e9b83
> > Add extended tips to styles sidebar
> > 
> > Let's see, if I can fix this.
> 
> I don't get it. I reverted the changes, but the issue persists. I did
> double-check the bibisect result, also in Safe Mode.

I bibisected to the same commit and reverted it in master and got the same "I don't get it" reaction. So I git checked out the commit and did the revert from that point and spotlight worked as expected for gtk3. I'm currently in the process of a manual bibisect to try to find which commit after e3d7473a5611f414bfcf1a3e812248c82f9e9b83 causes the revert not to work.
Comment 5 Jim Raykowski 2025-03-21 21:44:51 UTC
Whew! that was a challenge. In addition to the dropped surface attributes in commit e3d7473a5611f414bfcf1a3e812248c82f9e9b83 - extended tips to styles sidebar, commit 7f42f031ed1b9f374f3fcba9c814dc5862492026 - tdf#100894 speed up style tree creation, also causes the spotlight color/number box not to appear for Gtk3.

Link to proposed patch to fix:
https://gerrit.libreoffice.org/c/core/+/183213
Comment 6 Commit Notification 2025-03-22 07:40:40 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/186a2738396e938cc898166b95a02c70a5e22a30

Resolves: tdf#165756 - The spotlight view does not display colored and

It will be available in 25.8.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.