Bug 163646 - Tooltip for Headings in Navigator should show a correct word/characters amount if there is nested outline
Summary: Tooltip for Headings in Navigator should show a correct word/characters amoun...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.2.0.0 alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:25.8.0
Keywords:
Depends on:
Blocks: Navigator Tooltip
  Show dependency treegraph
 
Reported: 2024-10-27 15:51 UTC by Roman Kuznetsov
Modified: 2025-03-06 05:09 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example doc for description understanding (15.49 KB, application/vnd.oasis.opendocument.text)
2024-10-27 15:52 UTC, Roman Kuznetsov
Details
demo of collapsed heading word/character count (472.96 KB, video/x-matroska)
2024-11-02 04:05 UTC, Jim Raykowski
Details
headings word/character count that always includes sub headings (472.89 KB, video/x-matroska)
2024-11-02 18:57 UTC, Jim Raykowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Kuznetsov 2024-10-27 15:51:27 UTC
Description:
Tooltip for Headings in Navigator should show a correct word/characters amount if there is nested outline.
Look at the example short doc in the attach:
Tooltip for Chapter 1 shows - 42 words and 233 characters
Tooltip for nested Chapter 1.1 shows - 17 words and 101 characters 
Tooltip for nested Chapter 1.2 shows - 22 words and 131 characters 

So, if we add up all the words and symbols for chapter 1 then the tooltip should shows 81 words and 465 characters for Chapter 1. And it's correct because these numbers we can see in status bar if just select all text in the document.

Steps to Reproduce:
-

Actual Results:
Tooltip doesn't add to result words and characters amount from nested outline and shows a non correct result

Expected Results:
Tooltip adds to result words and characters amount from nested outline and shows a correct result


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 0a004f1a1528b8a85245de4672852b574bdc2cb2
CPU threads: 16; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL threaded
Comment 1 Roman Kuznetsov 2024-10-27 15:52:11 UTC
Created attachment 197261 [details]
Example doc for description understanding
Comment 2 Heiko Tietze 2024-10-28 07:58:37 UTC
I have concerns to show different tooltips depending on whether the node is open or not. We probably do "wrong" either way.
Comment 3 Roman Kuznetsov 2024-10-28 15:08:07 UTC
(In reply to Heiko Tietze from comment #2)
> I have concerns to show different tooltips depending on whether the node is
> open or not. We probably do "wrong" either way.

I don't think we should show different amounts depended open/closed node in the list >_< It should be only one correct number
Comment 4 Heiko Tietze 2024-10-28 15:22:19 UTC
(In reply to Roman Kuznetsov from comment #3)
> I don't think we should show different amounts depended open/closed node...
But if Chapter 1 is collapsed you want to see 1.1 and 1.2 added, and if expanded I guess you accept the current situation.
Comment 5 Jim Raykowski 2024-11-02 04:05:51 UTC
Created attachment 197350 [details]
demo of collapsed heading word/character count

If it is decided this behavior is wanted, here is a patch that does this:
https://gerrit.libreoffice.org/c/core/+/175895
Comment 6 Roman Kuznetsov 2024-11-02 06:07:45 UTC
(In reply to Jim Raykowski from comment #5)
> Created attachment 197350 [details]
> demo of collapsed heading word/character count
> 
> If it is decided this behavior is wanted, here is a patch that does this:
> https://gerrit.libreoffice.org/c/core/+/175895

Jim, hi. No My idea was to have in the tooltip always the same info about all words/characters amount for some level/chapter/sub-chapter unrelated to collapsed outline or not.
Comment 7 Jim Raykowski 2024-11-02 18:57:58 UTC
Created attachment 197356 [details]
headings word/character count that always includes sub headings

@Roman, Is what is shown in the attached video what you propose?

Can't say that I see this as an improvement to the current behavior.

Perhaps I am misunderstanding something again?
Comment 8 Roman Kuznetsov 2024-11-03 17:40:46 UTC
(In reply to Jim Raykowski from comment #7)
> Created attachment 197356 [details]
> headings word/character count that always includes sub headings
> 
> @Roman, Is what is shown in the attached video what you propose?
> 
> Can't say that I see this as an improvement to the current behavior.
> 
> Perhaps I am misunderstanding something again?

Yes, but 1.2 item should insert the word/chr. amount from 1.2.1 item too.
Current movie shows 1 item include all words/chrs from all document, but 1.2 item shows a wrong info for me. 

It should be like this (I used numbers from your movie):

1 - 847/5874 (includes all text from 1.1, 1.2 and 1.2.1)
    1.1 - 236/1628 (includes all text from only 1.1)
    1.2 - 611/4250 (includes all text from 1.2 and 1.2.1)
        1.2.1 - 236/1630 (includes all text from only 1.2.1)

and these numbers shouldn't be changed when you collapse or open nested outline levels.
Comment 9 Jim Raykowski 2024-11-03 22:34:04 UTC
(In reply to Roman Kuznetsov from comment #8)
> Yes, but 1.2 item should insert the word/chr. amount from 1.2.1 item too.
> Current movie shows 1 item include all words/chrs from all document, but 1.2
> item shows a wrong info for me.
> 
> It should be like this (I used numbers from your movie):
> 
> 1 - 847/5874 (includes all text from 1.1, 1.2 and 1.2.1)
>     1.1 - 236/1628 (includes all text from only 1.1)
>     1.2 - 611/4250 (includes all text from 1.2 and 1.2.1)
>         1.2.1 - 236/1630 (includes all text from only 1.2.1)
I think what is shown in the second demo is what you propose.

375 words for 1.2 is the total number of words from the start of heading 1.2 to the end of content of heading 1.2.1. The number of words in the 1.2 outline content is 139 and the number of words in the 1.2.1 outline content is 236. This is why a count of 375 words is shown for heading 1.2

The current tool tip show these counts for the number of words in each heading:

1 - 236
1.1 - 236
1.2 - 139
1.2.1 - 236

Possibly having both the heading outline count and the total count including subs headings when there are subs would be of use, something like:

Heading 1
Words: 236/847
Characters: (Heading 1 character count)/(Heading 1 + sub headings character count)

Heading 1.1
Words: 236
Characters: 1628

Heading 1.2
Words: 139/375
Characters: (Heading 1.2 character count)/(Heading 1.2 + sub headings character count)

Heading 1.2.1
Words: 236
Characters: 1630
Comment 10 Heiko Tietze 2024-11-07 07:29:48 UTC
We discussed the topic in the design meeting.

The change as requested is welcome, meaning the word count for a chapter should include the subchapters too. Ideally we highlight the area. And we may consider an option to not include subchapter in counting.
Comment 11 Commit Notification 2025-03-06 05:09:31 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/90fdf50aa5dac4520893a98e52feb8d1ae8d9d7a

tdf#163646 Writer Navigator enhancement to show in the tooltip for

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.