kiwix-js
kiwix-js copied to clipboard
Support "page preview" feature of Wikipedia and Wikivoyage
This is a feature that is default for signed-out users of Wikipedia, though signed-in users may need to switch it on. It consists in showing a small preview of the lede, together with an image (if the article has one) when a user hovers over (or long-presses on mobile) an intenal link. It looks like in the screenshot below (the Île-de-France pop-up). It seems to me that this would be quite easy to support in Kiwix JS, especially now that block caching gives us quick lookup capabilities. The equivalent of hovering over a link in mobile is long-press.
Would this be of interest? An issue might be how to get the target of a hover in SW mode without interfering with the DOM. I think it can be done with a mouseover event listener on the iframe window (i.e. above the DOM), from which the target of the event can be retrieved and tested. It would need to run with a suitable timeout delay, so that it is not triggered excessively with each mouse movement, but this is precisely what is required for a hover event. This method would avoid having to attach listeners to each link in the DOM.
Jaifroid, I want to work on this issue. Can you please assign this issue to me
@Maneet-k Thank you for the offer. However, this issue is a tentative suggestion, and has not been agreed by the active developers on this app. No work should be undertaken until a discussion has been had about the usefulness of the feature and the balance of utility vs the risk of complicating the codebase. This feature, if agreed, is not at all straightforward, and if you are not highly experienced with JavaScript and UI development, then I would suggest you look for a different issue.
Ohkayy...... not a problem at all :) But that would be little better if you could give me some suggestion on other issues, if they're open
Well I don't know your level of experience. If you're prepared to study the source code and look for ways of putting repeated code into a separate function, then #78 might be suitable. But it depends on your interests, knowledge and experience.
#729 might also be easier than #78 ?
That's true. I had assigned that to someone else, but that person has not come back to us and doesn't appear to be working on it.
Thanks alot @jaifroid and @mossroy for your help. I'll be working on that issue^^
Same as https://github.com/kiwix/kiwix-desktop/issues/611 on kiwix-desktop. Really hard ticket, if the "preview" is not already pre-computed.
This issue has been solved in the PWA, and I have nearly finished backporting the code. Here's what it looks like in KJS browser extension: