Skip to content
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

fix(platform): Update onboarding options on tab switch #12913

Merged
merged 2 commits into from
Mar 7, 2025

Conversation

chargome
Copy link
Member

@chargome chargome commented Mar 4, 2025

  • Sync selected onboarding options to codeContext
  • Export reusable function from onboarding options to update code snippets
  • In code tabs, trigger the function on tabSwitch based on the globally synced options

closes #12726

@chargome chargome self-assigned this Mar 4, 2025
Copy link

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

@chargome chargome requested a review from a-hariti March 4, 2025 14:16
Copy link

codecov bot commented Mar 4, 2025

Bundle Report

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

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 10.55MB 1.12kB (0.01%) ⬆️
sentry-docs-client-array-push 9.39MB 298 bytes (0.0%) ⬆️

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.57MB -0.0%
../instrumentation.js -3 bytes 904.32kB -0.0%
9523.js -3 bytes 880.37kB -0.0%
../app/[[...path]]/page.js 1.05kB 533.81kB 0.2%
2065.js 77 bytes 81.56kB 0.09%

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

  • ./src/components/codeTabs.tsx → Total Size: 5.58kB

  • ./src/components/codeTabs.tsx → Total Size: 444 bytes

  • ./src/components/onboarding/index.tsx → Total Size: 10.66kB

  • ./src/components/onboarding/index.tsx → Total Size: 1.39kB

Files in 2065.js:

  • ./src/components/codeContext.tsx → Total Size: 2.47kB

  • ./src/components/codeContext.tsx → Total Size: 8.49kB

App Routes Affected:

App Route Size Change Total Size Change (%)
/[[...path]] 1.05kB 3.08MB 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.18kB -0.0%
static/css/*.css 1.46kB 14.17kB 11.5% ⚠️
static/css/*.css 1.63kB 18.67kB 9.58% ⚠️
static/css/*.css -3.09kB 12.71kB -19.57%
static/chunks/3319-*.js -3 bytes 393.41kB -0.0%
static/chunks/app/[[...path]]/page-*.js 227 bytes 74.38kB 0.31%
static/chunks/818-*.js 77 bytes 42.23kB 0.18%
static/3C-*.js (New) 77 bytes 77 bytes 100.0% 🚀
static/3C-*.js (New) 578 bytes 578 bytes 100.0% 🚀
static/PZ9ekHoLOeZEwJOc1PUUA/_buildManifest.js (Deleted) -578 bytes 0 bytes -100.0% 🗑️
static/PZ9ekHoLOeZEwJOc1PUUA/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

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

  • ./src/components/codeTabs.tsx → Total Size: 6.41kB

  • ./src/components/onboarding/index.tsx → Total Size: 11.5kB

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

  • ./src/components/codeContext.tsx → Total Size: 9.16kB

Copy link
Contributor

@stephanie-anderson stephanie-anderson left a comment

Choose a reason for hiding this comment

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

Thank you, @chargome !

@kahest
Copy link
Member

kahest commented Mar 7, 2025

@chargome thanks for tackling this! just want to add that refreshing the page on a different tab than the first also shows the same behaviour

@chargome chargome marked this pull request as draft March 7, 2025 10:47
@chargome
Copy link
Member Author

chargome commented Mar 7, 2025

@kahest not sure what you mean exactly, can you give me an example?

@kahest
Copy link
Member

kahest commented Mar 7, 2025

@chargome on the iOS docs for example, go to the Objective-C tab - it will initially show 2 superfluous empty lines which should be hidden:
Screenshot 2025-03-07 at 15 50 24

Toggling e.g. Tracing on/off shows the correct state:
Screenshot 2025-03-07 at 15 55 09

After refreshing the page though, the original behaviour shows:
Screenshot 2025-03-07 at 15 55 19

It's not a huge problem, but it seems likely to have the same root cause and would be nice to fix in this PR if possible.

@chargome
Copy link
Member Author

chargome commented Mar 7, 2025

@kahest I think this is already solved with this pr: https://sentry-docs-git-cg-fix-onboarding-options-java.sentry.dev/platforms/apple/guides/ios/

@kahest
Copy link
Member

kahest commented Mar 7, 2025

@chargome yes, perfect 🥇

@chargome chargome marked this pull request as ready for review March 7, 2025 15:24
@chargome chargome merged commit 074644f into master Mar 7, 2025
13 checks passed
@chargome chargome deleted the cg/fix-onboarding-options-java branch March 7, 2025 15:25
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.

Toggled features in docs do not have their line range applied when switching between languages
3 participants