Bug 123514 - Allow Navigator's alphabetical ordering of bookmarks in Target in Document dialog as well
Summary: Allow Navigator's alphabetical ordering of bookmarks in Target in Document di...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Navigator Bookmarks
  Show dependency treegraph
 
Reported: 2019-02-17 10:15 UTC by Adalbert Hanßen
Modified: 2023-06-30 22:43 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot (45.85 KB, image/png)
2019-02-19 09:55 UTC, Heiko Tietze
Details
Dialog to add a hyperlink to a bookmark with many entries (showing only a few of them) (22.98 KB, image/png)
2019-02-19 11:48 UTC, Adalbert Hanßen
Details
Creating a bookmark-dialogue, sorted by page No (53.19 KB, image/png)
2019-02-19 12:43 UTC, Adalbert Hanßen
Details
Creating a bookmark-dialogue, sorted by bookmark name (52.75 KB, image/png)
2019-02-19 12:49 UTC, Adalbert Hanßen
Details
Screenshots with current developkment version where Insert Bookmark does NOT allow to sort, in Reply to comment #12 of bug 123514 (Screenshots) (326.08 KB, application/vnd.oasis.opendocument.text)
2019-06-17 11:58 UTC, Adalbert Hanßen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adalbert Hanßen 2019-02-17 10:15:40 UTC
Description:
I have an document which already has many bookmarks in it. When I want to set a hyperlink to a bookmark in my document, LO Writer shows me the very long list of existing bookmarks - but they are not in any logical order. That's very awkward and it could be improved.

If possible, the bookmark which has been defined or which has been last used should be highlighted and the display of bookmarks should be centred around it (similar to the dialog version when selecting a hyperlink to a headline: In this version, the highlight is there, but centring is missing - just another improvement!). 

The existing bookmarks should be shown as in the dialog to create an additional one. One should be able to sort them alphabetically by bookmark name or by page number or by text. 

In addition, it would be even better if one could search in the lists by keyword like in the search function in the normal edit mode!

Adding a search function would also be benefical for the dialog to set a hyperlink to a headline!

Steps to Reproduce:
1. create a document with heavy usage of hyperlinks in it
2. add a new bookmark
3. try to set a hyperlink to this bookmark: identifying in the list of existing bookmarks becomes very awkward if the list is much larger than what can be shown in the dialogue.

Actual Results:
The list of bookmarks is in an order, which I don't understand. It is not arbitrary however. Perhaps it is the order in which the bookmarks were created.

Expected Results:
display of existing bookmarks which can be sorted and possibly a search function within that dialog


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Heiko Tietze 2019-02-18 10:53:50 UTC
The bookmark dialog allows to sort the items for page, name, and text (though the Navigator sorts by name only). Isn't that enough?
Comment 2 Adalbert Hanßen 2019-02-18 11:56:10 UTC
No, that is not enough. 

Of course the bookmark dialogue, which comes up when creating a bookmark, already has the capability to sort them alphabetically by bookmark name or by page number or by text. However when yo want to use a bookmark in the hyperlink-dialogue, you have to identify the one which you mean in a possibly very long list (if you do it in a document which already has many bookmarks).

Probably it will be quits easy (for someone knowing the code) to modify this dialogue (possibly change the headline of it) also to select a bookmark, possibly adding the property to have the last used bookmark preselected and display it centred if the list becomes longer than one dialogue-window hight.
Comment 3 Heiko Tietze 2019-02-19 09:55:59 UTC
Created attachment 149412 [details]
Screenshot

So what you mean is Insert > Hyperlink: Document > Target in Document. After clicking the right hand button you get a Navigator like treeview where you select the wanted bookmark- and this is cumbersome. Right?
Comment 4 Adalbert Hanßen 2019-02-19 11:48:50 UTC
Created attachment 149413 [details]
Dialog to add a hyperlink to a bookmark with many entries (showing only a few of them)

Heiko Tietze's screenshot shows a very simple and transparent situation with only a few bookmarks. However I encounter cases like this one: The bookmarks in the window only cover about 1/4 of those which are in the document. They are arranged in an order, which makes searching for a particular one very awkward. They often happen to be in a highly non-alphabetical order, the partially-ordered portions concerning "note-xx" happen to be there accidentally. I can even produce worse cases than this one.

