Fixed example for macOS menu#3847
Conversation
|
Warning Rate limit exceeded@takuyahara has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 26 minutes and 43 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. WalkthroughThe changes in this pull request involve modifications to the example code for creating application menus in Wails projects. A conditional check for macOS is introduced to ensure the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
website/docs/reference/menus.mdx (3)
22-24: Good improvement to the "Open" menu item example.The use of an inline function for the "Open" action is a good practice. It provides a clear structure for adding custom logic.
Consider enhancing the comment to be more specific:
- // do something + // Add your file opening logic hereThis would provide clearer guidance for developers implementing this menu item.
27-28: Good clarification on thertalias usage.The added comment explains the purpose of the
rtalias, which is helpful for code clarity. Using an alias is a good practice to avoid potential naming conflicts.For consistency with the previous menu item:
- rt.Quit(app.ctx) + rt.Quit(app.ctx) // Quit the applicationThis would maintain a consistent style of adding brief comments for each action.
31-33: Crucial addition for macOS Edit menu functionality.This change correctly implements the macOS-specific requirement of appending the EditMenu. The comment clearly explains the purpose, which is essential for enabling standard macOS shortcuts.
To further improve clarity:
- AppMenu.Append(menu.EditMenu()) // On macOS platform, EditMenu should be appended to enable Cmd+C, Cmd+V, Cmd+Z... shortcuts + AppMenu.Append(menu.EditMenu()) // On macOS, append EditMenu to enable standard shortcuts (Cmd+C, Cmd+V, Cmd+Z, etc.)This slight rewording makes the comment more concise while maintaining its informative nature.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- website/docs/reference/menus.mdx (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
website/docs/reference/menus.mdx (2)
18-20: Excellent addition for macOS-specific menu setup!This change correctly addresses the macOS-specific requirement of appending the AppMenu immediately after creation. The added comment provides clear guidance for developers, which is crucial for proper menu functionality on macOS.
18-33: Overall, excellent improvements to the macOS menu example!These changes successfully address the PR objectives by correctly demonstrating the macOS-specific menu setup. The additions and modifications provide clear, accurate guidance for developers implementing menus in Wails projects, especially for macOS.
Key improvements:
- Correct ordering of AppMenu and EditMenu appending for macOS.
- Clear comments explaining macOS-specific requirements.
- Enhanced example of menu item action implementation.
These changes significantly enhance the quality and accuracy of the documentation.
|
Thanks 🙏 Please could you add an entry to the changelog located at |
|
|
@leaanthony Done 👍 |
|
Thanks 🙏 |



Description
Example in menus is not correctly written. This PR corrects code for macOS to add menus properly.
Writing
AppMenu.Append()twice and separately looks weird but this do matters to menus be added inFileEditorder. For instance, the following code results menus to be added inEditFileorder.Summary by CodeRabbit
New Features
Documentation