Skip to content
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 Darwin] Fix NewEditMenu, remove duplicate PasteAndMatchStyle item #3839

Conversation

johnmccabe
Copy link

@johnmccabe johnmccabe commented Oct 18, 2024

Description

What looks to be a simple copy paste error in the V3 application.NewEditMenu() function where the PasteAndMatchStyle role in the Edit menu has been duplicated. Noticed when running the V3 examples and having ported a personal app across.

Given the trivial nature of the change I've skipped the issue creation, can swing back and create if you wish.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Running the V3 binding example before and after the change to confirm the presence and then absence of the duplicated menu item. Change is within a darwin only conditional so I've skipped Windows and Linux validation.

  • Windows
  • macOS
  • Linux

Test Configuration

Freshly checked out v3-alpha branch on MacOS 14.7, Go 1.23.2.

Checklist:

  • I have updated website/src/pages/changelog.mdx with details of this PR. I skipped this as there doesn't seem to be any other entries for V3 prior to its release.
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation. Change does not warrant a documentation change
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • Bug Fixes

    • Simplified the handling of the 'Paste and Match Style' role in the edit menu for macOS, enhancing menu consistency.
    • Fixed the AlwaysOnTop functionality on macOS.
    • Resolved issues with custom event processing in drag-and-drop examples and Linux compile errors.
    • Addressed syso icon file generation bugs on Windows.
  • New Features

    • Introduced a new DIP system for Enhanced High DPI Monitor Support on Windows.
    • Expanded services for plugin functionality.
    • Updated Events API for improved user event handling.

These changes improve the user experience by ensuring a more streamlined menu interface on macOS and enhancing support across various platforms.

Copy link
Contributor

coderabbitai bot commented Oct 18, 2024

Walkthrough

The changes involve the roles.go file within the application package, specifically modifying the handling of the PasteAndMatchStyle role in the menu creation logic. The line responsible for adding this role in the macOS-specific section has been removed, simplifying the conditional structure. The overall functionality and structure of the menu creation functions remain unchanged, with no modifications to their signatures or return types. Additionally, the changelog has been updated to reflect various changes, fixes, and new features across multiple versions of the project.

Changes

File Path Change Summary
v3/pkg/application/roles.go Removed editMenu.AddRole(PasteAndMatchStyle) from the macOS-specific section.
mkdocs-website/docs/en/changelog.md Updated changelog to reflect changes, fixes, and new features across versions, including refactor of Taskfile, upgrades, and various bug fixes.

Possibly related PRs

  • [V3] fix drag n drop example not running #3742: This PR addresses a bug in the drag-and-drop example, which may relate to the handling of menu items and roles, similar to the changes made in the main PR regarding the PasteAndMatchStyle role in the edit menu.
  • Allow to specify macos-min-version externally #3756: This PR introduces a feature to specify the minimum macOS version externally, which could be relevant to the changes in the roles.go file that also pertain to macOS-specific functionality.
  • [mac] fix always on top during window creation #3841: This PR fixes the AlwaysOnTop feature during window creation, which is directly related to the handling of window properties in the application, similar to the changes made in the main PR regarding menu roles on macOS.

Suggested reviewers

  • leaanthony

Poem

In the code where rabbits play,
A role was changed, hip-hip-hooray!
The macOS path, now simplified,
With menus bright, our joy can't hide.
Hop along, let changes ring,
In the code, we dance and sing! 🐇✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 43320ac and 2f4d6e4.

📒 Files selected for processing (1)
  • mkdocs-website/docs/en/changelog.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • mkdocs-website/docs/en/changelog.md

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@leaanthony
Copy link
Member

Thanks 🙏 Please could you add an entry to the changelog located at mkdocs-website/docs/changelog.md? Thanks!

johnmccabe added a commit to johnmccabe/wails that referenced this pull request Oct 20, 2024
johnmccabe added a commit to johnmccabe/wails that referenced this pull request Oct 20, 2024
@johnmccabe johnmccabe force-pushed the v3-alpha-bugfix/duplicate-darwin-edit-menuitem branch from 44cf52f to 43320ac Compare October 20, 2024 12:39
@johnmccabe
Copy link
Author

@leaanthony done. I used the single line for each change format as used in the rest of the doc, and updated the other fix entry to match.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
mkdocs-website/docs/en/changelog.md (1)

26-27: LGTM! Consider a minor improvement.

The new changelog entries are well-formatted and provide clear information about the fixes. They align with the project's changelog structure and properly credit the contributors.

The entry on line 27 accurately reflects the PR objective of removing the duplicate PasteAndMatchStyle item from the Edit menu on Darwin systems.

Consider changing "Daemin" to "Darwin" on line 27 to correct the typo:

-- [darwin]  Fixed `application.NewEditMenu` including a duplicate `PasteAndMatchStyle` role in the edit menu on Daemin by [johnmccabe](https://github.com/johnmccabe) in [#3839](https://github.com/wailsapp/wails/pull/3839)
++ [darwin]  Fixed `application.NewEditMenu` including a duplicate `PasteAndMatchStyle` role in the edit menu on Darwin by [johnmccabe](https://github.com/johnmccabe) in [#3839](https://github.com/wailsapp/wails/pull/3839)
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 9d1a4eb and 43320ac.

📒 Files selected for processing (1)
  • mkdocs-website/docs/en/changelog.md (1 hunks)
🧰 Additional context used

@johnmccabe johnmccabe changed the title [V3 Darwin] Fix NewEditMenu, remove duplicate PasteAndMatchStyle item [v3 Darwin] Fix NewEditMenu, remove duplicate PasteAndMatchStyle item Oct 20, 2024
@johnmccabe johnmccabe force-pushed the v3-alpha-bugfix/duplicate-darwin-edit-menuitem branch from 43320ac to 2f4d6e4 Compare October 20, 2024 12:45
@johnmccabe
Copy link
Author

Fixed typo flagged by CodeRabbitAI and repushed the commit

Copy link

@leaanthony leaanthony merged commit 4325b06 into wailsapp:v3-alpha Oct 20, 2024
12 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Nov 6, 2024
@coderabbitai coderabbitai bot mentioned this pull request Nov 22, 2024
15 tasks
@coderabbitai coderabbitai bot mentioned this pull request Dec 6, 2024
12 tasks
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.

2 participants