-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
BUG: Search Field Too Wide & Hides Icons: Need Style Purge Feature #213
Comments
I think it is some maximum width setting in Registry set by some Wiki files listed in the app's Repository. I tried all options with maximum width in settings before but it does nothing. I tried installing from command line as admin with winget (winget install kiwix.kiwixjs), no good, bug remains. |
So i went to portable electron section. clicking on: redirects to: I installed the Win 7/8/10/11 version for portable electron. Having 2 versions is good, can load each with a different wiki file for fast access. |
I noticed something today: I have an external monitor attached to my Dell XPS 13 i7. The app launches itself on the LAST SCREEN IT WAS EXITED FROM. The app is pinned to my taskbar, does not matter which taskbar screen (laptop or monitor) i launch it from. The bug seems to be related to screen resolution. So the fix should be looking at how to resize the top UI libkit elements correctly on a different resolution screen. Hope this helps, seems this will affect a lot of people in future. |
The bug is quite serious because: If you resize the app window, drag right side of window to increase the width, the top_right icons stay hidden. Another sign that this is a UI bug: |
@washere I'm the main developer of this version of Kiwix, so I'll be happy to look into this and work with you to resolve it, whether through a style purge option or fixing the underlying issue. I have a specific question: you mention in the top post that you were using the app with R-to-L ZIMs. Is that related to this bug? To be honest, the app hasn't been properly coded for Right-to-Left languages, though in principle the orientation of the ZIM contents should not have an effect on the orientation of the interface (which is L-to-R). The screenshots you give are all with the included ZIM, so perhaps the L-to-R is not central to this bug? I have not seen this particular bug before, but I'll try to reproduce if you can give me some steps. In the meantime I can tell you how to purge all the settings (subsequent post). |
@washere Below is the classic way of resetting a UWP app's data. Go to Settings -> Apps and Features and then follow screenshots. Are you able to do so? I have to say that I'm currently getting a message "We couldn't reset this app, please try again in a bit", at least on Windows 10 (I'll try on Windows 11 separately). If it doesn't work, I may have another way. |
@Jaifroid Before i reply I just noticed something. Correction to my last post: Now to answer your question:
So you need such a setup. I just saw your 2nd post on how to reset and did that. So it has nothing to with the only R-2-L file i installed over 10 installs ago. If you do any test versions and upload it somewhere (mediafire or zippyshare or an ftp URL or etc), i will be happy to test and report back. Thanks for your attention and great work. Laptop screen after purge: Monitor screen after pruge: |
@washere Thanks for testing that, and sorry that a reset doesn't fix the issue. It does indeed sound like a screen resolution issue, and possibly something to do with not detecting correctly the resolution of external monitors, so it gets stuck somehow with the resolution of the base monitor. We use Bootstrap as the UI framework, but it is now a slightly older version of Bootstrap, so I think part of a longer term fix might be to upgrade Bootstrap to the latest version. However, it sounds like a faster interim fix is possible: to force a screen recalculation (which is what I believe happens when you use the zoom options). I think it's forcing the webview to do a recalculation at quite a low level, because my feeling is that the underlying browser engine is incorrectly reporting the screen dimensions to the framework (Bootstrap), but resets itself when you do a low-level zoom operation. Could I ask you to test two more things before I try to force that recalculation?:
|
Thanks @Jaifroid The lens + and - icons do not fix it. I tried again now. The only thing that fixes it is if i use CTRL & + or -. Never had this problem with any other app. As i said i tried many other things too yesterday. Thanks again. |
OK, that's useful to know, as it means that the internal recalculations the app does when pressing the buttons are not enough, and it is indeed something lower level. So I need to find a way to force that resize programmatically, for which there should be an API. I'll have a look. Just to comment on something else you mention in the chain above. We don't explicitly code for using the Registry. In fact all our settings are made in pure JavaScript, and stored in standard Local Storage (with a fall back to Cookies for browsers that don't support Local Storage). This is why we can adapt the app to Electron, NWJS, PWA or UWP frameworks very easily: there is no low-level stuff (with the exception of some framework-specific JS, such as Node for Electron, to allow us to access the ZIM file without the user having to pick it every time). Any Registry entries related to Kiwix JS would have been put there by the framework. Because the Store app and the Electron app use a different underlying browser engine, this may account for the fact that the Electron app does not exhibit this bug. Incidentally, you may like to try the PWA version while waiting for a fix. It is available simply by visiting https://pwa.kiwix.org/ . In Chrome or Edge you can install this and it will mostly act just like any other installed app. The only exception is you need to give single-click permission to access the last-loaded archive on relaunch of the app. The PWA version keeps itself up-to-date, and works offline, but could get wiped with a browser reset, so is not so robust for pure offline work as the UWP or Electron apps are. |
Thanks, I did bookmark PWA url yesterday, it gives me a 3rd instance next to this version & 1.7.7E electron. I am using the latter 2 loaded with 2 different zim files. If i need a 3rd file, i'll use the chrome. Thanks for the info on the the temp files being local not registry based with cookies fallback for using browser based versions. Good strategy to keep things clean, and also good for read-only systems as in many organizations using the browser version with cookies. I just now tried many options with intel display graphics settings app, some changes seem to work, but after a few relaunches the bug recurs. So a coding fix seems to be the only persistent solution. Thanks again and let me know if you want me to test or upgrade. |
I just noticed something. On relaunch, unlike this version, the electron version always launches a new instance on "PRIMARY DISPLAY". If the app can be forced to launch on primary display screen, i think there will be no need for dynamic recalculations (lot of work & making code bigger & heavier on resources etc). I think this will be a cheat but the app will remain snappier too and no one will notice any problems. If i notice anything new, will post. |
OK, thanks for the pointers. I have now been able to reproduce your issue by using another PC as a wireless display, projecting from my main PC. Result is exactly as you describe for the UWP app, while in the PWA in Chromium (Edge) the app detects the change of screen resolution correctly. I can now debug this, and try out different options. From my experiment, when I launch on my primary display, and then drag it to the secondary screen, the bug occurs (because no change of resolution is detected). Therefore I don't think that forcing it to launch on one screen or other will fix the issue. However, there is a way to detect changes of device resolution which works with this browser engine. See https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio . With this I can add an event listener and hopefully do something when a change of resolution is detected. |
That is great news, to replicate the issue. |
Just to document my findings so far:
|
Quick update: unfortunately, registering an event listener on the media style query does not fire when the resolution changes. This is clearly a bug in the framework, but UWP with JavaScript will not now be patched or fixed by Microsoft. I've also tried to dispatch a keyboard event with Ctrl + followed by Ctrl -, but unfortunately it seems this is a privileged user action that cannot be invoked programmatically. So this leaves the reload option. I've tested this, and it works, though it's something of a sledgehammer to crack a nut. Clearly it should be limited to the UWP app, and it should be carefully controlled. |
Code so far is in #215. |
Thanks for your good work on this Jaifroid. I just noticed a new way in UI/UX around this apart from CTRL _+ and relaunch on my main laptop screen first. If i:
Then it retains the correct aspect. Thanks again for your great work. |
Please see #215 for a package with the proposed fix in it (for testing). |
Hi Jaifroid, What happened:
So we are getting there. I'll keep retesting this and will report anything new. Thanks again for your wonderful efforts. |
Thank you very much for the testing @washere. If you could take a look at the release page: |
I will test now and report. |
I uninstalled, redownloaded and installed. And tested this and it is the same file. I renamed the first and new download and ran fc in a dosbox:
So initial test was on last build too. Thanks very much. |
After some time, it happens less, about 30% of relaunches. |
OK, thanks. They shouldn't be .exe files. These are .appxbundles, a very different installation technology. Any .exe inside the bundle is merely the framework, so that will always be identical. I've got some ideas for making the reset process happen much earlier, and always. And hopefully that will also be much faster to load. Thank you for the testing. I'll have another ago later today but will let you know if there's a new bundle (and best if I re-number it too). |
Yes i know, i just renamed to something short so i could type out the fc command fast. i did not install as .exe but as orig filenames. I will check later when i get back to laptop for any new builds. It is getting there. Thanks again, have a great day. |
@washere No rush at all, but did you see there is a new package to test? |
Hi Jaifroid,
The bug only occurred once. I think you did a great job. It is much appreciated. So thank you very much in deed. You can close this issue whenever you want. I consider it fixed. THANKS AGAIN FOR YOUR GREAT WORK. |
@washere Thank you very much for testing this and confirming it works most of the time. I've merged this version into master, and will be in a release I hope to do this weekend. Thanks for your kind comments! |
Hi, Yes i know size is irrelevant, i wanted to pinpoint the exact file by size as there are several eg(glish) wiktionary files. I also said size is not the issue and smaller nopic wiktionary files should be similar and gave the ftp links to them. Yesterday it was giving me about a quarter to third of relaunches with the issue. There is one new interesting change that fixes the issue that didn't before the last fix:
Finally I would say, specially in the light of this new fast fix and low occurrence, i consider the issue fixed. I would say the issue is still fixed and the return from more of your time is not worth it. If the percentage of the issue grows substantially, i will report. But in addition to a quick drag to other display & now double click top-bar & low occurrence, i think this should stay closed & marked as solved. Of interest: I never had this issue with homepages of zim files that were image heavy, multi columns of images. Also happened more with text only homepages with a long unwrapped text line. Thanks again & have a great week. |
OK, thanks for the explanation! The reason minimizing and maximizing fixes it is because any resize of the window causes a display reset. This is the only way I currently have of testing that the device has moved to a different monitor. Therefore, the fix (which is a bit of a kludge) issues a reset as soon as it detects any resize of the app's window. In fact, just a very slight resize of the app window should also fix it. My guess is that the app isn't always detecting the shift from the internal to the external display in time, or else that the reset is happening just a fraction too soon, before the app has actually moved to the new monitor. This would account for why it's happening a bit randomly, albeit rarely. It's probably a race condition. OK, let's monitor this, and if it becomes annoying or you find a ZIM that fails more regularly, don't hesitate to reopen this issue (or start a new one). There is a regression I need to fix: #218. |
Thanks bro, |
Installed the MS Store version.
Downloaded one of the R-to-L ZIM files from app's repo.
Went back to app's small default wiki, the search field is so wide, the top_right icons can not be seen.
Long time coder & UI designer.
Tried:
Many re-installs
Many pref changes in settings, plus many combo of
Downloaded several more ZIM files from app repo
etc.
NO GOOD.
Even after reinstall the app seems fine. But when you close & relaunch app, same problem.
Uninstalled (Windows settings REMOVE APP) many times & reinstalled from MS Store, no good, same bug.
Tried the other version from website but totally different and no dark modes nor dark_article mode. Most coders need dark mode.
Files in the old version (install-able) seem to be in appdata roaming from googling. But MS Store version writes to WindowsApps in prog files folder.
Uninstall removes all folders (usually 4).
Had installed WikiMed & WikiJourney from MS Store too, same bug happens to them. Uninstalled them too, no good for Kiwix re-installs.
Had a look at RegEdit, lots of references. This is a bad practice. I suggest all app makers use the old ini files in their install directories, Registry is a bad idea.
Bug seems to be the odd wiki download set some style settings that persist (probably in Registry, maybe somewhere else).
SOLUTION:
Add New Feature in Preferences/Settings:
PURGE ALL PREVIOUS STYLES & RESTORE DEFAULT STYLE
This will save the developers from not just this bug, but many future bugs, i promise that. So save yourself many future headaches.
QUICK FIX:
Maybe just setup a var to see if style has changed and just reset that.
default_style = 1
App checks that on launch and if value is 1 then it will not load other styles.
If it is 0 then it will load whatever style the user had set or a ZIM file set.
But you need a procedure to completely flush the style changes.
If i change zoom with CTRL and + or -, then the bug goes away. But it is a pain to do this on each launch.
This bug needs fixing anyway.
The text was updated successfully, but these errors were encountered: