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(feedback): Update user feedback screenshot and cropping to align with designs #11227

Merged
merged 23 commits into from
Mar 26, 2024

Conversation

c298lee
Copy link
Member

@c298lee c298lee commented Mar 21, 2024

Updated some screenshot styles to align with design:

  • Changed cropping to more closely follow photoshop: darker background, white cropping corners + rectangle and additional black border for contrast if the screenshot is white
  • Changed naming to follow BES naming
  • Added padding so that the submit/cancel buttons are always visible without scrolling
  • Reduced blurriness of cropping rectangle
image

Relates to getsentry/sentry#63749

@c298lee c298lee requested review from a team March 21, 2024 16:33
Copy link
Contributor

github-actions bot commented Mar 21, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) 80.56 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing, Replay) 71.89 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 75.7 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 65.44 KB (0%)
@sentry/browser (incl. Tracing) 36.71 KB (0%)
@sentry/browser (incl. browserTracingIntegration) 36.71 KB (0%)
@sentry/browser (incl. feedbackIntegration) 31.37 KB (+0.05% 🔺)
@sentry/browser (incl. feedbackModalIntegration) 31.48 KB (+0.05% 🔺)
@sentry/browser (incl. feedbackScreenshotIntegration) 31.49 KB (+0.05% 🔺)
@sentry/browser (incl. sendFeedback) 27.44 KB (+0.07% 🔺)
@sentry/browser 22.58 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 74.9 KB (0%)
CDN Bundle (incl. Tracing, Replay) 69.73 KB (0%)
CDN Bundle (incl. Tracing) 36.3 KB (0%)
CDN Bundle 23.94 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 219.01 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 109.57 KB (0%)
CDN Bundle - uncompressed 70.92 KB (0%)
@sentry/react (incl. Tracing, Replay) 71.87 KB (0%)
@sentry/react 22.61 KB (0%)

Comment on lines 36 to 37

--crop-foreground: ${theme.cropForeground};
Copy link
Member

Choose a reason for hiding this comment

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

imo, we don't allow theming of this button and use submitButton theme instead. This forces the UI to be a bit more consistent. I think it's ok to keep the CSS variable.

Suggested change
--crop-foreground: ${theme.cropForeground};
--crop-foreground: ${theme.submitForeground};

Copy link
Member Author

Choose a reason for hiding this comment

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

the crop "buttons" I'm referring to are the 4 corners that you can drag to crop, I'll rename them so it's more obvious

Copy link
Member

Choose a reason for hiding this comment

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

Ah can you post a screenshot in the PR and maybe consult with @Jesse-Box? I think similar idea applies even though this isn't strictly a button, we want to maintain some sort of uniform theming so there aren't too many one-off colors.

@c298lee c298lee requested review from billyvg and Jesse-Box March 21, 2024 18:06
lforst and others added 16 commits March 22, 2024 17:36
Recommend reading through https://web.dev/articles/ttfb before review.

In
https://www.notion.so/sentry/TTFB-vital-is-0-for-navigation-events-2337114dd75542569eb70255a467aba6
we identified that ttfb was being incorrectly calculated in certain
scenarios. This was because we were calculating `ttfb` relative to
transaction start time, **before** it has been adjusted by `browser`
related spans about request/response ( remember browser tracing adjusts
the start timestamp of a pageload transaction after adding certain
request/response related spans).

This meant that `Math.max(responseStartTimestamp - transactionStartTime,
0)` would just end up being `0` most of the time because using
`transactionStartTime` was not correct.

To fix this, we avoid trying to rely on our `transactionStartTime`
timestamp at all, but instead using the web vitals version helper for
this.

When this gets merged in, I'll backport it to v7. I'm doing this in v8
first because I don't want to deal with the merge conflict that comes
when we eventually migrate this code from tracing internal into the
browser package.

As a next step, we should seriously think about getting rid of all of
our vendored code and just rely on the web vitals library - it's a huge
pain to maintain this, and I'm sure there are some insidious bugs
sneaking about.
This was missed from the original PR #11214 but is already included in
the backport #11228
Fixes issue where screenshotting in Safari results in black bars on the
right and bottom of the image.

Before:
<img width="1278" alt="image"
src="https://github.com/getsentry/sentry-javascript/assets/55311782/b2c174ad-8403-459a-b24b-7e055da3d657">

After:
<img width="1278" alt="image"
src="https://github.com/getsentry/sentry-javascript/assets/55311782/85fb850d-6c01-48cd-9fe0-21a860114b9d">

