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

Allow share plugins to expose Actions #978

Open
karaggeorge opened this issue Feb 13, 2021 · 3 comments
Open

Allow share plugins to expose Actions #978

karaggeorge opened this issue Feb 13, 2021 · 3 comments

Comments

@karaggeorge
Copy link
Member

Feature Request:

Add a new api (to not break backwards compatibility) to the share service context that allows plugins to add Actions. Actions have a title and callback function. Those can be added to the exports window ... menu or in the editor page menu after export is complete.

Another possibility is to have a menu item for the plugin and whatever actions the plugin adds go in its submenu, but that just adds more clicks for the user.

Example usages:

  • Plugins that copy a link (like kap-giphy) automatically copy a link to your clipboard when they're done. If the user happens to copy something else at that exact time because they were waiting for the export in the background, they lose that link forever, and there's no way to get it back without re-exporting.

kap-giphy could add an Action Copy Giphy link and the action would re-copy the link

  • Some plugins could support multiple actions but are limited to one currently, like Dropbox, I could copy a link to the file in the default Dropbox preview, or a direct link to the file itself, or a link to the share page of the file on Dropbox. Right now I have to pick between the 3 or add an option in the config, but with this I could add 3 actions in this menu so the user can choose
@sindresorhus
Copy link
Member

Plugins that copy a link (like kap-giphy) automatically copy a link to your clipboard when they're done. If the user happens to copy something else at that exact time because they were waiting for the export in the background, they lose that link forever, and there's no way to get it back without re-exporting.

I agree. This is not good. We should only copy if it can be done right away, or if the user clicks a notification that says it will copy, or a copy action like you've described.

@sindresorhus
Copy link
Member

or in the editor page menu after export is complete.

Any example use-case for this?

@karaggeorge
Copy link
Member Author

Any example use-case for this?

Same as the exports window. Since now the editor turns into an export window, in that screen when the conversion is finished, I figured we'll have a share menu that has the native share options (when it comes out with a stable electron version) and the actions that the plugin provides.

Those actions will also go to the exports window that lists all the exports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants