-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(user feedback): Adds toolbar for cropping and annotating #15282
base: develop
Are you sure you want to change the base?
Conversation
</div> | ||
{options._experiments.annotations && ( | ||
<div class="editor__tool-container"> | ||
<div /> |
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.
Extra div for reset button in a future PR
</button> | ||
</div> | ||
<div /> |
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.
Extra div for colour picking in a future PR
></CropCorner> | ||
</div> | ||
)} | ||
{(!options._experiments.annotations || isCropping) && ( |
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.
To be moved into the toolbar area in a future PR, so I didn't combine it with above
size-limit report 📦
|
const [isCropping, setIsCropping] = hooks.useState(true); | ||
const [isAnnotating, setIsAnnotating] = hooks.useState(false); |
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.
We might want to make these a single state where the value is more like an enum.
Right now i'm noticing spots like this:
setIsCropping(!isCropping);
setIsAnnotating(false);
which will only get more annoying if more tools get added. Not something for now, but when the next one gets added this'll be a fix.
if (!isCropping) { | ||
return; | ||
} |
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.
is this important to be after the clearRect()
call? which rect is being cleared in this case
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.
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.
The Editor component is getting to be a big file & function, as we add more we should keep an eye out to split out things: it'll make it easier to reason about if different unrelated state is isolated from the rest.
For now though, time to shipit! lets go!
With annotation option:
Without annotation option (to confirm that it looks the same as before):
Closes #15252