-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Provide methods for resetting the app and bypassing appCache #797
Conversation
If these settings or UI are considered confusing for basic users of the app (non-developers) we could hide them and have a small link at the bottom of the Expert settings panel that would say:
This link would reveal the UI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the purpose of the PR.
I did not test but had a quick look at the code (see my comments).
I'm wondering if we should not move the content injection mode choice outside of the "expert settings", now that we are close to switching it to SW by default (but it might be a different topic/PR)
And it could be renamed "Expert/developer settings" with your new content.
Regarding the "Bypass appCache" checkbox, I find the UI confusing. The fact that it's on the same line as the reset button tends to make me believe it is an option of the reset button.
And I think it should be hidden when in jQuery mode
@mossroy Thanks for the quick response. Some comments below:
That's a good idea, and can be done as part of this PR. Any idea what to call the box for this? Suggestions:
OK, I can see that. I can relocate to next line and only show that option if SW mode is enabled. The Reset button works in both modes, btw. |
He, he, I had to fire up IE11 and run it from the file:// protocol to discover (remember) that we don't actually use the keyPrefix ('kiwixjs-') in front of legacy cookie keys, hence settings weren't being reset in IE11. I've amended the code to fix this and also discovered another very minor incompatibility also fixed. I was actually quite impressed that our code still runs fine from file protocol in IE11! That's quite some achievement in 2022... |
Suggested new UI in screenshots below (left is what you see in jQuery mode, right in SW mode). I've also set the gh-pages implementation to this branch: https://kiwix.github.io/kiwix-js/www/index.html . If you had already visited this implementation, it won't immediately show the new code. It will self-update in SW mode, but only after exit and restart of app, if it has had time to cache the new code. Thereafter, the reset button should show. Alternatively, go to Dev Tools, Application tab (or Storage tab in FF), and delete the appCache, then reload. |
Should I move the option "Permanently hide active content warning" into Expert settings too? I'm not sure we really want ordinary users deactivating that warning if we move to having SW mode as the default. We need to be able to warn them if they've switched to JQuery mode and forgotten about it. Alternatively, this could be done as part of the PR for #196. |
Thanks for the screen snapshots. For "Expert settings", I prefer your second ("alternative") proposal. The layout makes it more clear that these are separate options/actions |
Looks great! |
Test implementation: https://kiwix.github.io/kiwix-js/ updated to latest code on this branch, for quick testing. App may need to self-update to version 3.3.7 (a dummy version number) and should notify when that version is ready (in Config) if app is being used. Anything lower, and it's not on the latest code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not test a lot, but I'm sure you did.
OK for me
Will test on real IE11 on a Windows 10 machine before merging. Works OK in IE11 Mode on Windows 11, but it's not 100% the same. |
Test on real IE11 successful. |
Small "bug" (more of a feature!) discovered when testing reset in the Firefox extension in SW mode. Because the app uses the query string to set parameters between the local extension and the PWA, if the user presses the reset button while the query string still has several parameters in it, then the parameters are set again from the query string. The solution will be to clear the query string EXCEPT for the I'll test a quick fix for that. |
That issue is now fixed. All tests passing, including the following:
So I'll squash/merge this after midday GMT unless I hear any objections. |
This is intended to address #794, because we have a number of new developers who will find the new functionality confusing.
This provides a UI for resetting the app (see screenshot) under Expert Settings.
The button "Reset" performs a full app reset consisting of:
Of course all settings are lost and reverted to defaults.
The checkbox is intended for Service Worker mode only (it will complain if set in JQuery mode). It bypasses the appCache by:
When re-enabling the appCache (by unticking the checkbox), it will: