Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "page preview" feature of Wikipedia and Wikivoyage #719

Closed
Jaifroid opened this issue Apr 10, 2021 · 9 comments · Fixed by #1252
Closed

Support "page preview" feature of Wikipedia and Wikivoyage #719

Jaifroid opened this issue Apr 10, 2021 · 9 comments · Fixed by #1252
Assignees
Milestone

Comments

@Jaifroid
Copy link
Member

Jaifroid commented Apr 10, 2021

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.

image

@Maneet-k
Copy link
Contributor

Maneet-k commented Dec 8, 2021

Jaifroid, I want to work on this issue. Can you please assign this issue to me

@Jaifroid
Copy link
Member Author

Jaifroid commented Dec 9, 2021

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

@Maneet-k
Copy link
Contributor

Maneet-k commented Dec 9, 2021

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

@Jaifroid
Copy link
Member Author

Jaifroid commented Dec 9, 2021

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.

@mossroy
Copy link
Contributor

mossroy commented Dec 9, 2021

#729 might also be easier than #78 ?

@Jaifroid
Copy link
Member Author

Jaifroid commented Dec 9, 2021

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.

@Maneet-k
Copy link
Contributor

Maneet-k commented Dec 9, 2021

Thanks alot @Jaifroid and @mossroy for your help. I'll be working on that issue^^

@kelson42
Copy link
Collaborator

kelson42 commented Dec 9, 2021

Same as kiwix/kiwix-desktop#611 on kiwix-desktop. Really hard ticket, if the "preview" is not already pre-computed.

@Jaifroid
Copy link
Member Author

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:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants