Skip to content
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

Updating UI should be very Thoughtfully Considered #22

Open
anaisbetts opened this issue May 2, 2018 · 7 comments
Open

Updating UI should be very Thoughtfully Considered #22

anaisbetts opened this issue May 2, 2018 · 7 comments
Labels
meta Meta discussion

Comments

@anaisbetts
Copy link

anaisbetts commented May 2, 2018

Hi! I love that someone is trying to make the update process more straightforward and easier to set up for Electron developers. As one of the original authors of Squirrel, I'd like to share a bit of the philosophy of Updating that might inform some of the design decisions around the default update experience.

The Zen of Updates

One of the things we always tried to make possible in Squirrel is, "Never get between a User and their Work". Users open apps because they want to get something done, and we as developers want to respect their time. Software Updates by unfortunate necessity get in the way of that - we're asking the user, "Please, stop thinking about your stuff, and think about my stuff instead"

To that end, Squirrel makes it possible (but not required!) to do completely silent updates in the background. While that's not appropriate for every application, it's a great experience for those that can do it, because users Don't Have To Think. When we do have to pop an update dialog, we should do it at a very context-appropriate time - for example, in a music application, a good time to show an update dialog is at the end of the album / playlist: the user finished what they wanted, and they have to interact with an app anyways to do The Next Thing.

What To Do

So, I suggest that:

  1. The default UX is nothing, it just fires an event
  2. The code for showing the UI dialog gets moved into a public method with a super clear, obvious-to-intent name

This lets people who want that dialog as maybe a way to get started, to get it with a one-liner, but still let people have silent background updates if they think it's appropriate for their app (PS: it probably is!)

Why It Matters So Much

Defaults are important - even if some People Who Care make a great experience, we know that the vast majority of people are going to just do whatever update-electron-app leads them to by-default. This means we have a huge opportunity to make the update experience for lots and lots of new Electron apps Great By Default, which is extremely rad and good!

@zeke
Copy link
Contributor

zeke commented May 2, 2018

Thanks for taking the time to write this.

A few questions:

The default UX is nothing, it just fires an event

By this do you mean nothing happens unless the app developer creates an event handler that then calls autoUpdater.quitAndInstall() at a convenient time?

If so, what would a good recommend default handler look like? Something like this?

require('update-electron-app')()
  .on('update-downloaded', updateOnQuit)
  
function updateOnQuit () {
  app.on('will-quit', () => {
    autoUpdater.quitAndInstall()
  })
}

@MarshallOfSound
Copy link
Member

If so, what would a good recommend default handler look like? Something like this?

You don't need a default handler, quitAndInstaller is effectively the same as restarting the app manually by quitting and relaunching. This means that by default the update is downloaded and staged. Then when the user next launches the app it will be the up-to-date version 🤔 afaik

@zeke
Copy link
Contributor

zeke commented May 2, 2018

@MarshallOfSound are you saying that a successfully downloaded update will be applied automatically no matter what when the app restarts? The documentation on this is sparse, so whatever mysteries we uncover here should be upstreamed into the docs on electron/electron

@MarshallOfSound
Copy link
Member

MarshallOfSound commented May 2, 2018

are you saying that a successfully downloaded update will be applied automatically no matter what when the app restarts

Yes on windows, I'm not 100% sure what happens on macOS

Yes on macOS as well, just tested it 👍

@zeke
Copy link
Contributor

zeke commented May 2, 2018

Opened electron/electron#12783. Had I known this was the default behavior, I probably would not have implemented the dialog in this module! cc @leo

@joshuapinter
Copy link

Was a public method (as an init param) ever provided to handle when an update is available?

@hichemfantar
Copy link

i created a proposal to improve the api to allow for more control over the update process at #164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Meta discussion
Projects
None yet
Development

No branches or pull requests

6 participants