Skip to content

feat(platform): preview project name on top of DSN #13041

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

a-hariti
Copy link
Collaborator

also fixes a "copied" feedback z-index issue

closes #13015

also fixes a "copied" feedback z-index issue

closes #13015
Copy link

vercel bot commented Mar 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
develop-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2025 1:46pm
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 8, 2025 1:46pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
changelog ⬜️ Ignored (Inspect) Visit Preview Apr 8, 2025 1:46pm

Copy link

codecov bot commented Mar 19, 2025

Bundle Report

Changes will increase total bundle size by 2.32kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 10.57MB 891 bytes (0.01%) ⬆️
sentry-docs-client-array-push 9.43MB 1.43kB (0.02%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js 25 bytes 868.19kB 0.0%
static/css/*.css 14 bytes 18.68kB 0.07%
static/chunks/3319-*.js -3 bytes 393.41kB -0.0%
static/chunks/main-*.js 30 bytes 1.92kB 1.59%
static/chunks/app/[[...path]]/page-*.js 1.36kB 76.27kB 1.82%
static/IuJAU9iph8M6ZTWeTkfS9/_buildManifest.js (New) 578 bytes 578 bytes 100.0% 🚀
static/IuJAU9iph8M6ZTWeTkfS9/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/tXgJho91JMJ62tj8Ghv3j/_buildManifest.js (Deleted) -578 bytes 0 bytes -100.0% 🗑️
static/tXgJho91JMJ62tj8Ghv3j/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

Files in static/chunks/app/[[...path]]/page-*.js:

  • ./src/components/codeBlock/code-blocks.module.scss → Total Size: 309 bytes

  • ./src/components/codeBlock/index.tsx → Total Size: 7.41kB

view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.57MB -0.0%
../instrumentation.js -3 bytes 904.32kB -0.0%
9523.js -3 bytes 880.37kB -0.0%
../app/[[...path]]/page.js 900 bytes 535.52kB 0.17%

Files in ../app/[[...path]]/page.js:

  • ./src/components/codeBlock/index.tsx → Total Size: 6.48kB

  • ./src/components/codeBlock/index.tsx → Total Size: 1.3kB

  • ./src/components/codeBlock/code-blocks.module.scss → Total Size: 300 bytes

App Routes Affected:

App Route Size Change Total Size Change (%)
/[[...path]] 900 bytes 3.08MB 0.03%

@philprime
Copy link
Member

@a-hariti Thanks for the quick implementation!

How should we deal with the project preview overlaying code?
I don't think there is any good solution because the preview will most likely always be in the way.

One idea that popped to my mind would be reducing the opacity when the cursor is on top of the preview, so that it is possible to view what's below the code, but not sure about that.

https://sentry-docs-git-dsn-preview.sentry.dev/platforms/apple/guides/ios/

image image

@a-hariti
Copy link
Collaborator Author

The ideal solution might be to track the user's gaze with AI and move the popup out of their eyesight 😂

@a-hariti
Copy link
Collaborator Author

I came up with this hack to add some margin to lines with clickable "keywords", it doesn't discriminate between DSN's or other things, but the worst case scenario is having an apparent extra line of whitespace, so it should do @philprime

image

Copy link
Member

@philprime philprime left a comment

Choose a reason for hiding this comment

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

Found a typo, added suggestions.

As my background is more mobile UI than web UI development, it would be great if @chargome could do a proper review on the implementation.

@chargome
Copy link
Member

I think we shuold only show this for dsn, not for orgs and projects:

Screenshot 2025-03-24 at 10 47 11

a-hariti and others added 3 commits April 3, 2025 13:22
also rename styles file to be an actual TS file with the confusing
.css.ts extention
@philprime
Copy link
Member

@a-hariti Am I missing something or is the preview for DSNs not in there anymore?

@a-hariti
Copy link
Collaborator Author

a-hariti commented Apr 4, 2025

You didn't miss anything @philprime, I messed up 🫣

please take another look :)

Copy link
Member

@philprime philprime left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@philprime philprime left a comment

Choose a reason for hiding this comment

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

Can we make the tooltip not to be picked up from selection?

I selected the text to copy it (instead of using the copy button) and it copied like this:

@import Sentry;
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
        options.dsn = @"https://[email protected]/0example-org / example-project";
        options.debug = YES; // Enabled debug when first installing is always helpful
        // Adds IP for users.
        // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/
        options.sendDefaultPii = YES
    }];
    return YES;
}

It seems to append the example-org / example-project to the DSN, while visually it is not selected.

This will cause UX issues with users who prefer to select code to copy it.

Screenshot 2025-04-08 at 13 02 39

@a-hariti
Copy link
Collaborator Author

a-hariti commented Apr 8, 2025

Good catch @philprime, it required some gymnastics, but I believe it's good to go now :)

@a-hariti a-hariti requested a review from philprime April 8, 2025 13:56
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

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

@a-hariti could we only display this when the user is logged in? Not really useful when the example project is shown I think 🤔

@sfanahata
Copy link
Contributor

@a-hariti - what's the status of this one?

@philprime philprime removed their request for review June 23, 2025 09:19
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.

Add preview for org / project name for DSN
4 participants