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

File associations #4957

Merged
merged 10 commits into from
Jul 2, 2024
Merged

File associations #4957

merged 10 commits into from
Jul 2, 2024

Conversation

zhelenskiy
Copy link
Member

@zhelenskiy zhelenskiy commented Jun 11, 2024

Add file associations support to Compose Desktop

Fixes #773

Testing

Tested on the sample project.
Behaviours per OSs:

  • MacOS Sonoma: associations work for distributables.
  • Windows 11: associations work after the installation of the MSI.
  • Kubuntu: associations do not work, but everything else works fine. However, IDEA also does not have associations there, so I assume this is fine.

I didn't write any unit tests because I don’t know which of them you are expecting me to write. So, I'm looking forward to your feedback and suggestions.

This should be tested by QA

Release Notes

Highlight - Desktop

  • Introduction of the new DSL function in nativeDistributions block:
    fun fileAssociation(mimeType: String, extension: String, description: String): Unit

[Desktop: Add support for file associations](JetBrains#773)
@igordmn igordmn self-requested a review June 12, 2024 00:44
[Desktop: Add support for file associations](JetBrains#773)
@igordmn
Copy link
Collaborator

igordmn commented Jun 19, 2024

@terrakok, could you also review the new API in this PR? I am also reviewing it and the implementation.

@igordmn igordmn requested a review from terrakok June 19, 2024 10:30
Copy link
Collaborator

@igordmn igordmn left a comment

Choose a reason for hiding this comment

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

Thanks!

A few changes needed, an API review from @terrakok, and it is good to merge.

[Desktop: Add support for file associations](JetBrains#773)
[Desktop: Add support for file associations](JetBrains#773)
[Desktop: Add support for file associations](JetBrains#773)
@zhelenskiy
Copy link
Member Author

zhelenskiy commented Jun 21, 2024

Except for DSL test and docs, everything else is fixed. Can you close the comment, @terrakok? It is not closable.

What do you think about the API? It supports:

  • Ability to make platform-specific file associations.
  • Ability to make platform-independent associations without copying.
  • Ability to provide or not an icon.
  • For platform-specific association icons you need to specify only one property iconFile while for universal you need to specify windowsIconFile, etc.

The demo project is also updated according to the new API.

PS. This version is only tested on MacOS for now. I'll check the rest a bit later.

Copy link
Collaborator

@igordmn igordmn left a comment

Choose a reason for hiding this comment

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

Looks good to me after resolving 2 my open comments.

The end review and merging I delegate to @terrakok.

[Desktop: Add support for file associations](JetBrains#773)
@zhelenskiy
Copy link
Member Author

zhelenskiy commented Jun 22, 2024

I had to change resource name generation to make it stable for testing.

@zhelenskiy
Copy link
Member Author

I tested the current version on Windows, MacOS, Ubuntu, Kubuntu. On Windows, MacOS everything is ok, while on both Linux distributives there are problems (in Kubuntu there is no icon, in Ubuntu, association doesn't work), but the same thing is with idea as well.

@zhelenskiy zhelenskiy requested a review from terrakok June 22, 2024 17:46
[Desktop: Add support for file associations](JetBrains#773)
@zhelenskiy
Copy link
Member Author

Everything seems fixed now.

Copy link
Member

@terrakok terrakok left a comment

Choose a reason for hiding this comment

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

val fileAssociationFiles = fileAssociations.orNull.orEmpty()

do we need it iyet?

[Desktop: Add support for file associations](JetBrains#773)
[Desktop: Add support for file associations](JetBrains#773)
@igordmn
Copy link
Collaborator

igordmn commented Jul 1, 2024

Looks good to me, thanks!

@terrakok, please merge, if everything is okay to you too.

zhelenskiy added a commit to zhelenskiy/compose-multiplatform that referenced this pull request Jul 1, 2024
@terrakok terrakok merged commit dea37a0 into JetBrains:master Jul 2, 2024
12 checks passed
igordmn pushed a commit that referenced this pull request Jul 2, 2024
Docs for file associations support
(#4957) which
fixes #773.

---------

Co-authored-by: Aleksey Zamulla <[email protected]>
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.

Desktop: Add support for file associations
3 participants