If the bookmarks were ordered alphabetically, that would already make life much easier. However, when cross-linking a document with bookmarks, it often comes that you want more than one hyperlink pointing to the same bookmark. Therefore my advice, to memorize the last selected bookmark and open the selection-window centred around it (and alphabetically ordered or by page number, if this ordering also can be harvested from reusing the already existing dialogue from define bookmark.
Comment 5 Adalbert Hanßen 2019-02-19 12:43:32 UTC
Created attachment 149414 [details]
Creating a bookmark-dialogue, sorted by page No

This is what the dialogue is set up, which is used when defining a bookmark. By clicking on the headline of the list organized in four columns (until now I have not seen an example with an entry in the fourth column however), you can sort the window. My screenshot shows it sorted by page number. 

Unfortunately the current selection (if any) is not centred, so it might get out off view here. 

For sorting by page number however, it seems to be best to centre the displayed window with respect to the current page and highlight the one bookmark from it (if there is one, otherwise take the next occurring bookmark below it).
Comment 6 Adalbert Hanßen 2019-02-19 12:49:53 UTC
Created attachment 149415 [details]
Creating a bookmark-dialogue, sorted by bookmark name

This is what the dialogue is set up, which is used when defining a bookmark. By clicking on the headline of the list organized in four columns, you can sort the window. This screenshot shows it sorted by bookmark name. 

When creating a hyperlink, i.e. when using a bookmark, the dialogue should look similar, possibly with an additional choice of a search field.
Comment 7 Heiko Tietze 2019-02-20 08:07:30 UTC
The dialog is likely generated by the same code as the Navigator, which is said to be a huge spaghetti monster. The proposed solution in the duplicate bug 86395 is probably not so easy to implement but sorting by default could be possible.
Comment 8 Cor Nouws 2019-06-12 08:51:44 UTC
I agree with Adalbert that it's not easy to use that part of the UI to insert references to bookmarks in a hyperlink.
However, if you know which bookmark you need, just type the name in the field Target, Enter and you're done. that's easy and fast.

Doesn't that work for you?

(A problem is that the type Internet/Mail/Document ..) cannot be chosen by key board :\ (bug to be filed) and that the choice isn't remembered (bug 90496) )
Comment 9 Cor Nouws 2019-06-12 09:00:27 UTC
(In reply to Cor Nouws from comment #8)
> (A problem is that the type Internet/Mail/Document ..) cannot be chosen by
> key board :\ (bug to be filed)
  > see bug 125875
Comment 10 Heiko Tietze 2019-06-13 08:14:46 UTC
Read again through the discussion. There is bug 86395 asking for alphabetically and by order sorting capabilities, which might solve most of your problems (I make this ticket a duplicate). If you think there needs to be more sorting options please add the use case on the other ticket (eg. Due to <> I do have a gazillion hidden bookmarks that needs to excluded in order to work efficiently).

Thanks for filing tickets and for being patient in the discussion ;-).

*** This bug has been marked as a duplicate of bug 86395 ***
Comment 11 Adalbert Hanßen 2019-06-16 20:19:32 UTC
(In reply to Cor Nouws from comment #8)
> I agree with Adalbert that it's not easy to use that part of the UI to
> insert references to bookmarks in a hyperlink.
> However, if you know which bookmark you need, just type the name in the
> field Target, Enter and you're done. that's easy and fast.
> 
> Doesn't that work for you?
> 
> (A problem is that the type Internet/Mail/Document ..) cannot be chosen by
> key board :\ (bug to be filed) and that the choice isn't remembered (bug
> 90496) )

Cor, thank you for the hint to enter the bookmark's name. On the next occasion I'll try that in my daily life. 

From the existing test sample I have derived a similar one by duplicating its main content several times, see http://bugs.documentfoundation.org/attachment.cgi?id=152233. I did not know that the bookmarks are also copied, but their names are varied automatically. As a byproduct of my experiments I found a way to go to a specific using a selection list in the order in which they appear in the document: The dialogue in Insert>Bookmark shows the existing bookmarks sorted by pages and one can misuse this one to go to one of them by double clicking on it (probably this would be a more obvious use case for the navigator and perhaps the original poster was looking for that). - In this case, the dialogue shows a multi column list with headers and normally one would click on one of them in order to have the list sorted by the contents of this column - which it does not provide. 

Unfortunately the relevant code is said to be a spaghetti monster. But once someone touches it he might consider to standardize all use cases where a list of bookmarks appears (i.e. the navigator and the insert bookmark and possibly others) such that they all look the same in the part showing existing bookmarks and all allow sorting by any column.

