feat(bookmark): improvements in bookmark workflow
- Add/Remove Bookmark buttons in annotation context menu which adds a bookmark at annotation's viewport and with annotation's content as title.
- Folder bookmark item's title default to filename instead of long file path.
- TOC alike Expand/Collapse all buttons in bookmark list context menu.
- Open bookmark in a new part instead of replacing the current document.
Reason:
-
More than once I found an annotation in one lecture note or some paper has the importance beyond the document itself, in which case I had to manually add a bookmark for it. The Add/Remove Bookmark buttons in annotation context menu can simplify the process.
-
The current folder item name is default to long file path which is less readable than filename.
-
This want emerges naturally when I search for "Gauss" in my bookmark list, the folder items are collapsed by default and I can't see if the matched bookmark items are "Gauss lemma" or "Gauss theorem" or even "Gauss curvature" etc, after all, it is a small change.
-
The last but not the least. This change can be visualized by a graph:
flowchart TD Shell["Shell::handleUrlFromBookmarkList --> Shell::openUrl"] Part["Part::handleUrlFromBookmarkList"] NewPart["New Part::openUrl"] BookmarkList["BookmarkList::goTo"] Shell -.- Part Part -.- BookmarkList BookmarkList -->|openUrl| Part Part -->|openUrlFromBookmarkList| Shell Shell -->|part->openUrl| NewPartwhere
Part::openUrlis the truely receiver of theurlemitted fromBookmarkList, whereurlcan befile:///document.pdf#197;C2:0.525952:0.683815:1is the full url withviewportfragment.Part::openUrltry to open the document and set the viewport based on theurl, or simply set the viewport if the document has already been opened.The reason behind is that when I want to check, for example the definition of "convexity radius" in Riemannian geometry, which has three different definition in three textbooks and I have bookmarked all of them, then the current behavior is that new document will replace the current document and after I finished checking, the original document I was working on had been replaced and I had to open it in
Recent Document. It is inconvenient.


