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

Add ability to open links in Thunder from Safari extension #905

Merged
merged 6 commits into from
Dec 5, 2023

Conversation

hjiangsu
Copy link
Member

@hjiangsu hjiangsu commented Nov 21, 2023

Pull Request Description

This PR adds the ability to open Thunder using a Safari extension. Note that this is slightly different that #868. #868 allows for sharing and opening links in Thunder, whereas this is specifically used to open links via Thunder. Safari extensions are only available in iOS 15 and later, whereas the share extension from #868 can be used in older versions of iOS.

With the Safari extension, Safari will prompt the user whether they would like to open a Lemmy link through Thunder. As of right now, the list of Lemmy instances is static. However, we could add in a GitHub workflow which updates the list whenever we update the list of instances.

This is still in draft as the following is still required:

  • Update placeholder icons with Thunder icons
  • Additional testing with instance, post, and comment links

While working on this, I've noticed that there are cases where the resolve_object does not return back properly. This seems to be an existing issue, not one that was introduced with this change.

Issue Being Fixed

Issue Number: N/A

Screenshots / Recordings

Checklist

  • Did you update CHANGELOG.md?
  • Did you use localized strings where applicable?
  • Did you add semanticLabels where applicable for accessibility?

@micahmo
Copy link
Member

micahmo commented Nov 22, 2023

I've noticed that there are cases where the resolve_object does not return back properly.

It will fail for things that are not federated. If it's failing for things that are, then I'm not sure. 😊

@hjiangsu hjiangsu marked this pull request as ready for review December 5, 2023 02:26
Copy link
Member

@micahmo micahmo left a comment

Choose a reason for hiding this comment

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

I don't have any way to test this, but the code looks good! Would love to se a demo!

ios/Open In Thunder/Resources/content.js Show resolved Hide resolved
ios/Open In Thunder/Resources/manifest.json Outdated Show resolved Hide resolved
@hjiangsu
Copy link
Member Author

hjiangsu commented Dec 5, 2023

@micahmo I added 38ba707 which adds the GitHub action to update the instances! I'm not entirely sure if it'll work properly since I don't know how to run GitHub actions locally, but I tested it through the command line and it seems to be okay.

Could you take a quick look over it and see if it all makes sense? Thanks!

@micahmo
Copy link
Member

micahmo commented Dec 5, 2023

Could you take a quick look over it and see if it all makes sense? Thanks!

Yeah it seems reasonable to me! Worst case, the PR that the workflow opens will be bad and we'll just have to tweak it from there. 😊

@hjiangsu
Copy link
Member Author

hjiangsu commented Dec 5, 2023

Sounds good, I'll go ahead and merge it in!

@hjiangsu hjiangsu merged commit 47ef0bd into develop Dec 5, 2023
1 check passed
@hjiangsu hjiangsu deleted the feature/open-in-ios branch December 5, 2023 18:15
@hjiangsu
Copy link
Member Author

hjiangsu commented Dec 5, 2023

Hmm, it seems like it's writing the new line character instead of treating it as a new line:

https://github.com/thunder-app/thunder/pull/923/files

@micahmo
Copy link
Member

micahmo commented Dec 5, 2023

Hmm, it seems like it's writing the new line character instead of treating it as a new line:

Hmm, interesting. Maybe it needs to be escaped or something. Needs some more experimentation. If you want, we can add a workflow_dispatch to the workflow and then we'd be able to trigger it manually on a testing branch.

@hjiangsu
Copy link
Member Author

hjiangsu commented Dec 5, 2023

If you want, we can add a workflow_dispatch to the workflow and then we'd be able to trigger it manually on a testing branch.

That sounds like a good idea!

@micahmo
Copy link
Member

micahmo commented Dec 5, 2023

Oh wait, it already has it! So you can run a test on any branch like this.

image

@micahmo
Copy link
Member

micahmo commented Dec 5, 2023

I think I got it! Someone suggested printf and it works.

Workflow change: develop...micahmo:thunder:test/action

Result: https://github.com/micahmo/thunder/pull/11/files

EDIT: Maybe a tiny bit of cleanup needed for the closing brace (or maybe it's fine).

@hjiangsu
Copy link
Member Author

hjiangsu commented Dec 5, 2023

I think I got it! Someone suggested printf and it works.

Nice! Thanks for looking into it. I was also testing some alternatives but it didn't work 😅

@hjiangsu hjiangsu mentioned this pull request Dec 5, 2023
3 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