2022-04-24_Quirks in the focusing property of the Navigator
This example file shows several bugs. It was written as an example to #148755. But I also recorded all other surprising things in order to report them on separate bug reports. Don’t mind if they appear here, it is just just to catch some of them in order to report them.
This report was written with
Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: f775b625b497b4fa6731bddd433916dde52fbb2e
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: en-US
Calc: threaded
but I have seen some of these glitches also in other versions of LO Writer!

Original Post #148755

Preceding events

New findings
Sometimes I use tables because they make the location of inserted images more predictable than if I insert them into the text (e.g. anchored to paragraphs). If - as e.g. often in user manuals - many short text passages and corresponding illustrations follow one after another, it may even make sense to place headings in tables as well. If you do this, however, you lose the nice feature of the navigator that you can continuously see how a text is positioned in the hierarchy of associated headings: The navigator suddenly shows the position in the hierarchy of tables (or sections, if the text passage is in a section).

Expected behavior:
I expect the navigator to always show the location of the bookmark in the editing window with respect to the category selected in the navigator's drop-down list of categories at the top left (really useful there are headings, tables, maybe sections. For hyperlinks, I can only imagine that it might make sense to highlight the next hyperlink before the position of the bookmark in the editing window).

An example
In order to demonstrate the to be shown behavior, I add some headlines such that navigator really has some structure to show. Then I also add the original post, but this time arranged in a table:

Original Post #148755 in a table

Preceding events in a table
End of June 2021 I first observed that the Navigator adjusts itself to the proper headline associated to the current editing position. The item belonging to the edit position in the Edit window gets highlighted. That's something which has long been missing and which is very useful.

New findings in a table
Now I found something inconsistent with that: If the edit position in the edit window is in a table, the highlight moves to the relevant entry in the Tables category, if it is in a section, the highlight jumps to the proper entry in the Sections category.
When writing a larger document, the main hierarchy of things is by headline order. Being able to associate some place in the document to the surrounding headlines hierarchy is the main concern. Only in very special cases one might want to locate an image in the list of all images or a table in the list of all tables and so on.
Locating something in another category than the one highlighted (Headings/Images/Sections/Table, ..., topmost drop-down setting of Navigator) is not meaningful, especially jumping to sections instead of headlines is bizarre.
Sometimes I use tables because they make the location of inserted images more predictable than if I insert them into the text (e.g. anchored to paragraphs). If - as e.g. often in user manuals - many short text passages and corresponding illustrations follow one after another, it may even make sense to place headings in tables as well. If you do this, however, you lose the nice feature of the navigator that you can continuously see how a text is positioned in the hierarchy of associated headings: The navigator suddenly shows the position in the hierarchy of tables (or sections, if the text passage is in a section).

Expected behavior in a table:
I expect the navigator to always show the location of the bookmark in the editing window with respect to the category selected in the navigator's drop-down list of categories at the top left (really useful there are headings, tables, maybe sections. For hyperlinks, I can only imagine that it might make sense to highlight the next hyperlink before the position of the bookmark in the editing window).

Some screenshots demonstrating what goes wrong

What goes right Before I’ll show what goes wrong, I’ll precede my examples with one showing that Navigator’s reflection of edit places goes right, as long as one navigates in text which is not part of a table (or a section, which we will encounter soon): I go some lines up, add the word HERE to some place and make a screenshot:
The highlighted word HERE is in the paragraph with headline “An example“: the right paragraph is highlighted in the Navigator. That’s really helpful. In order to show that this is not just an accidental result, I’ll remove the highlighted word and transplant it to some other paragraph:
Again the highlighted portion in the Navigator shows the position in the edit window. Now I’ll test it with yet another place.

But this one will go wrong:

1. Expected result This time, the highlight is in section c0! This is really surprising! I have not created any section c0 active at all. Even when LO Writer created one for internal organizational reasons: my text is under the heading “New findings”!

Continued examples In order to avoid any difficulty of pasted screenshots appearing on arbitrary places (another bug, but not the issue of this error report, I place all my text and screenshots to just another table: In the next picture, you see the navigator when the focus in the text field is HERE
As you see, Table2 under Tables is highlighted. You might argue, ok, the focus is really in Table2, just go to Headings in Navigator. I’ll do that now:
but as soon as I continue writing in the text area, Table2 is highlighted again!

2. Expected behavior If the focus in Navigator is on Headings, it should not jump to tables when I continue to edit text which is in a table.

Now I create a section
To make it appear differently, I make it a two column one. Right now, the focus in the editing window is HERE, but although “H Headings” is selected in the upper left corner of Navigator, the highlight jumps down to section 2! (Btw: when I tried to paste the screenshot below this text, it went to a completely different page, which is yet another bug in LO Writer, which is not subject of this bug report, but I keep note of it to report it in another bug report soon). In order to paste my picture where I want it to appear, I rearranged my text into a table and pasted the picture to a cell below. Strangely, this picture goes to the next page in this section!)

3. Expected Behavior 1. Since “H Headings” is highlighted, I would expect this one highlighted:
However, whatever I do, as soon as I continue editing, Table3 is highlighted again in the editor window.
2. I would have expected the column to continue on the last page (which again is another quirk which I’ll report in another bug report).
3. When editing this part, LibreOffice Writer started flickering (a phenomemon which I also observed earlier but for which I was missing reproducible examples – and of course, this bug is not subject of this report, but I note it in order to use this file for a demonstration.