Skip to content

feat: Add support for setting icon & template at same time#14357

Merged
lucasfernog merged 4 commits into
tauri-apps:devfrom
ykogan-discord:yonatron/set-icon-and-template-at-same-time
Apr 29, 2026
Merged

feat: Add support for setting icon & template at same time#14357
lucasfernog merged 4 commits into
tauri-apps:devfrom
ykogan-discord:yonatron/set-icon-and-template-at-same-time

Conversation

@ykogan-discord

Copy link
Copy Markdown
Contributor

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
@FabianLars

Copy link
Copy Markdown
Member

@github-actions

github-actions Bot commented Oct 23, 2025

Copy link
Copy Markdown
Contributor

Package Changes Through 6255b92

There are 11 changes which include tauri with minor, @tauri-apps/api with minor, tauri-build with minor, tauri-macos-sign with patch, tauri-bundler with minor, @tauri-apps/cli with minor, tauri-cli with minor, tauri-runtime with minor, tauri-runtime-wry with minor, tauri-utils with minor, tauri-plugin with minor

Planned Package Versions

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

package current next
@tauri-apps/api 2.10.1 2.11.0
tauri-utils 2.8.3 2.9.0
tauri-macos-sign 2.3.3 2.3.4
tauri-bundler 2.8.1 2.9.0
tauri-runtime 2.10.1 2.11.0
tauri-runtime-wry 2.10.1 2.11.0
tauri-codegen 2.5.5 2.5.6
tauri-macros 2.5.5 2.5.6
tauri-plugin 2.5.4 2.6.0
tauri-build 2.5.6 2.6.0
tauri 2.10.3 2.11.0
@tauri-apps/cli 2.10.1 2.11.0
tauri-cli 2.10.1 2.11.0

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
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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
Copy Markdown
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)

Comment thread crates/tauri/src/tray/mod.rs Outdated
@ykogan-discord

Copy link
Copy Markdown
Contributor 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
Copy Markdown
Contributor Author

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

@FabianLars

Copy link
Copy Markdown
Member

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

@andrewhamon

Copy link
Copy Markdown

Just waiting for the merge window (which we didn't define yet)

Friendly bump on this. I'm a colleague of Yonatan and would love to stop carrying this as a patch :)

@FabianLars

Copy link
Copy Markdown
Member

still waiting for that 2.10 merge window. i highly doubt it'll be before or during the holidays.

@andrewhamon

Copy link
Copy Markdown

@FabianLars it seems like 2.10 has come and gone :/

FabianLars
FabianLars previously approved these changes Apr 20, 2026

@lucasfernog lucasfernog left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

well done

@lucasfernog lucasfernog merged commit a12142a into tauri-apps:dev Apr 29, 2026
24 checks passed
razein97 pushed a commit to razein97/tauri that referenced this pull request Apr 30, 2026
…s#14357)

* [macos] Add support for setting icon & template at same time

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.

* Format

* Update changed.md

---------

Co-authored-by: Fabian-Lars <30730186+FabianLars@users.noreply.github.com>
razein97 pushed a commit to razein97/tauri that referenced this pull request Apr 30, 2026
…s#14357)

* [macos] Add support for setting icon & template at same time

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.

* Format

* Update changed.md

---------

Co-authored-by: Fabian-Lars <30730186+FabianLars@users.noreply.github.com>
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.

4 participants