-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add copy for llm button #14341
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
Add copy for llm button #14341
Conversation
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Bundle ReportChanges will increase total bundle size by 15.71kB (0.07%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-client-array-pushAssets Changed:
Files in
view changes for bundle: sentry-docs-server-cjsAssets Changed:
Files in
App Routes Affected:
|
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
…tment Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
…ird-party modules Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
Co-authored-by: rahul.chhabria <[email protected]>
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.
Bug: Unmanaged Timeouts Cause State Issues
The setTimeout in handleCopy is not cleared. If the component unmounts before the 2-second timeout completes, it attempts to update state (setCopied, setShowToast) on an unmounted component, leading to React warnings and memory leaks. Furthermore, rapid multiple clicks will create multiple unmanaged timeouts, causing unpredictable state behavior. The timeout ID should be stored in a ref and cleared in a useEffect cleanup function, and also cleared before setting a new timeout.
src/components/copyForLLMButton.tsx#L35-L40
sentry-docs/src/components/copyForLLMButton.tsx
Lines 35 to 40 in 7696f8f
| // Hide confirmation after 2 seconds | |
| setTimeout(() => { | |
| setCopied(false); | |
| setShowToast(false); | |
| }, 2000); |
Bug: Sentry DSN Fallback Fails on Empty Strings
The Sentry DSN fallback logic incorrectly uses the nullish coalescing operator (??) to assign dummy values. While the preceding if condition correctly identifies empty string DSNs as missing, ?? preserves empty strings instead of assigning the dummy fallback. This allows production builds with empty NEXT_PUBLIC_SENTRY_DSN or SENTRY_DSN to silently proceed with non-functional Sentry, breaking error reporting, as the build no longer fails fast for missing DSNs.
next.config.ts#L45-L52
Lines 45 to 52 in 7696f8f
| ) { | |
| // When building for previews or local CI environments where real Sentry DSNs | |
| // are not available, fall back to a dummy value so the build can proceed. | |
| // Real production deployments must supply valid DSNs via env vars. | |
| // eslint-disable-next-line no-console | |
| console.warn('SENTRY DSN env vars missing; using dummy values for preview build'); | |
| process.env.NEXT_PUBLIC_SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN ?? 'https://[email protected]/0'; | |
| process.env.SENTRY_DSN = process.env.SENTRY_DSN ?? 'https://[email protected]/0'; |
Was this report helpful? Give feedback by reacting with 👍 or 👎
|
closing this pr and staritng over. cursor fail. |
%60%60%60%0A%3C!--%20Use%20this%20checklist%20to%20make%20sure%20your%20PR%20is%20ready%20for%20merge.%20You%20may%20delete%20any%20sections%20you%20don't%20need.%20--%3E%0A%0A%23%23%20DESCRIBE%20YOUR%20PR%0AThis%20PR%20introduces%20a%20new%20%22Copy%20for%20LLM%22%20button%20to%20documentation%20pages.%20Its%20purpose%20is%20to%20provide%20users%20with%20a%20quick%20way%20to%20copy%20the%20page's%20title%2C%20description%2C%20and%20main%20content%20to%20their%20clipboard%2C%20facilitating%20easy%20pasting%20into%20large%20language%20models.%20The%20button%20is%20positioned%20to%20the%20left%20of%20the%20%22view%20as%20Markdown%22%20button%2C%20matches%20its%20visual%20style%2C%20and%20provides%20a%20clear%20%22Copied%20to%20clipboard%22%20toast%20notification%20and%20icon%20change%20upon%20successful%20copy.%20This%20enhances%20user%20experience%20by%20streamlining%20content%20extraction%20for%20AI%20tools.%0A%0A%23%23%20IS%20YOUR%20CHANGE%20URGENT%3F%20%20%0A%0AHelp%20us%20prioritize%20incoming%20PRs%20by%20letting%20us%20know%20when%20the%20change%20needs%20to%20go%20live.%0A-%20%5B%20%5D%20Urgent%20deadline%20(GA%20date%2C%20etc.)%3A%20%3C!--%20ENTER%20DATE%20HERE%20--%3E%0A-%20%5B%20%5D%20Other%20deadline%3A%20%3C!--%20ENTER%20DATE%20HERE%20--%3E%0A-%20%5Bx%5D%20None%3A%20Not%20urgent%2C%20can%20wait%20up%20to%201%20week%2B%0A%0A%23%23%20SLA%0A%0A-%20Teamwork%20makes%20the%20dream%20work%2C%20so%20please%20add%20a%20reviewer%20to%20your%20PRs.%0A-%20Please%20give%20the%20docs%20team%20up%20to%201%20week%20to%20review%20your%20PR%20unless%20you've%20added%20an%20urgent%20due%20date%20to%20it.%0AThanks%20in%20advance%20for%20your%20help!%0A%0A%23%23%20PRE-MERGE%20CHECKLIST%0A%0AMake%20sure%20you've%20checked%20the%20following%20before%20merging%20your%20changes%3A%0A%0A-%20%5B%20%5D%20Checked%20Vercel%20preview%20for%20correctness%2C%20including%20links%0A-%20%5B%20%5D%20PR%20was%20reviewed%20and%20approved%20by%20any%20necessary%20SMEs%20(subject%20matter%20experts)%0A-%20%5B%20%5D%20PR%20was%20reviewed%20and%20approved%20by%20a%20member%20of%20the%20%5BSentry%20docs%20team%5D(https%3A%2F%2Fgithub.com%2Forgs%2Fgetsentry%2Fteams%2Fdocs)%0A%0A%23%23%20LEGAL%20BOILERPLATE%0A%0A%3C!--%20Sentry%20employees%20and%20contractors%20can%20delete%20or%20ignore%20this%20section.%20--%3E%0A%0ALook%2C%20I%20get%20it.%20The%20entity%20doing%20business%20as%20%22Sentry%22%20was%20incorporated%20in%20the%20State%20of%20Delaware%20in%202015%20as%20Functional%20Software%2C%20Inc.%20and%20is%20gonna%20need%20some%20rights%20from%20me%20in%20order%20to%20utilize%20my%20contributions%20in%20this%20here%20PR.%20So%20here's%20the%20deal%3A%20I%20retain%20all%20rights%2C%20title%20and%20interest%20in%20and%20to%20my%20contributions%2C%20and%20by%20keeping%20this%20boilerplate%20intact%20I%20confirm%20that%20Sentry%20can%2