hyperamp icon indicating copy to clipboard operation
hyperamp copied to clipboard

Add latest release date to "About Hyperamp"

Open ungoldman opened this issue 5 years ago • 7 comments

Would be nice to have date of latest release next to version number in the "About Hyperamp" popup.

screen shot 2018-11-30 at 9 17 57 am

Shouldn't be too hard to add, I think..

Now that I'm looking at it, the Copyright next to © is a little redundant too

ungoldman avatar Nov 30 '18 17:11 ungoldman

Agreed.

bcomnes avatar Nov 30 '18 18:11 bcomnes

@bcomnes would love to have a try at this. Will probably need some guidance with some Electron stuff and general implementation details, if that's okay 😅

achou11 avatar Jul 11 '19 03:07 achou11

@achou11 go for it! Feel free to drop ideas if you want feedback before you sink much work into it as well. I can't remember off the top of my head where this is set.

bcomnes avatar Jul 11 '19 08:07 bcomnes

Great! Here are some thoughts that I have:

I know that for macOS, the information displayed in the About panel is derived from the Info.plist for the built app (assuming something similar for Linux). However, Electron provides a method on app called setAboutPanelOptions, so this would be a pretty good thing to use if you want to introduce minimal changes. It'll allow us to simply edit the version info and copyright text. Drawback is that it's only for macOS and Linux, so not sure if that's a dealbreaker.

In order to get the release date, I'm thinking of using the electron-updater's updateInfo interface and then creating a new store via electron-store to persist that information for the next time the user starts the app. General idea of the flow:

  1. User starts the app and the release info from the new store is used to determine the information in the About panel. If no release date is available (e.g. first time opening after this change is released), I guess omit the release date from the About panel and fallback to the default for that line?
  2. The autoupdater checks for an update and if one is available, it's downloaded.
  3. After downloading, we extract the release date info from it and save/update it in the store.
  4. The next time the user restarts the app, this process should go back to step 1.

Some lingering questions and drawbacks to this implementation:

  • As mentioned in step 1, the first time the user starts the app after the changes for this are released is a little awkward. We wouldn't have the release date on init (unless we hard code it?), so that info would have to be excluded.
  • This method only works for macOS and Linux. Have very little experience with how Windows works unfortunately, so this solution may not cover enough ground.
  • I have pretty limited experience with debugging electron-updater and I don't think I can test that very easily locally, since I can't code-sign the app when building (correct me if I'm wrong @bcomnes ). I have a theoretical idea of how to get that release date info using the autoupdater object, it's just a little tricky to test if it actually works. Would love some pointers for this!
  • Should I create a new store or use an existing store? The existing ones didn't seem like a good place to add a releaseDate field. More generally, is using a store a good idea for this?

Also noticed that electron-about-window exists, which would be more flexible and cover all platforms. Haven't taken a good look into how it works at all, but that's also a viable solution.

achou11 avatar Jul 13 '19 16:07 achou11

With a somewhat rough implementation of the above, here's how it looks on macOS with the local dev setup (the release date is mocked for now):

rough_about_panel_macos

achou11 avatar Jul 13 '19 16:07 achou11

Thanks for figuring this out @achou11! This looks acceptable to me. Finding a way to automate the release date is trickier. I wonder if electron (or the update metadata for the package.json file?) would provide us something to derive date info to avoid having to do something manual.

ungoldman avatar Jul 13 '19 21:07 ungoldman

We could also bake in info into the repo on ‘version’ npm hook.

bcomnes avatar Jul 14 '19 15:07 bcomnes