-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: Add "Open in ChatGPT/Claude" buttons for each page #15428
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
base: master
Are you sure you want to change the base?
Conversation
Besides the existing "Copy Page" and "View as Markdown", I've added two more buttons in the dropdown so users can open that page in ChatGPT or Claude and ask questions about it.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
sergical
left a comment
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.
small comment but non-blocking, this is super helpful!
| </div> | ||
| </Link> | ||
|
|
||
| <a |
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.
not sure if using Link here is better since it's an external link
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.
That's actually why I used a instead of Link. Isn't Next.js's Link for soft nav within the app?
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.
it can be used for external links too as it'll render an anchor tag anyway, was just thinking since Link was already imported in the file, just for standardization but leave it as is :)
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.
No I know. Here's what my thought was:
- we def have an external link and that's not going to change;
- we don't want the current behaviour to change as well (with the
atag); - Next.js's Link component probably checks in with the router before navigating (extra steps for external navigation) and it has a preloading mechanism built in for perf optimization on soft navs. It's definitely built for local soft navigation;
- Next.js's Link component is third-party and prone to change;
The a approach seemed like the cleanest.
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.
100% aligned, great call
Bundle ReportChanges will increase total bundle size by 12.74kB (0.06%) ⬆️. 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:
|
|
@sentry review |
| </Link> | ||
|
|
||
| <a | ||
| href={`https://chatgpt.com/?hints=search&q=${encodeURIComponent('Read from ' + window.location.href + ' so I can ask questions about its contents')}`} |
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: ChatGPT URL Parameter Mismatch
The ChatGPT URL uses ?hints=search but the PR description example shows ?hint=search (singular). This inconsistency means either the implementation doesn't match the intended behavior documented in the PR, or the example is incorrect. The URL parameter mismatch could cause the ChatGPT link to not work as expected.
Besides the existing "Copy Page" and "View as Markdown", I've added two more buttons in the dropdown so users can open that page in ChatGPT or Claude and ask questions about it:
Both buttons are static links that open ChatGPT / Claude with predefined prompt.
Example: https://chatgpt.com/?hint=search&q=Read+from+https://docs.sentry.io/platforms/javascript/+so+I+can+ask+questions+about+its+contents