-
-
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
Upgrade Bootstrap to version 4 #527
Conversation
These are the main changes.
|
|
FYI Commit c463ba4 is a proposed fix for #470, i.e., we no longer have to create the alert boxes' html in code each time we want to display them. However, as you can see, it doesn't save any code; on the contrary, it adds to the amount of code, because we have to implement an override on Bootstrap's own This commit (as opposed to the whole PR) could be added to a separate branch and we could have a PR on it as a solution to #470, if you'd prefer to do it that way, @mossroy . Just let me know, and also let me know if you think this way of doing it is better than what it replaces (just focus on commit c463ba4). |
@Jaifroid Version of Bootstrap in |
4f45b61
to
b0ccd85
Compare
I've rebased this branch/PR on master. |
b0ccd85
to
97afaac
Compare
I don't forget this PR, but will need more time to look at it. |
No rush! After your holiday is fine. |
I finally took a bit of time to have a look at this PR. I'm OK with fixing #470 in this same PR, and happy to see that we do not put HTML strings in javascript files any more. I find that much better than the previous version, even if it adds a few lines of code. There are a few minor issues that I noticed :
|
Thanks @mossroy . I'll take a look at those issues. One thing to note, however, is that if the intention is to use this as a stepping-stone towards a similar interface to that provided in Kiwix JS Windows, then it may not be worth trying to fix these issues yet, but to tidy up once we have the full new interface. I'm not sure. On the other hand, I think most of the issues are probably pertinent to functionality we'll want with the new interface. I don't currently use a collapsing toggle, but it may be necessary to continue supporting very narrow screens. We'll see. |
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 look into the bootstrap 4 implementation details : I trust you on that.
I just added a few minor comments.
If you prefer, I agree to merge this PR and handle the issues I mentioned afterwards.
IMHO, the main one is the fact that the menu items do not collapse when you choose one of these items. In #523, we were talking about having 2 menus like that, so it might be worth dealing with that.
Fixed in local copy |
I think this is also fixed (but I found it hard to see, so not entirely sure). I've pushed all fixes so far. I'm still missing:
I propose to fix the above after replacing the text-based system, because lots of things could change. Please let me know if you're happy for me to squash rebase. |
Hmm. "CodeFactor" doesn't seem to like the bootstrap library code. Can it be marked as library code, so it doesn't get checked? EDIT: It seems that after we merge, we'll be able to mark the relevant files as "Ignore", but it's not possible to ignore them in a PR. As they are new files, we'll just have to swallow this poor code and then ignore it after merge. |
The code of your latest commits looks good. I did not do anything to activate CodeFactor. I suppose it's a general modification done at the hackathon. It should not prevent you from merging this PR. |
Great! |
Although I think the self-closing is optional in html5, I am making my edits consistent with the rest of the file. We will need to replace ultimately with <p></p>
b5c7447
to
0ffcb33
Compare
So I've rebased on master, and it unfortunately doesn't cure the Chrome test failure. I've checked in sauce labs, but as you said, @mossroy, the keys R-a-y are never registered by the search field. This only occurs in Chrome. They are clearly visible in the other browsers. The http response (visible in the screenshot) is the same as in Firefox (status 200 and null). So it's a bit of a mystery. I'm back to wondering if our timeout delay (to avoid a race condition when typing fast) is interacting with sendkeys and Bootstrap in a weird way in Chrome. Could Chrome have its own form of rate limiter? I'll see if I can test more at the weekend. |
Looking at my Commit list, one other idea occurs to me: we remove the focus from UI elements as soon as the document is loaded in order to fix one of the issues with FFOS display in the collapsed menu. It could be that, due to the async "optimizations" in Chrome, this blurring occurs after Travis has selected the prefix field, and before the keypresses are sent (maybe exacerbated by the setTimeout on the prefix field). It seems like a plausible explanation that needs testing. |
So that was indeed the problem. The diagnostic commit comments out the line that removes focus from the UI elements, and it now passes. So now we have to decide how to deal with this. In some ways this error can be considered an artefact of the testing system, because no user will select the field and type so fast after article loads. These possibilities occur to me:
Any other thoughts? |
What if you moved this piece of code, so that it is ran synchronously, when starting to read the article, instead of running asynchronously in the onload event (after the article is displayed)? |
Thanks for the helpful suggestion. Although it didn't solve the issue with Chrome directly, it did help simplify the code a little, and to understand what we're doing. It looks like we have a solution. Below is the explanation in case you're curious! But, subject to a bit more testing, I think the code could be ready to merge now, if you agree @mossroy. Explanation: In response to your noticing that in FFOS some buttons remained pressed, I introduced a line to blur any focused UI element on page load. It returns the interface to a neutral state once an article is loaded. In most browsers this worked fine, but in Chrome it caused a failure because the blur conflicts with the sendkey routine for an article search. In fact, the reason there is no failure in the other browsers may be accidental: many browsers defer or batch UI rendering, and maybe Chrome was being the "speedy guy" here, blurring "too soon". Whatever the case, it turns out that the Unit Test expects the search field to be selected when the landing page loads, and doesn't actively select it before sending the search keys. This is consistent with expected behaviour, as traditionally this app selects the search field for the user on pressing the Home button. So, the solution is to blur only if we are not loading the landing page. We already have an
|
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.
All right you can merge this.
If we find some other problems, we'll open some other github issues
This implements #526. I will document the reasons why certain changes had to be made for this version.