Bug 128434 - Preview tooltip for hyperlinks to other pages
Summary: Preview tooltip for hyperlinks to other pages
Status: CONFIRMED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: usability
: 427657 433963 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-06-01 11:07 UTC by Markus Krötzsch
Modified: 2024-04-28 06:05 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Krötzsch 2006-06-01 11:07:24 UTC
Version:           3.5.2 (using KDE KDE 3.5.2)
Installed from:    Ubuntu Packages
OS:                Linux

Many PDFs include hyperlinks between the pages, typically to subsections of other pages (viewport). When hovering the mouse over those hyperlinks, KPDF should create a preview of the link target page and display it like a tooltip. The use case for this is that the user can read the first few lines after the anchor of the hyperlink without clicking it. 

== Why this is a hot candidate for implementation ==

* It would greatly improve the efficiency of reading documents with a lot of bibliographical references and the like. Instead of clicking forwards and backwards all the time (including the loss of reading continuity), one can always stay on the read page and still check out what the links mean.
* It is not obstrusive for users who don't want it. It could also be switched off easily.
* It is a very cool feature to print in a new release's feature list, and a very innovative one too. 
* The necessary code for asynchronous previews, hyperlink resolving, and viewports seems to be in available -- you just have to use it in a new way.
* Previewing links on hovering is not common in document viewers. An implemention might create prior art that prevents future patents.

== Why it is not completely trivial ==

* In order to be readable, the size of the preview must be rather large, probably about 100% zoom. So it seems that the tooltip should only show a short part (about 3 lines) of the link target. An efficient implementation for partial rendering of pages may or may not be available. Yet I think that even if some waiting is required, the feature would still way better than clicking the link and being caried over the whole document.
* The behaviour must be sufficiently configurable. Core settings are: switch on/off, zoom level of the preview, vertical size (in % of page?) of the portion shown in the tooltip.
* When showing only part of the target page in the tooltip, the orientation of th document must be respected.
* An asynchronous, top-down rendering of the preview that dynamically grows the tooltip size would be extremely cool, but more problematic to implement.
* Previews must be disabled for presentation mode.

Thanks for reading. If you like this wish, don't forget to give it your vote and supportive comments.
Comment 1 Pino Toscano 2009-07-08 12:42:48 UTC
KPDF is no more developed, but its KDE 4 successor Okular is. Moving product.
Comment 2 cmertes 2012-06-28 10:13:18 UTC
I'm not sure if this is the same feature request as the initial description seems to indicate that the preview content be somehow automatically determined but to see some showcases of intentionally set tooltips have a look here:
http://tex.stackexchange.com/a/54831/13450
http://user.mendelu.cz/marik/fancy-preview/#pictures

As described in the StackExchange thread, there are several ways to produce such documents with LaTeX under Linux and needless to say, it would be cool to be able to see the tooltips in okular.
Comment 3 Nicolas Bigaouette 2013-02-17 17:22:11 UTC
I was about to submit such a feature request.

It would be extremely useful to be able to get a tooltip-like popup when mouse-over latex-bibtex references link. Right now, I open the document twice; one for the main text and another one with the references section to be able to quickly see the references.

Since okular is already parsing/rendering the pdf file, it could be able to create the tooltip automatically.
Comment 4 David Hurka 2021-03-05 14:33:24 UTC
*** Bug 433963 has been marked as a duplicate of this bug. ***
Comment 5 David Hurka 2021-03-05 14:33:33 UTC
*** Bug 427657 has been marked as a duplicate of this bug. ***
Comment 6 Philip 2021-08-28 03:54:17 UTC
I recently switched from GNOME to KDE. While I now prefer the latter because of its ability to be configured to a greater extent, I was quite surprised to find out that Okular does not have a PDF link preview tooltip/popover like GNOME's Evince.

As mentioned already by Nicolas, a link preview is very convenient to see an entry in the bibliography without navigating back and forth or having multiple windows open. And it also would enable user to have a quick glance at an equation or figure that appears on a different page.

I find Evince's link preview well done. If implemented in Okular, perhaps the preview popover's size could be made configurable.

Here is a discussion of the functionality at GNOME's Gitlab, and a screenshot of the link preview popover in action: https://gitlab.gnome.org/GNOME/evince/-/issues/662
Comment 7 Massimiliano L 2022-02-14 10:24:55 UTC
*** This bug has been confirmed by popular vote. ***
Comment 8 Nipin 2023-02-14 19:45:56 UTC
(In reply to Massimiliano L from comment #7)
> *** This bug has been confirmed by popular vote. ***

Any info, if this has been implemented or on the anvil?
Comment 9 Jonas 2023-08-01 01:24:08 UTC
This would be really great to have! I've been using okular for years, but just learned about this feature in evince.
Comment 10 Henry Gebhardt 2024-04-28 06:05:26 UTC
(In reply to Philip from comment #6)
> I find Evince's link preview well done.
Thank you! As the main person who implemented Evince's link preview behavior (https://gitlab.gnome.org/GNOME/evince/-/commit/f95c24b96de0024f5888e1b11f787ad1432e2263) (just the behavior, not the previews themselves), I can explain the considerations that went into Evince's link previews, as well as common complaints.

In order to be useful, Evince's link previews need to have several characteristics. First, the text in the link preview needs to be readable (as already mentioned in the description of this bug). Second, the size of the popup needs to span the entire width of the page, because links only contain a single (x,y) coordinate, and the convention where the content is relative to the link destination (x,y) differs for different types of links (see below). Third, vertically the link preview is at most 1/3 the size of the main view, so that the preview doesn't dominate the view, while still showing sufficiently much around that (x,y) destination.

fancy-previews would be awesome (as mentioned in Comment #2), but are not used much, so cannot be depended upon.

As to what should be shown inside the preview, I did a survey of the different kinds of links I saw in papers on https://arxiv.org/, many of which have two columns of text side-by-side on each page. The different types of links are:

* Section headers, bibliographic references, footnotes, and tables have the link point to the top left of the content they are pointing to.

* Equations have the link point to the equation number that is printed to the right of the actual equation.

* Links to figures usually point to the caption below the figure.

Evince does not try to heuristically fix incorrectly set links (e.g., the problem of Def 2 pointing to Def 4 mentioned in one of the duplicate bugs).

The upshot is that the best destination area to show is such that the link points to just a little above the center of the previewed area.

I did a (more detailed but somewhat shitty) writeup of all this at http://www.2-node-supercomputer.net/2020/blog-20201114-evince-link-preview.html (sorry no https). Though the most concise explanation is in the previously linked Evince commit https://gitlab.gnome.org/GNOME/evince/-/commit/f95c24b96de0024f5888e1b11f787ad1432e2263.

A common complaint about Evince's behavior is that the link preview is automatically triggered when hovering over a link, and this can get annoying when there are many links on the page. Evince maintainers are opposed to adding a configuration option to disable opening a preview. Alternatively, one could also imagine showing the link previews only on some other action, say, when clicking the link (and double click could follow the link - this has not been explored further, just thinking out loud).

PDFs with incorrectly set links have also occasionally led to bug reports on Evince.

Some people also don't like the aethestics of a preview spanning the entire width. However, this is crucial to get all the aforementioned link types displayed sufficiently, especially for papers with two columns.

I hope this helps in deciding to add link previews to Okular, perhaps with a different take on them, perhaps similar to Evince. They are immensely useful when reading papers with lots of equations and references, so I do hope someone will find the time to implement them in Okular, and I am willing to help where I can as I am enjoying Plasma 6 quite a bit.