Skip to content

Fixing JS framework formatting for redirect pages - #14914

Merged
a-hariti merged 9 commits into
masterfrom
platform-redirect-privacy-fix
Jan 7, 2026
Merged

Fixing JS framework formatting for redirect pages#14914
a-hariti merged 9 commits into
masterfrom
platform-redirect-privacy-fix

Conversation

@sfanahata

@sfanahata sfanahata commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

DESCRIBE YOUR PR

Summary
Enhanced the platform redirect system to show individual JavaScript frameworks (React, Vue, Angular, etc.) as separate, nested options under the main JavaScript platform. This provides users with a more customized and framework-specific experience when selecting their platform. Also added better logic to check for guide paths because Dart also wasn't showing up due to being nested.

Problem
When users clicked platform-redirect links (like /platform-redirect/?next=/session-replay/privacy/), they only saw top-level platforms (JavaScript, Android, React Native). This didn't reflect that many JavaScript frameworks have different support levels for specific features, and users couldn't easily select their specific framework for a more tailored experience. They also did not see Dart, which was nested under a Dart/Flutter guide.

Solution

  • Automatic Framework Detection: The system now reads the notSupported frontmatter from JavaScript documentation pages to determine which frameworks support each feature. Added more robust logic to search for guides under each platform if main platform paths are empty.

  • Visual Nesting: JavaScript frameworks are indented under the main JavaScript platform for clear hierarchy
    Smart Positioning: JavaScript and its frameworks appear at the end of the platform list
    Framework-Specific URLs: Each framework links to the main JavaScript documentation for that feature

Example pages:
https://sentry-docs-git-platform-redirect-privacy-fix.sentry.dev/platform-redirect/?next=/session-replay/configuration/#network-details

https://sentry-docs-git-platform-redirect-privacy-fix.sentry.dev/platform-redirect/?next=/session-replay/privacy/

IS YOUR CHANGE URGENT?

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

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

@vercel

vercel Bot commented Sep 12, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
develop-docs Ready Ready Preview, Comment Jan 7, 2026 9:38pm
sentry-docs Ready Ready Preview, Comment Jan 7, 2026 9:38pm

cursor[bot]

This comment was marked as outdated.

@codecov

codecov Bot commented Sep 12, 2025

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 608 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 10.16MB -6 bytes (-0.0%) ⬇️
sentry-docs-server-cjs 12.98MB 614 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.78MB -0.0%
../instrumentation.js -3 bytes 1.1MB -0.0%
9523.js -3 bytes 1.08MB -0.0%
../app/platform-redirect/page.js 623 bytes 32.85kB 1.93%

Files in ../app/platform-redirect/page.js:

  • ./app/platform-redirect/page.tsx → Total Size: 9.29kB

App Routes Affected:

App Route Size Change Total Size Change (%)
/platform-redirect 623 bytes 2.78MB 0.02%
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/middleware-*.js -6.46kB 1.0kB -86.59%
server/middleware-*.js 6.46kB 7.46kB 645.5% ⚠️
static/p39MenUyK8GGRVwZtIR2b/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/p39MenUyK8GGRVwZtIR2b/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/XxsFjN9f5OlN_Z_meDR5_/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/XxsFjN9f5OlN_Z_meDR5_/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

cursor[bot]

This comment was marked as outdated.

@sfanahata

Copy link
Copy Markdown
Contributor Author

@chargome and @a-hariti - mind giving this a second set of eyes?

@a-hariti a-hariti left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall I love the end result 😍

We should just make the solution more generic and clean up the filter logic and unnecessary mutations (as per my other comments)

PS: I can implement my suggested changes if you want 🤙 @sfanahata

Comment thread app/platform-redirect/page.tsx Outdated
Comment thread app/platform-redirect/page.tsx Outdated
@sfanahata

Copy link
Copy Markdown
Contributor Author

We should just make the solution more generic and clean up the filter logic and unnecessary mutations (as per my other comments)

PS: I can implement my suggested changes if you want 🤙 @sfanahata

@a-hariti - Yes please, if it doesn't feel like too much extra work, I'd love for you to take on the changes. Vibe coding obvs only gets me so far. 😊

@sfanahata

Copy link
Copy Markdown
Contributor Author

@a-hariti - any updates on progress here?

cursor[bot]

This comment was marked as outdated.

@sfanahata
sfanahata requested a review from a-hariti October 20, 2025 19:59
@vercel

vercel Bot commented Oct 20, 2025

Copy link
Copy Markdown

Deployment failed with the following error:

