mozillabrasil / sumo_live_helper

Helper Add-on for SUMO forum contributors
https://addons.mozilla.org/firefox/addon/sumo-live-helper-/
Mozilla Public License 2.0
7 stars 8 forks source link

Added support for Android #132

Closed WesleyBranton closed 4 years ago

WesleyBranton commented 4 years ago

Added support for Android (see issue #74)

jhonatasrm commented 4 years ago

To me looks great! I don't know about the commit "Added page loading wheel to hide slow loads "... @dannycolin what do you think? 🤔

WesleyBranton commented 4 years ago

@jhonatasrm My primary reason for adding that loading wheel to the UI is for the sidebar. When you first start Firefox, the sidebar takes a long time to load because the browser takes a long time to handle Storage API requests on startup. That means the UI looks broken.

It also helps to hide strange UI changes on startup. For example, you see it a lot on Android because they are typically a little slower than computers. So you might see the regular UI bar at the top of the screen for a split second before the Javascript code is able to pull the query from the URL and change the page to the mobile layout.

It's up to you guys though. If you don't want to have the loading wheel, I can pull it from the branch.

jhonatasrm commented 4 years ago

It also helps to hide strange UI changes on startup. For example, you see it a lot on Android because they are typically a little slower than computers. So you might see the regular UI bar at the top of the screen for a split second before the Javascript code is able to pull the query from the URL and change the page to the mobile layout.

I understand... I believe we can keep then, I just thought the loading wheel is a little bit different in the Desktop version.

However, I wonder if (in the future) it could be possible to asynchronously call the SUMO API so instead of waiting for all the data to be loaded we could progressively show the questions that are loaded.

We can think in future how to improve that, for now I think this PR is awesome. 🙂

WesleyBranton commented 4 years ago

Looks good to me and I don't mind the loading page if it helps. However, I wonder if (in the future) it could be possible to asynchronously call the SUMO API so instead of waiting for all the data to be loaded we could progressively show the questions that are loaded.

API calls are already asynchronous. They are all sent at once and handled as they come in. For example, if you are looking for Firefox and Thunderbird questions, two API calls are sent. Whichever request comes back first will be added to the list right away.

What I was referring to was the Storage API. We save the list of questions in the Storage API so they can be immediately loaded into the popup while we wait for the list to be updated from the SUMO website. But the problem is that you need to wait for the question list to be loaded. On startup, that process can be really slow.

Other than at, most of the APIs are already asynchronous. We kind of have to handle each question one at a time so that we can insert them in the correct order. If 5 questions are being added all at the same time, it's likely that the questions won't be sorted correctly by the ID.