Skip to content

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
@vercel
Copy link

vercel bot commented Mar 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
develop-docs Ready Ready Preview Comment Sep 2, 2025 0:04am
sentry-docs Ready Ready Preview Comment Sep 2, 2025 0:04am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
changelog Ignored Ignored Preview Sep 2, 2025 0:04am

@codecov
Copy link

codecov bot commented Mar 19, 2025

Bundle Report

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

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 12.54MB 1.09kB (0.01%) ⬆️
sentry-docs-client-array-push 9.9MB 1.44kB (0.01%) ⬆️

Affected Assets, Files, and Routes:

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

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.78MB -0.0%
../instrumentation.js -3 bytes 1.1MB -0.0%
9523.js -3 bytes 1.08MB -0.0%
../app/[[...path]]/page.js.nft.json 65 bytes 784.05kB 0.01%
../app/platform-redirect/page.js.nft.json 65 bytes 783.96kB 0.01%
../app/sitemap.xml/route.js.nft.json 65 bytes 781.43kB 0.01%
../app/[[...path]]/page.js 900 bytes 609.7kB 0.15%

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

  • ./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.17MB 0.03%
view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 882.71kB -0.0%
static/css/*.css 14 bytes 11.7kB 0.12%
static/chunks/8321-*.js -3 bytes 425.87kB -0.0%
static/chunks/app/[[...path]]/page-*.js 1.43kB 89.44kB 1.63%
static/vh-*.js (New) 77 bytes 77 bytes 100.0% 🚀
static/vh-*.js (New) 684 bytes 684 bytes 100.0% 🚀
static/vo6cEdb1Ajv_UYyrwA8BC/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/vo6cEdb1Ajv_UYyrwA8BC/_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

@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?

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
@philprime
Copy link
Member

philprime commented Sep 2, 2025

This pull request seems to be abandoned by @a-hariti.

@chargome who would be the right person to ping to pick this up?

@chargome
Copy link
Member

chargome commented Sep 2, 2025

I can take a look yes, otherwise @sergical is the man to ping now!

cursor[bot]

This comment was marked as outdated.

@chargome chargome self-assigned this Sep 2, 2025
document.addEventListener('selectionchange', handleSelectionChange);
return () => {
document.removeEventListener('selectionchange', handleSelectionChange);
};
Copy link

Choose a reason for hiding this comment

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

Bug: Selection Listener Fails with Dynamic Content

The selectionchange listener has a few issues. It captures .no-copy elements only once, missing dynamic additions, causing them to remain visible during selection. Restoring elements unconditionally sets display: 'inline', which can break their original layout. This hide/show behavior is visually jarring, and multiple CodeBlock instances add redundant global listeners.

Fix in Cursor Fix in Web

@chargome chargome requested a review from sergical September 2, 2025 11:44
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.

lgtm
@sergical just leaving this open for you to take a look – feel free to merge in after!

border: none;
color: var(--white);
transition: opacity 150ms;
z-index: 10000;
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if this is really necessary, but should not interfere with anything else I think

@a-hariti a-hariti merged commit 358ce11 into master Sep 2, 2025
15 checks passed
@a-hariti a-hariti deleted the dsn-preview branch September 2, 2025 12:04
@github-actions github-actions bot locked and limited conversation to collaborators Sep 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add preview for org / project name for DSN

5 participants