[V3] Update systray.mdx example#4307
Conversation
GUI operations must run on the main thread I guess? this example calling systray.Run() from a non-main thread context and it will panic.
WalkthroughThe documentation for creating and running a system tray application was updated to use Changes
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
docs/src/content/docs/learn/systray.mdx (2)
21-21: Ensure error handling aroundapp.Run().
Switching fromsystray.Run()toapp.Run()correctly starts the Wails application on the main thread. For production readiness, consider capturing and handling the returned error to avoid silent failures:if err := app.Run(); err != nil { log.Fatal(err) }
136-136: Add error checking to application startup.
In the complete example,app.Run()should similarly be wrapped to surface any initialization errors. For example:if err := app.Run(); err != nil { log.Fatal(err) }
OnClick function takes *application.Context. the example if not complete
|
|
Ah thank you!! 🙏 |



GUI operations must run on the main thread I guess? this example calling
systray.Run()from a non-main thread context and it will panic.Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please select the option that is relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using
wails doctor.If you checked Linux, please specify the distro and version.
Test Configuration
Please paste the output of
wails doctor. If you are unable to run this command, please describe your environment in as much detail as possible.Checklist:
website/src/pages/changelog.mdxwith details of this PRSummary by CodeRabbit
app.Run()instead ofsystray.Run()for starting system tray applications.