-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[V3] Restore hidden menuitem at correct position #4246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[V3] Restore hidden menuitem at correct position #4246
Conversation
WalkthroughThis pull request updates the changelog to clarify and attribute a previous fix, enhances the menu example by adding new interactive menu items for requesting coffee and toggling their state and visibility, and refactors the internal logic for hiding and showing menu items on Windows. The refactor removes the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Menu
participant MenuItem
User->>Menu: Clicks "Hide the coffee option"
Menu->>MenuItem: setHidden(true)
MenuItem-->>Menu: Updates visibility
User->>Menu: Clicks "Unhide the coffee option"
Menu->>MenuItem: setHidden(false)
MenuItem->>Menu: Calculates correct position among visible items
MenuItem-->>Menu: Re-inserts at correct position
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code Graph Analysis (1)v3/pkg/application/menuitem_windows.go (3)
🪛 LanguageTooldocs/src/content/docs/changelog.mdx[style] ~127-~127: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE) 🔇 Additional comments (4)
✨ Finishing Touches
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:
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
|
You legend! This was on my blockers list 🚀 |
Description
Currently, when a menuitem is hidden and then shown again, it is not restored to its correct original position.
This issue becomes worse when multiple items are hidden, as the relative ordering becomes completely incorrect.
Instead of using a stale
itemAfter
pointer, this patch dynamically recalculates the menuitem's correct position based on the currentm.parent.items
slice at the time of reinsertion.Fixes #4236
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.
Checklist:
website/src/pages/changelog.mdx
with details of this PRSummary by CodeRabbit
New Features
Documentation
Refactor