-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: choose between exporting with or without annotations #137
base: main
Are you sure you want to change the base?
feat: choose between exporting with or without annotations #137
Conversation
Deploying pixelium with Cloudflare Pages
|
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.
Setting the name in the export to png modal has no effect on the generated file name (the state with the name is not used in the code when saving).
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.
- I've put "test" in the name field and the file gets saved as "test.png.png".
- The default name of the file should be pre-filled in the input and it should not be possible to save with an empty field.
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.
Would be nice to have some feedback via a toast notification (blueprint has a component for this) once copy to clipboard succeeds / fails.
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.
If no image is selected, the export toolbar should disappear.
if (!hasAnnotations) { | ||
save(); | ||
return null; | ||
} |
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.
My suggestion was not just to remove the effect (it was correct to use an effect in that case), but to move this logic up to the component that handles the export options, which will prevent having to use an effect because then it can be called in an event callback.
copyToClipboard().catch((error) => | ||
logger.error(`Failed to copy to clipboard: ${error}`), | ||
); | ||
openExportClipboardModal(); |
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.
Here in the select callback there can be additional logic to handle the cases where the image has / does not have annotations.
closes #119
closes #126