Skip to content

Adding Copyable AI Rule Snippets to Docs #13752

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

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

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

vercel bot commented May 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
changelog ⬜️ Ignored (Inspect) Visit Preview May 19, 2025 9:38am
develop-docs ⬜️ Ignored (Inspect) Visit Preview May 19, 2025 9:38am
sentry-docs ⬜️ Ignored (Inspect) Visit Preview May 19, 2025 9:38am

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

codecov bot commented May 19, 2025

Bundle Report

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

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 11.2MB 1.97kB (0.02%) ⬆️
sentry-docs-client-array-push 9.51MB 1.6kB (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 847 bytes 585.49kB 0.14%
../app/[[...path]]/page.js.nft.json 377 bytes 396.86kB 0.1%
../app/platform-redirect/page.js.nft.json 377 bytes 396.77kB 0.1%
../app/sitemap.xml/route.js.nft.json 377 bytes 394.74kB 0.1%

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

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

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

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

App Routes Affected:

App Route Size Change Total Size Change (%)
/[[...path]] 847 bytes 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 662 bytes 2.15kB 44.4% ⚠️
static/chunks/8165-*.js -3 bytes 410.1kB -0.0%
static/chunks/app/[[...path]]/page-*.js 941 bytes 80.17kB 1.19%
static/13pLMuu6D5KnWtipDH38M/_buildManifest.js (New) 578 bytes 578 bytes 100.0% 🚀
static/13pLMuu6D5KnWtipDH38M/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/RhlzctAoFjw9MF3ZNgxBk/_buildManifest.js (Deleted) -578 bytes 0 bytes -100.0% 🗑️
static/RhlzctAoFjw9MF3ZNgxBk/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

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

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

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prototype adding rules copy to react SDK docs
1 participant