feat(bookmark): improvements in bookmark workflow

  1. Add/Remove Bookmark buttons in annotation context menu which adds a bookmark at annotation's viewport and with annotation's content as title.
  2. Folder bookmark item's title default to filename instead of long file path.
  3. TOC alike Expand/Collapse all buttons in bookmark list context menu.
  4. Open bookmark in a new part instead of replacing the current document.

@teams/vdg

image.png

image.png

image.png

Reason:

  1. 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.

  2. The current folder item name is default to long file path which is less readable than filename.

  3. 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.

  4. 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| NewPart

    where Part::openUrl is the truely receiver of the url emitted from BookmarkList, where url can be file:///document.pdf#197;C2:0.525952:0.683815:1 is the full url with viewport fragment. Part::openUrl try to open the document and set the viewport based on the url, 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.

Merge request reports

Loading
Loading