Skip to content

Conversation

@codyde
Copy link
Contributor

@codyde codyde commented May 19, 2025

Adding snippet copy functionality that users can copy to use in tools like Cursor, Windsurf, or any LLM.

Modified the Expandable component to support a copy property that can used to make snippets copyable in a user friendly way. Screenshot below. Typically this would be a separate PR - but unfortunately the functionality needed to be in place in order for this to work.

CleanShot 2025-05-19 at 1  38 54@2x

Content can be copied and added to a local rules file in the editor and referenced in configuration options - for example...

  • "Implement logging using examples in the sentryrules.md"
  • " Using the example in sentryrules.md implement custom spans on my API routes"

Per internal discussion, starting with high usage frameworks to start basic and evaluate

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • None: Not urgent, can wait up to 1 week+

@codyde codyde requested a review from nikolovlazar May 19, 2025 08:40
@codyde codyde self-assigned this May 19, 2025
@codyde codyde added the WIP label May 19, 2025
@codyde codyde linked an issue May 19, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented May 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 May 20, 2025 5:48pm
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2025 5:48pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
changelog ⬜️ Ignored (Inspect) Visit Preview May 20, 2025 5:48pm

@codeowner-assignment codeowner-assignment bot requested review from a team May 19, 2025 08:40
@codecov
Copy link

codecov bot commented May 19, 2025

Bundle Report

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

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 11.2MB 2.52kB (0.02%) ⬆️
sentry-docs-client-array-push 9.51MB 1.84kB (0.02%) ⬆️

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.75MB -0.0%
../instrumentation.js -3 bytes 1.08MB -0.0%
9523.js -3 bytes 1.05MB -0.0%
../app/[[...path]]/page.js 1.07kB 585.34kB 0.18%
../app/[[...path]]/page.js.nft.json 484 bytes 397.29kB 0.12%
../app/platform-redirect/page.js.nft.json 484 bytes 397.2kB 0.12%
../app/sitemap.xml/route.js.nft.json 484 bytes 395.18kB 0.12%

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

  • ./src/components/expandable/index.tsx → Total Size: 6.32kB

  • ./src/components/expandable/style.module.scss → Total Size: 300 bytes

  • ./src/components/expandable/index.tsx → Total Size: 460 bytes

App Routes Affected:

App Route Size Change Total Size Change (%)
/[[...path]] 1.07kB 3.13MB 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 868.7kB -0.0%
static/css/*.css 93 bytes 1.98kB 4.92%
static/css/*.css 569 bytes 1.89kB 43.11% ⚠️
static/chunks/8165-*.js -3 bytes 410.1kB -0.0%
static/chunks/app/[[...path]]/page-*.js 1.19kB 80.02kB 1.5%
server/middleware-*.js 5.55kB 6.55kB 555.3% ⚠️
server/middleware-*.js -5.55kB 1.0kB -84.74%
static/60Wiw0jPOvuRM50PyoH97/_buildManifest.js (New) 578 bytes 578 bytes 100.0% 🚀
static/60Wiw0jPOvuRM50PyoH97/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/EGIE3sgGwomfINKYHLjGQ/_buildManifest.js (Deleted) -578 bytes 0 bytes -100.0% 🗑️
static/EGIE3sgGwomfINKYHLjGQ/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

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

  • ./src/components/expandable/index.tsx → Total Size: 6.91kB

  • ./src/components/expandable/style.module.scss → Total Size: 312 bytes

codyde and others added 11 commits May 19, 2025 02:21
…ry/sentry-docs into ai-rule-snippets-js-sdks

* 'ai-rule-snippets-js-sdks' of https://github.com/getsentry/sentry-docs:
  Adding AI snippet to logs for nextjs, node, react
  [getsentry/action-github-commit] Auto commit
  running eslint fix
  Fixing import order
  Fixing ordering of imports
  Autofix fixing sort
  Adding typical initialization location for node
  Adding llm rules snippet for react, node, nextjs
  Adding support in expandable modal for copy button
@codyde codyde removed the request for review from a team May 19, 2025 10:00
@codyde codyde removed the request for review from a team May 19, 2025 10:00
Copy link
Member

@nikolovlazar nikolovlazar left a comment

Choose a reason for hiding this comment

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

LGTM! I think this is a good balance of depth and file simplicity.

@codyde codyde removed the WIP label May 20, 2025
@codyde codyde merged commit e5ae44c into master May 20, 2025
15 checks passed
@codyde codyde deleted the ai-rule-snippets-js-sdks branch May 20, 2025 17:50
@chargome
Copy link
Member

chargome commented May 21, 2025

Hey guys, this broke the styling of our expandable component 😬

Also assuming parts of this was AI generated, we need to make sure to better review these changes – there were styling vars referenced that did not exist as well as some react code that did not make sense. Sorry I didn't get to review this earlier 🙏

EDIT: the expandable was updated two days ago in #13736 and since this PR was not rebased on the latest master, the UI issue was not visible in the deployment preview! 🤯

Screenshot 2025-05-21 at 11 28 45

chargome added a commit that referenced this pull request May 21, 2025
codyde pushed a commit that referenced this pull request May 22, 2025
This fixes some content that was added in
#13752:

1. Moves logs down below tracing, as that is IMHO more important (and
stable - logs is still experimental 😬 ) (should not affect LLMs too
much, but for consistency sake with other things...)
2. Remove the line about adding the `logger` integration, which does not
exist
3. Fix the tracing snippets to be better - what we recommended there was
actually not what we would want users to do.
@github-actions github-actions bot locked and limited conversation to collaborators Jun 6, 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.

Prototype adding rules copy to react SDK docs

4 participants