Skip to content

Conversation

@ykogan-discord
Copy link

Calling set_icon and then set_icon_as_template in sequence cause a flicker as they both run on the main thread and update the UI. This exposes a single function to do both at once, preventing the flicker.

@ykogan-discord ykogan-discord requested a review from a team as a code owner October 23, 2025 18:14
@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Oct 23, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

Package Changes Through aa49486

There are 1 changes which include tauri with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tauri 2.9.1 2.9.2

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@ykogan-discord
Copy link
Author

Thanks for the PR! Would you also be interested in adding the corresponding JS api? Would require changes in https://github.com/ykogan-discord/tauri/blob/yonatron/set-icon-and-template-at-same-time/crates/tauri/src/tray/plugin.rs and https://github.com/ykogan-discord/tauri/blob/yonatron/set-icon-and-template-at-same-time/packages/api/src/tray.ts i think

Heyo! Yes happy to do this. Unsure of my exact timing but I'll try to get it done sooner than later.

@ykogan-discord
Copy link
Author

Thanks for the PR! Would you also be interested in adding the corresponding JS api? Would require changes in https://github.com/ykogan-discord/tauri/blob/yonatron/set-icon-and-template-at-same-time/crates/tauri/src/tray/plugin.rs and https://github.com/ykogan-discord/tauri/blob/yonatron/set-icon-and-template-at-same-time/packages/api/src/tray.ts i think

Okay, I made these changes just via pattern matching but I am unsure how to test them. I'm also getting a failure in a snapshot test, which is instructing me to run cargo insta review but cargo insta doesn't exist. Do I need to install it globally?

Apologies, a bit of a rust noob.

@FabianLars
Copy link
Member

yeah testing is a bit manual at the moment, at least for the js api, so we typically just use the example app.

i usually just ignore the snapshot stuff tbh x)

@ykogan-discord
Copy link
Author

Okay turns out I needed to change one more file to expose the method in the plugin but I tested this and it's working!

Calling set_icon and then set_icon_as_template in sequence
cause a flicker as they both run on the main thread and update
the UI. This exposes a single function to do both at once,
preventing the flicker.
@ykogan-discord ykogan-discord force-pushed the yonatron/set-icon-and-template-at-same-time branch from 2874632 to 7a4044b Compare October 24, 2025 15:23
@FabianLars FabianLars added this to the 2.10 milestone Oct 25, 2025
@ykogan-discord
Copy link
Author

@FabianLars anything else you need from me here or do you do the merge?

@FabianLars
Copy link
Member

Ah no sorry, you're good! Just waiting for the merge window (which we didn't define yet)

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

Labels

None yet

2 participants