-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] Support for File-Associations on macOS #4177
[v3] Support for File-Associations on macOS #4177
Conversation
WalkthroughThis pull request adds support for file associations on macOS. It updates the changelog and documentation with a new entry and guide instructions, adds a new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant BuildProcess
participant ConfigLoader
participant PlistBuilder
User->>BuildProcess: Initiate build
BuildProcess->>ConfigLoader: Load file associations config
ConfigLoader-->>BuildProcess: Return file associations (including mimeType)
BuildProcess->>PlistBuilder: Generate Info.plist with file association block
PlistBuilder-->>BuildProcess: Return updated plist with CFBundleDocumentTypes
BuildProcess-->>User: Build output with macOS file associations support
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ 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
|
|
There was a problem hiding this 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
🧹 Nitpick comments (3)
docs/src/content/docs/guides/file-associations.mdx (1)
109-110
: Helpful macOS-specific instructionGood addition of macOS-specific instructions for document icons. Consider adding a note about where to create or obtain the
documenticon.icns
file for new users.v3/internal/commands/updatable_build_assets/darwin/Info.plist.tmpl (1)
26-48
: Well-implemented file association support for macOSThe new conditional block correctly implements file associations for macOS applications following Apple's standards for Info.plist configuration. The structure properly handles:
- Conditional inclusion based on presence of file associations
- Multiple file type registration through template iteration
- Optional MIME type specification
Consider adding support for
LSHandlerRank
to give applications more control over their priority when handling specific file types. This is useful when multiple applications can handle the same file type. Example implementation:{{- if .MimeType}} <key>CFBundleTypeMimeType</key> <string>{{.MimeType}}</string> {{- end}} + {{- if .HandlerRank}} + <key>LSHandlerRank</key> + <string>{{.HandlerRank}}</string> + {{- end}}v3/internal/commands/updatable_build_assets/darwin/Info.dev.plist.tmpl (1)
26-48
: Well-implemented file association support for macOS development environmentThe new conditional block correctly implements file associations for macOS applications in the development environment. The implementation maintains consistency with the production plist template while correctly preserving the development-specific network security settings.
For consistency with the production template, consider adding support for
LSHandlerRank
to give applications more control over their priority when handling specific file types:{{- if .MimeType}} <key>CFBundleTypeMimeType</key> <string>{{.MimeType}}</string> {{- end}} + {{- if .HandlerRank}} + <key>LSHandlerRank</key> + <string>{{.HandlerRank}}</string> + {{- end}}
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
docs/src/content/docs/changelog.mdx
(1 hunks)docs/src/content/docs/guides/file-associations.mdx
(2 hunks)v3/internal/commands/build-assets.go
(2 hunks)v3/internal/commands/build_assets/config.yml
(1 hunks)v3/internal/commands/updatable_build_assets/darwin/Info.dev.plist.tmpl
(1 hunks)v3/internal/commands/updatable_build_assets/darwin/Info.plist.tmpl
(1 hunks)
🔇 Additional comments (7)
v3/internal/commands/build_assets/config.yml (1)
59-59
: Good addition of the optional MIME type fieldThis addition properly documents the new
mimeType
optional field for file associations, providing a clear example withimage/jpeg
. The comment clarifying it's optional is helpful for users.docs/src/content/docs/changelog.mdx (1)
79-79
: Well-formatted changelog entryThe changelog entry for macOS file association support is correctly formatted with the macOS icon prefix and includes proper attribution to the contributor with a link to the PR.
docs/src/content/docs/guides/file-associations.mdx (1)
65-65
: Good documentation for the new MIME type propertyClear and concise documentation of the new
mimeType
property in the configuration properties table, with a practical example and platform specification.v3/internal/commands/build-assets.go (2)
13-15
: Clean import organizationThe reordering of imports improves code readability by grouping standard library imports separately from third-party imports.
125-125
: Core implementation of MIME type supportThe addition of the
MimeType
field to theFileAssociation
struct is well-implemented with the proper YAML tag. This change enables storing and processing MIME type information from the configuration files.v3/internal/commands/updatable_build_assets/darwin/Info.plist.tmpl (1)
5-25
: Improved indentation enhances readabilityThe indentation changes make the XML structure more readable while preserving the original functionality.
v3/internal/commands/updatable_build_assets/darwin/Info.dev.plist.tmpl (1)
5-25
: Improved indentation enhances readabilityThe indentation changes make the XML structure more readable while preserving the original functionality.
Thanks so much! 🙏 |
Description
Added support for file associations in macOS applications. This feature is supported by wails v2, so this PR is a port of the feature to wails v3. The groundwork has already been done, so this PR is very small. If necessary, it could also be classified as a bug fix, since the feature was already working for Windows and is documented in the docs.
Also added the ability to specify the mime type on macOS.
Fixes #4176
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.mdx
with details of this PRSummary by CodeRabbit
New Features
Documentation