[v2] docs(menu): add imports and complete the example - #4727
Conversation
- the example was missing imports, which [confused a user](https://stackoverflow.com/q/79827619/3431180), particularly due to the `rt` import alias - plus there are a good number of imports too, which this makes explicit - it also didn't mention that it built on top of the `NewApp` / `app.go` scaffold, so mention and link to that as well - it wasn't clear where `NewApp` came from without that - give this file the title `menu.go` for clarity / explicitness - also handle the error at the end similar to [existing examples](https://github.com/wailsapp/wails/blob/4c464b3092fff35b993f31ca62ca612399dde970/website/docs/guides/application-development.mdx?plain=1#L54)
|
Warning Rate limit exceeded@leaanthony has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 55 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughUpdates the menu creation guide documentation to include a complete, runnable Go example using the NewApp scaffold with full imports, main function, and error handling after wails.Run. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
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. Comment |
12506e5 to
de5c707
Compare
|
| "github.com/wailsapp/wails/v2/pkg/menu/keys" | ||
| "github.com/wailsapp/wails/v2/pkg/options" | ||
| rt "github.com/wailsapp/wails/v2/pkg/runtime" | ||
| ) |
There was a problem hiding this comment.
@leaanthony not sure if this was intentional, but all the imports (and the error check at the end) were removed in this merge commit, which undoes the bulk of the changes in this PR
|
@leaanthony I think you missed my review comment above regarding what looked like an accidental merge conflict resolution that removed a large chunk of the code? I added that back in another PR: #4742 Also totally feel free to ask me to resolve any merge conflicts in my changes if you're not sure! In this case, this PR changed lines above and below those of #4726 so |



Description
rtimport alias (c.f. Fixed example for macOS menu #3847, annotated menu example and updated runtime.Quit call #2539, Menu doc appears out of date #2540)NewApp/app.goscaffold, so mention and link to that as wellNewAppcame from without thatmenu.gofor clarity / explicitnessRelated to #4726
Fixes #NA
Type of change
This is a docs improvement / patch
How Has This Been Tested?
Tested on the Go Playground: https://go.dev/play/p/tcWdPSMRCji
Test Configuration
Go Playground. Also this is a docs-only change
Checklist:
website/src/pages/changelog.mdxwith details of this PRSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.