Skip to content

adds loading spinner when app is first loading#221

Open
will-weiss wants to merge 1 commit into
mainfrom
loading-spinner-prototype
Open

adds loading spinner when app is first loading#221
will-weiss wants to merge 1 commit into
mainfrom
loading-spinner-prototype

Conversation

@will-weiss

@will-weiss will-weiss commented Jan 22, 2021

Copy link
Copy Markdown
Contributor

Work in progress - the general idea is to add a loading spinner for the whole page while React is busy painting so that the user knows something is going on.

This view should take up the same view height as the rest of the extension, so I used a magic number of 388px to do that. An issue is that the view when you're not on a webpage is an alert that should not be that high.

The good news is that we should always know ahead of time whether you're in one view or the other and can use browser.browserAction.setPopup to change the view ahead of time so that when the user clicks the popup the proper view loads and there is no glitch where a 388px high view loads and then is quickly replaced by a smaller alert.

This approach feels a bit hacky as we're duplicating work to some extent by inlining the Alert react component and just making the not-a-webpage.html but I think it's a reasonable approach.

Another thought that's coming to mind is what if the user uses dark mode. Currently that's not handled, so would we have 2 .html files? One for dark mode and one for light mode? At that point we may want to generate these HTML files from React rather than relying on copy/paste - which could get out of hand very fast.

If we like this, we might also consider having using a similar approach for the NotAuthed view when we know the user is not authenticated and render a static screen with a link. Then, in the popup.html (which we might rename as there would be several htmls describing the popup) we could inline the buttons so that the loading spinner is just in the upper half and the user would immediately see the buttons.

Thoughts?

image
image

Comment thread html/popup.html
<div class="app"></div>
<div class="app">
<div class="authenticating">
<div class="authenticating-spinner">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use CSS for the dark theme? Why do we need 2 files?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spinner doesn't seem to spin 🤔

@shachar-langer

Copy link
Copy Markdown
Contributor

I don't understand your suggestion for the NotAuthed view. What is the problem with the current view?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants