-
Notifications
You must be signed in to change notification settings - Fork 391
feat(rust/gui-client): add "update ready" notification dot to the tray icon using a runtime compositor #6432
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
thomaseizinger
left a comment
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 guess the advantage of runtime compositing is that our code is easier to write because "update available" can be coded as "take the current icon and add the dot to it" instead of matching on the current state and figuring out what the next state composed with the icon is?
That is the main thing I'd probably be focusing on when making a decision: Where do you want to set the icons and what is the most ergonomic way to write that code.
| )?; | ||
| assert!( | ||
| start_instant.elapsed().as_millis() < 6, | ||
| "Should be able to compose all 6 icons in 1 ms each" |
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 wouldn't be surprised if the majority of time here is spent on FS access.
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.
Yeah. If it slows down I can dig in and profile it, I just wanted to make sure all those per-pixel powf operations weren't hurting anything.
jamilbk
left a comment
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.
Looks nice! I think macOS will also need similar treatment, but before that #6304 should be implemented probably.
|
I'm biased towards runtime compositing because the compositor was fun to write, but if everyone's fine, I'll go ahead with it. The big advantage I see is that there are no files that can become out-of-date. With build-time compositing we have to write similar code but also tie it into the build system. With design-time compositing we have to duplicate a bunch of stuff in Figma and make humans do the computer's work. With runtime it costs a couple milliseconds of CPU work but it's always correct. |
That would be easy to do with
I am fine with whatever really. I'd also take into account the developer ergonomics when using the icons:
|
|
For now I'm always replacing the icon completely. There's only 6 possible composed results, and only a couple layers, so the GUI always knows all the inputs. I integrated it into the code and removed all the debug scaffolding |
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.
Spaces in filenames? 😱
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.
Figma seems to put out whatever you type as the frame name. I could name the object busy-layer I guess?
| IconBase::Busy => &[LOGO_GREY_BASE, BUSY_LAYER][..], | ||
| IconBase::SignedIn => &[LOGO_BASE][..], | ||
| IconBase::SignedOut => &[LOGO_GREY_BASE, SIGNED_OUT_LAYER][..], |
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.
| IconBase::Busy => &[LOGO_GREY_BASE, BUSY_LAYER][..], | |
| IconBase::SignedIn => &[LOGO_BASE][..], | |
| IconBase::SignedOut => &[LOGO_GREY_BASE, SIGNED_OUT_LAYER][..], | |
| IconBase::Busy => [LOGO_GREY_BASE, BUSY_LAYER], | |
| IconBase::SignedIn => [LOGO_BASE, &[]], | |
| IconBase::SignedOut => [LOGO_GREY_BASE, SIGNED_OUT_LAYER], |
Out of curiosity, would this work too?
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.
Yeah. I could make a special case in the compositor that a blank byte string is just skipped.
|
Maybe we won't need the option to ignore updates if we use a less intrusive update notification, like this notification dot for the daily check? Just thinking about how not to annoy users, will probably think through some more edge cases for #6304 et al |
|
@jamilbk Option to ignore updates? |
Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Also adds a "Download update" button in the bottom section of the tray menu when an update is ready.