One other finding there is, that a bookmark to a marked word is displayed differently to a bookmark just to an insertion point.
Comment 12 Adalbert Hanßen 2019-06-16 20:47:31 UTC
(In reply to Heiko Tietze from comment #1)
> The bookmark dialog allows to sort the items for page, name, and text
> (though the Navigator sorts by name only). Isn't that enough?

Testing it with Version: 6.3.0.0.alpha1+
Build ID: 77ae0abe21f672cf4b7d2e069f1d40d20edc49a7 (2019-05-31) I see, in the insert bookmark dialogue the bookmarks are sorted by page (or possibly even by order, in which they appear? I did not check the ordering of bookmarks on the same page). 

Although a 5 column list is shown there with headlines Page/Name/Text/Hidden/Condition, one can not sort the result list by any other column than the first one, by which it is ordered when it is presented fist. However, by double-clicking on one of the bookmarks in the list of existing bookmarks one can go to that particular bookmark - something which seems to have been complained missing in the navigator in thread 86395 mentioned below.
Comment 13 Heiko Tietze 2019-06-17 10:20:13 UTC
(In reply to Adalbert Hanßen from comment #12)
> Although a 5 column list is shown there with headlines
> Page/Name/Text/Hidden/Condition, one can not sort the result list by any
> other column than the first one...

I can sort by any column up and down, macOS 6.2.3 and it was the same on Linux 6.1 and 6.4. If you found a Windows related issue we have to fix this.
Comment 14 Adalbert Hanßen 2019-06-17 11:58:30 UTC
Created attachment 152246 [details]
Screenshots with current developkment version where Insert Bookmark does NOT allow to sort, in Reply to comment #12 of  bug 123514 (Screenshots)

I can't sort by any column. I can't reverse the sorting order by clicking on any column in the headline.

I am testing with Version: 6.4.0.0.alpha0+
Build ID: f75c2b04785aa05cff3bcd52689feb7400a14e8e
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk3;
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-06-15_11:49:26
Locale: de-DE (de_DE.UTF-8); UI-Language: en-US
Calc: threaded under Ubuntu 16.04.6 LTS.
Comment 15 Heiko Tietze 2019-06-18 13:00:55 UTC
(In reply to Adalbert Hanßen from comment #14)
> I can't sort by any column. I can't reverse the sorting order by clicking on
> any column in the headline.

Strange

> TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time:

Double strange.

Xisco, one for you?
Comment 16 Xisco Faulí 2019-06-19 13:50:25 UTC
Hi Adalbert Hanßen,
I've just found it's a regression and I reported it in bug 126005 as this bug was becoming to long.
Thank you very much for reporting this issue. it should be fixed soon

*** This bug has been marked as a duplicate of bug 126005 ***
Comment 17 Adalbert Hanßen 2021-06-28 10:00:48 UTC
Today I tried this again in 

Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: e0c4cdf9a874bb40f028a26562e6399d39cb2c0f
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-05-29_20:31:52
Calc: threaded

When trying set a hyperlink to a bookmark the offered list is not ordered to any reasonable order: neither by appearance in the document nor lexicographically.
One can't sort them by any criterium in this dialogue.

When I try to set a hyperlink to a heading, the displayed list prefixes all headings with a hierarchical numbering scheme. In my document I don't use such a scheme, so the beginnings of the written headings (i.e. without this prefixed numbering, which doesn't really help me) for each heading jump line by line from one column to another, which makes finding a specific beginning of them with the eye more difficult.

As I said earlier: There should be a search function (which might be the standard one if it is applied while the Dialogue "Sprungziel im Dokument" (probably Jump target in document in an English version) is open - and then it should only search in that dialogue's window.
Comment 18 Dieter 2021-06-28 14:43:53 UTC
Fixing bug 1266500 doesn't seem to solve the problem reported here. So I remove duplicate and change status back to NEW
Comment 19 Stéphane Guillou (stragu) 2023-06-30 22:43:19 UTC
Testing again in a recent master build:

- The last selected element in the navigator is now remembered and selected when reopening.
- It is possible to search for elements in the Navigator sidebar and the Target in Document dialog by typing the name, but it only highlights exact matches (just like in the sidebar).
- Bookmark dialog allows sorting by any column, which covers alphabetical ordering. Alphabetical order in Navigator sidebar has been implemented in 7.4 for bug 86395, but can't be used in the "Target in Document" dialog.
- The document order of bookmarks (the default) is also fixed since 7.4.
- See also the idea of replacing the current search with filtering in bug 130646.

I changed the summary to focus on the remaining issues of allowing alphabetical order in the Target in Document dialog. Hope that makes sense and I didn't miss anything.

Jim, is that something you'd be interested in?

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 3551d18404cb19cdaa8edb170a549f5c5405d0cb
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

(In reply to Adalbert Hanßen from comment #17)
> When I try to set a hyperlink to a heading, the displayed list prefixes all
> headings with a hierarchical numbering scheme.

Please test a recent version and if the issue is still present, open a separate report.
Thank you!