Relates to getsentry/sentry#63749
…rent request (#11130)

When switching the SvelteKit server side SDK to `@sentry/node` powered
by Otel, the semantics behind `continueTrace` changed as outlined in
#11199. TLDR: We previously called `continueTrace` in a nested way when
dealing with sub-requests`*` in SvelteKit. In our old Node SDK, this did
nothing; in the new SDK, this currently causes a new root
span/transaction to be created for the sub request.

This patch now ensures that we continue to send sub request spans as child
spans of the top-level/parent request.
The debugger call stack does not include the `new Promise` frames that
are parsed from `error.stack`. This means that when we go through the
frames to apply the local variables, the frames don't match up and we
bail.

This patch ignores those frames when matching functions in the frames.
This functionality is no longer being used, so we can remove it and it's
tests.

Part of #9885 since
it makes it easier to port over browsertracing into browser package.
Make `integration.setupOnce` accept no arguments. This will allow us to
easily remove `addGlobalEventProcessor` which is deprecated API.

This also means we can remove `IntegrationFnResult`, as the type
signature of the functional and class based integrations are now the
same.

Next up - remove `addGlobalEventProcessor`!
@c298lee c298lee changed the title feat(feedback): Add screenshot crop colour customization feat(feedback): Update user feedback screenshot and cropping to align with designs Mar 22, 2024
@c298lee c298lee requested review from ryan953 and billyvg March 22, 2024 22:21
Comment on lines +83 to +90
cropper.width = imageDimensions.width * DPI;
cropper.height = imageDimensions.height * DPI;
cropper.style.width = `${imageDimensions.width}px`;
cropper.style.height = `${imageDimensions.height}px`;
const ctx = cropper.getContext('2d');
if (ctx) {
ctx.scale(DPI, DPI);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This reduces the crop rectangle blurriness, which is a known issue on retina screens: https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio

Copy link

codecov bot commented Mar 26, 2024

Bundle Report

Changes will decrease total bundle size by 2.81MB ⬇️

Bundle name Size Change
@sentry-internal/feedback-cjs 65.56kB 738 bytes ⬆️
@sentry/astro-esm 23.39kB 0 bytes
@sentry/sveltekit-cjs 69.31kB 0 bytes
@sentry/gatsby-cjs 2.88kB 0 bytes
@sentry/remix-esm 48.23kB 0 bytes
@sentry/nextjs-cjs 15.5kB 5.02kB ⬇️
@sentry-internal/feedback-esm 65.28kB 738 bytes ⬆️
@sentry/nextjs-esm 147.39kB 127.37kB ⬆️
@sentry/gatsby-esm 2.27kB 0 bytes
@sentry/browser-cjs 107.15kB 0 bytes
@sentry/remix-cjs 53.62kB 0 bytes
@sentry/browser-esm 104.35kB 0 bytes
@sentry/wasm-cjs 5.2kB 0 bytes
@sentry/sveltekit-esm 61.08kB 0 bytes
@sentry/vue-cjs 20.19kB 0 bytes
@sentry/svelte-cjs 13.84kB 0 bytes
@sentry/react-cjs 45.04kB 0 bytes
@sentry/wasm-esm 4.85kB 0 bytes
@sentry/astro-cjs 27.13kB 0 bytes
@sentry/vue-esm 18.85kB 0 bytes
@sentry/svelte-esm 12.72kB 0 bytes
@sentry/react-esm 41.18kB 0 bytes
@sentry/core-esm (removed) 239.08kB ⬇️
@sentry/types-cjs (removed) 35 bytes ⬇️
@sentry-internal/integration-shims-cjs (removed) 3.65kB ⬇️
@sentry/vercel-edge-cjs (removed) 18.23kB ⬇️
@sentry/node-experimental-esm (removed) 149.75kB ⬇️
@sentry/node-experimental-cjs (removed) 156.31kB ⬇️
@sentry/utils-cjs (removed) 179.0kB ⬇️
@sentry-internal/replay-esm (removed) 306.29kB ⬇️
@sentry/node-esm (removed) 291.28kB ⬇️
@sentry-internal/integration-shims-esm (removed) 2.99kB ⬇️
@sentry-internal/node-integration-tests-cjs (removed) 1.04kB ⬇️
@sentry/node-cjs (removed) 294.64kB ⬇️
@sentry/google-cloud-serverless-esm (removed) 19.15kB ⬇️
@sentry/types-esm (removed) 35 bytes ⬇️
@sentry/utils-esm (removed) 174.41kB ⬇️
@sentry-internal/replay-canvas-cjs (removed) 29.43kB ⬇️
@sentry-internal/replay-cjs (removed) 306.18kB ⬇️
@sentry-internal/replay-canvas-esm (removed) 29.34kB ⬇️
@sentry/opentelemetry-cjs (removed) 70.06kB ⬇️
@sentry/core-cjs (removed) 242.64kB ⬇️
@sentry/vercel-edge-esm (removed) 16.13kB ⬇️
@sentry-internal/tracing-cjs (removed) 107.96kB ⬇️
@sentry/opentelemetry-esm (removed) 68.97kB ⬇️
@sentry-internal/tracing-esm (removed) 107.22kB ⬇️
@sentry/profiling-node-cjs (removed) 25.5kB ⬇️
@sentry/profiling-node-esm (removed) 25.52kB ⬇️
@sentry/aws-serverless-cjs (removed) 20.25kB ⬇️
@sentry/bun-cjs (removed) 13.49kB ⬇️
@sentry/google-cloud-serverless-cjs (removed) 22.97kB ⬇️
@sentry/bun-esm (removed) 10.07kB ⬇️
@sentry-internal/node-integration-tests-esm (removed) 888 bytes ⬇️

width: 30px;
height: 30px;
position: absolute;
background: none;
border: solid #FFFFFF;
Copy link
Member

Choose a reason for hiding this comment

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

Can we add this to constants and share it with the canvas style?

@c298lee c298lee requested a review from billyvg March 26, 2024 16:35
@c298lee c298lee merged commit 8f4f3d8 into develop Mar 26, 2024
88 checks passed
@c298lee c298lee deleted the cl/screenshot-styles branch March 26, 2024 19:40
cadesalaberry pushed a commit to cadesalaberry/sentry-javascript that referenced this pull request Apr 19, 2024
… with designs (getsentry#11227)

Updated some screenshot styles to align with design:
- Changed cropping to more closely follow photoshop: darker background,
white cropping corners + rectangle and additional black border for
contrast if the screenshot is white
- Changed naming to follow BES naming
- Added padding so that the submit/cancel buttons are always visible
without scrolling
- Reduced blurriness of cropping rectangle
<img width="1270" alt="image"
src="https://github.com/getsentry/sentry-javascript/assets/55311782/df73a537-58f9-4f03-9edc-403039e61122">

Relates to getsentry/sentry#63749

---------
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.

9 participants