kiwix-js
kiwix-js copied to clipboard
Reopen the last article after switching between menu items
A cookie might keep the last article
Kiwix-js-windows now implements re-displaying the last article after switching back from "Config", without re-loading the article. (It also disables the link back to the article if the user has switched CSS display mode, as this necessitates reloading the article). I'm in the process of backporting to kiwix-js to commit just the switching between tabs to a new branch built on the main branch (so as to be able to make a PR for testing from main).
The testing branch is here: https://github.com/kiwix/kiwix-js/tree/Return-to-last-article-from-config-without-reloading , but it has no changes yet.
If anyone wants to test the full feature set, they need to do so on kiwix-js-windows until I edit this message.
Edit: backport is now complete - see PR #291 .
As discussed in #291, I think switching between menus should "naturally" keep the context. Without doing anything special, the user should see its last article after going to and back from another section. It should only be a matter of not emptying a div, in order to be able to see its content when un-hiding it. That would be the first step.
A second step would be to store what's necessary in a cookie, so that to be able to re-open the same article after closing/re-opening the app. Which is a bit more complicated because of the different ways to open a ZIM file
I renamed this issue, to narrow it to what can be implemented for now : be able to return to the same article after going to another section (settings, or about) As it's not possible to reopen the ZIM file automatically (in a portable and cross-browser way), it's not possible to do more.
OK. It is possible to remember the last page for each ZIM and load it after the user has picked the ZIM. We simply store a cookie value like lastPageLoaded=Page_d'accueil@wikipedia_fr_all_novid_2018-10.zim and load it if the picked ZIM name matches. In Web context, it's not so useful, but in app context it can be very useful (albeit that it has privacy implications).
You're right
In Web context, it's not so useful, but in app context it can be very useful
That's why I think it's better to keep it in kiwix-js-windows, without backporting it for kiwix-js (where it would only be useful for the dead Firefox OS...).
With this renamed issue, it should be not necessary to store the info in a cookie, and there will be no privacy concern
I am working on #523 but I need to build this functionality of returning to last article
That's why am solving this issue first
We just need to implement the functionality of returning to last article after unclick on config & about button
I thing it will done using hiding and unhiding of that section/div. Using some dom-manupulation
I working on it
@Rbcoder1 Exactly!
Ok I Make PR for it Thank for better suggestion