Skip to content

Conversation

@nikolovlazar
Copy link
Member

@nikolovlazar nikolovlazar commented Nov 7, 2025

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:

image

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

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

vercel bot commented Nov 7, 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 Nov 7, 2025 5:39pm
sentry-docs Ready Ready Preview Comment Nov 7, 2025 5:39pm

Copy link
Member

@sergical sergical left a 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
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 using Link here is better since it's an external link

Copy link
Member Author

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?

Copy link
Member

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 :)

Copy link
Member Author

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 a tag);
  • 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.

Copy link
Member

Choose a reason for hiding this comment

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

100% aligned, great call

@codecov
Copy link

codecov bot commented Nov 7, 2025

Bundle Report

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

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 10.16MB 6.03kB (0.06%) ⬆️
sentry-docs-server-cjs 12.59MB 6.71kB (0.05%) ⬆️

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 -3 bytes 882.71kB -0.0%
static/chunks/8321-*.js -3 bytes 425.87kB -0.0%
server/app/api/ip-*.js 1 bytes 267.19kB 0.0%
server/app/_not-*.js 1 bytes 267.18kB 0.0%
server/app/[[...path]]/page_client-*.js 1 bytes 267.14kB 0.0%
server/app/platform-*.js 1 bytes 251.72kB 0.0%
static/chunks/3938-*.js (New) 56.97kB 56.97kB 100.0% 🚀
static/lZQfkmi0EpLfUr1hrkbWz/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/lZQfkmi0EpLfUr1hrkbWz/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/chunks/4145-*.js (Deleted) -50.94kB 0 bytes -100.0% 🗑️
static/uzBP_eMeCEH0tb7YgjcEQ/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/uzBP_eMeCEH0tb7YgjcEQ/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

Files in static/chunks/3938-*.js:

  • ./src/hooks/usePlausibleEvent.tsx → Total Size: 611 bytes
view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.74MB -0.0%
../instrumentation.js -3 bytes 1.07MB -0.0%
9523.js -3 bytes 1.04MB -0.0%
../app/[[...path]]/page.js.nft.json 246 bytes 760.63kB 0.03%
../app/platform-redirect/page.js.nft.json 246 bytes 760.54kB 0.03%
../app/sitemap.xml/route.js.nft.json 246 bytes 757.77kB 0.03%
../app/[[...path]]/page.js 1 bytes 616.38kB 0.0%
4236.js (New) 97.64kB 97.64kB 100.0% 🚀
../app/platform-redirect/page.js 1 bytes 32.22kB 0.0%
4873.js (Deleted) -91.66kB 0 bytes -100.0% 🗑️

Files in 4236.js:

  • ./src/hooks/usePlausibleEvent.tsx → Total Size: 611 bytes

  • ./src/components/copyMarkdownButton.tsx → Total Size: 494 bytes

App Routes Affected:

App Route Size Change Total Size Change (%)
/[[...path]] 1 bytes 3.36MB 0.0%
/platform-redirect 1 bytes 2.78MB 0.0%

@nikolovlazar
Copy link
Member Author

@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')}`}
Copy link

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.

Fix in Cursor Fix in Web

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.

4 participants