kiwix-desktop icon indicating copy to clipboard operation
kiwix-desktop copied to clipboard

Support for previewing online books

Open veloman-yunkan opened this issue 10 months ago • 9 comments

Currently in kiwix-desktop one cannot preview a book from the online library directly in kiwix-desktop. They have to visit https://library.kiwix.org using their web-browser and find the book of interest. Having the ability to preview books with a single click will improve the user experience.

veloman-yunkan avatar May 03 '24 21:05 veloman-yunkan

I support the feature request

kelson42 avatar May 12 '24 08:05 kelson42

@ShaopengLin Sounds straight forward to me. Would you be able to provide a mockup of a „preview“ button?

kelson42 avatar May 12 '24 08:05 kelson42

@ShaopengLin Sounds straight forward to me. Would you be able to provide a mockup of a „preview“ button?

What type of behaviour do we want?

  • Open the link to another browser.
  • Open the link in Kiwix-Desktop. Qt Webview should be able to load the website through HTTP request to https://library.kiwix.org/.

ShaopengLin avatar May 12 '24 13:05 ShaopengLin

@ShaopengLin Open the link in external browser, behaviour should be the same like opening an external link in ZIM content.

kelson42 avatar May 12 '24 15:05 kelson42

I have some potential mockups

  1. This is pretty straightforward and keeps the same feel of the UI. One problem is, that once the download starts, users cannot preview the website anymore. Screenshot from 2024-05-12 23-14-30

  2. Having the preview button in the description solves the issue from 1.. The downside is that it isn't as readily apparent to the user. Screenshot from 2024-05-12 23-44-58

  3. Having another column for preview solves both. Screenshot from 2024-05-12 23-51-49

@kelson42 All 3 are doable and personally, I am leaning toward 2. or 3.. The code for the download column is pretty cohesive currently, and handling an extra preview button makes its responsibility way too complicated.

ShaopengLin avatar May 13 '24 03:05 ShaopengLin

@ShaopengLin The 2 is the best to me IMHO, but please put the preview link after the description (instead of before).

kelson42 avatar May 13 '24 04:05 kelson42

@kelson42 Do we want the preview button to persist after the download?

If so: To confirm, what are the book URL rules on https://library.kiwix.org/? The download URL is no longer provided by the library after it has been downloaded so I cannot extract the book URL then.

From what I have seen, our book URLs are formatted as:

  • name + '_' + (flavor + '_' ) (if exist) + date (yyyy-mm)

ShaopengLin avatar May 14 '24 04:05 ShaopengLin

@kelson42 Do we want the preview button to persist after the download?

No, should be only available for online library.

kelson42 avatar May 14 '24 05:05 kelson42

@ShaopengLin The 2 is the best to me IMHO, but please put the preview link after the description (instead of before).

Let's first implement this feature as an additional entry in the context menu. Once it works a button or a link can be added in a follow-up PR.

veloman-yunkan avatar May 14 '24 11:05 veloman-yunkan

@kelson42 Note that the functionality was implemented via a context menu entry (which kind of makes this feature somewhat hidden). Maybe it makes sense to open a ticket for conspicuous UI for the preview action.

veloman-yunkan avatar May 20 '24 13:05 veloman-yunkan

@veloman-yunkan Good enough for me at this stage

kelson42 avatar May 20 '24 13:05 kelson42