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

feat(user feedback): Adds toolbar for cropping and annotating #15282

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

c298lee
Copy link
Member

@c298lee c298lee commented Feb 3, 2025

  • adds a toolbar for cropping and annotations
  • changes from inline styles to multiple class names in BEM format

With annotation option:
Screenshot 2025-02-03 at 3 51 04 PM

Without annotation option (to confirm that it looks the same as before):
Screenshot 2025-02-03 at 5 09 01 PM

Closes #15252

@c298lee c298lee requested a review from a team as a code owner February 3, 2025 22:11
</div>
{options._experiments.annotations && (
<div class="editor__tool-container">
<div />
Copy link
Member Author

@c298lee c298lee Feb 3, 2025

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 />
Copy link
Member Author

@c298lee c298lee Feb 3, 2025

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) && (
Copy link
Member Author

@c298lee c298lee Feb 3, 2025

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

Copy link
Contributor

github-actions bot commented Feb 3, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.94 KB - -
@sentry/browser - with treeshaking flags 22.81 KB - -
@sentry/browser (incl. Tracing) 35.78 KB - -
@sentry/browser (incl. Tracing, Replay) 72.58 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 66.14 KB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 76.83 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 89.57 KB +0.28% +250 B 🔺
@sentry/browser (incl. Feedback) 39.88 KB +0.62% +249 B 🔺
@sentry/browser (incl. sendFeedback) 27.57 KB - -
@sentry/browser (incl. FeedbackAsync) 32.35 KB - -
@sentry/react 24.78 KB - -
@sentry/react (incl. Tracing) 37.67 KB - -
@sentry/vue 27.1 KB - -
@sentry/vue (incl. Tracing) 37.5 KB - -
@sentry/svelte 23.07 KB - -
CDN Bundle 24.25 KB - -
CDN Bundle (incl. Tracing) 35.92 KB - -
CDN Bundle (incl. Tracing, Replay) 70.56 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 75.7 KB - -
CDN Bundle - uncompressed 70.85 KB - -
CDN Bundle (incl. Tracing) - uncompressed 106.59 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 217.44 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 230.01 KB - -
@sentry/nextjs (client) 38.64 KB - -
@sentry/sveltekit (client) 36.29 KB - -
@sentry/node 156.51 KB - -
@sentry/node - without tracing 97.56 KB - -
@sentry/aws-serverless 107.07 KB - -

View base workflow run

Comment on lines +91 to 92
const [isCropping, setIsCropping] = hooks.useState(true);
const [isAnnotating, setIsAnnotating] = hooks.useState(false);
Copy link
Member

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.

Comment on lines +148 to +150
if (!isCropping) {
return;
}
Copy link
Member

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

Copy link
Member Author

@c298lee c298lee Feb 3, 2025

Choose a reason for hiding this comment

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

it is important to be after the clearRect. It removes the white border that's used to show that it's in the cropping state. Here's waht it would look like if it was before clearRect:
image

Copy link
Member

@ryan953 ryan953 left a 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!

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.

[User Feedback] Make the annotation toolbar align with designs
2 participants