Failed to create deployment for team_X2wL9ydOZqI86I3fHzJ6dmXs in project prj_aRQDRhyK5TJkXbwkuzkvO5ObUJPS: FetchError: request to https://76.76.21.112/v13/now/deployments?ownerId=team_X2wL9ydOZqI86I3fHzJ6dmXs&projectId=prj_aRQDRhyK5TJkXbwkuzkvO5ObUJPS&skipAutoDetectionConfirmation=1&teamId=team_X2wL9ydOZqI86I3fHzJ6dmXs&traceCarrier=%7B%22ot-baggage-webhookAt%22%3A%221760990069440%22%2C%22ot-baggage-senderUsername%22%3A%22gh.getsantry%5Bbot%5D%22%2C%22baggage%22%3A%22webhookAt%3D1760990069440%2CsenderUsername%3Dgh.getsantry%255Bbot%255D%22%2C%22x-datadog-trace-id%22%3A%226808781116258274357%22%2C%22x-datadog-parent-id%22%3A%223704648612256075727%22%2C%22x-datadog-sampling-priority%22%3A%222%22%2C%22x-datadog-tags%22%3A%22_dd.p.tid%3D68f6937500000000%2C_dd.p.dm%3D-3%22%2C%22traceparent%22%3A%2200-68f69375000000005e7da659cbf64c35-33698e48e72acfcf-01%22%2C%22tracestate%22%3A%22dd%3Dt.tid%3A68f6937500000000%3Bt.dm%3A-3%3Bs%3A2%3Bp%3A33698e48e72acfcf%22%7D failed, reason: socket hang up

@vercel

vercel Bot commented Oct 20, 2025

Copy link
Copy Markdown

Deployment failed with the following error:

Failed to create deployment for team_X2wL9ydOZqI86I3fHzJ6dmXs in project QmPQTZgdNJZfrj9vUb8rCCZ75RT3Yd8xYrJdmJb6SgzypE: FetchError: request to https://76.76.21.112/v13/now/deployments?ownerId=team_X2wL9ydOZqI86I3fHzJ6dmXs&projectId=QmPQTZgdNJZfrj9vUb8rCCZ75RT3Yd8xYrJdmJb6SgzypE&skipAutoDetectionConfirmation=1&teamId=team_X2wL9ydOZqI86I3fHzJ6dmXs&traceCarrier=%7B%22ot-baggage-webhookAt%22%3A%221760990069440%22%2C%22ot-baggage-senderUsername%22%3A%22gh.getsantry%5Bbot%5D%22%2C%22baggage%22%3A%22webhookAt%3D1760990069440%2CsenderUsername%3Dgh.getsantry%255Bbot%255D%22%2C%22x-datadog-trace-id%22%3A%226808781116258274357%22%2C%22x-datadog-parent-id%22%3A%226166993005515737456%22%2C%22x-datadog-sampling-priority%22%3A%222%22%2C%22x-datadog-tags%22%3A%22_dd.p.tid%3D68f6937500000000%2C_dd.p.dm%3D-3%22%2C%22traceparent%22%3A%2200-68f69375000000005e7da659cbf64c35-55958f76e2158970-01%22%2C%22tracestate%22%3A%22dd%3Dt.tid%3A68f6937500000000%3Bt.dm%3A-3%3Bs%3A2%3Bp%3A55958f76e2158970%22%7D failed, reason: socket hang up

@a-hariti
a-hariti enabled auto-merge (squash) January 7, 2026 21:36
@a-hariti
a-hariti merged commit 314201d into master Jan 7, 2026
16 checks passed
@a-hariti
a-hariti deleted the platform-redirect-privacy-fix branch January 7, 2026 21:38
if (isValidPlatform) {
return redirect(`/platforms/${requestedPlatform}${pathname}`);
if (validPlatform) {
return redirect(`${validPlatform.url}${pathname}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Double slashes in redirect URLs due to concatenation

High Severity

The URL construction creates double slashes. validPlatform.url ends with a trailing slash (e.g., /platforms/javascript/ from nodeToPlatform which uses '/' + n.path + '/'), and pathname starts with a leading slash (from sanitizeNext which ensures paths start with /). Concatenating them produces URLs like /platforms/javascript//session-replay/privacy/. The old code avoided this by using /platforms/${key}${pathname} where key had no trailing slash.

Additional Locations (1)

Fix in Cursor Fix in Web

filteredGuides = supportedGuides.filter(
guide => !notSupported.includes(`${platformEntry.key}.${guide.name}`)
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing supported whitelist filtering for guides

Medium Severity

The filtering logic only checks notSupported frontmatter but ignores the supported frontmatter field. The isSupported function in frontmatter.ts treats supported as a whitelist - when defined, only explicitly listed platforms/guides are supported. Pages like apple/enriching-events/screenshots have supported: ["apple.ios", "apple.visionos"], meaning only those guides should appear. The new code would show any guide with a valid path that's not in notSupported, ignoring the whitelist and potentially displaying guides that explicitly should be hidden.

Fix in Cursor Fix in Web

@vercel

vercel Bot commented Jan 17, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Creating the Deployment Timed Out.

@github-actions github-actions Bot locked and limited conversation to collaborators Feb 1, 2026
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.

2 participants