Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
superwall-docs-staging | 8ea2545 | Commit Preview URL Branch Preview URL |
Mar 17 2026, 09:08 PM |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ea2545885
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (baseSegments.length > 1) { | ||
| baseSegments.pop(); | ||
| } |
There was a problem hiding this comment.
Preserve section path when resolving links from index pages
resolveRelativeDocsPath always removes the last segment of currentDocPath, but buildDocsPathFromSourceFile already strips /index from index files. For an index page like /content/docs/ios/index.mdx, a relative link such as ./quickstart/install is rewritten to /docs/quickstart/install instead of /docs/ios/quickstart/install, so relative links authored in section landing pages are canonicalized to the wrong destination.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| function mergeResolvedUrl(input: string, query: string, hash: string): string { | ||
| const { pathPart, query: resolvedQuery, hash: resolvedHash } = splitUrlParts(input); | ||
| return `${pathPart}${resolvedQuery || query}${resolvedHash || hash}`; | ||
| } |
There was a problem hiding this comment.
Stale hash appended to external redirect URLs
Low Severity
mergeResolvedUrl falls back to the original hash argument when the input string has no hash. Since canonicalizeDocsPathname only ever receives and returns pure pathnames, its return value never contains a hash, making resolvedHash always "". When canonicalizeDocsPathname resolves a path to an external URL (e.g. /docs/troubleshooting → https://support.superwall.com/...), any non-aliased hash from the original input (e.g. #some-section) gets appended to that external URL, producing an incorrect href like https://support.superwall.com/...#some-section.
| }, [pathname, hash]); | ||
|
|
||
| return null; | ||
| } |
There was a problem hiding this comment.
Runtime hash redirect never fires on canonical paths
Low Severity
LegacyDocsLinkRedirects calls resolveDocsLinkAlias(fullPath, hash) where fullPath is built from TanStack Router's already-basepath-stripped pathname. For a full-page navigation to an old URL like /docs/campaigns-audience#matching-to-entitlements, the server middleware redirects the path to /docs/dashboard/dashboard-campaigns/campaigns-audience, and the browser appends the original fragment. The component then sees the canonical path plus the stale hash, but DOCS_LINK_ALIASES only has the old pre-redirect path as its key — so no alias matches and the stale hash is never corrected. The intent of the PR ("runtime fallback for old hash links") is thus unmet for any alias where the page path itself also changed.


This updates docs URL normalization so legacy aliases, stale hashes, and relative MDX links canonicalize to the right /docs destinations, with a runtime fallback for old hash links. It adds two validation layers: a next-validate-link source check in bun test and a built-site HTML crawler in bun run build that fails on missing internal paths or fragment IDs. The branch also fixes the Android broken fragment, refreshes the iOS local resources and variable reference docs, updates AGENTS.md for the TanStack Start/Vite stack, and disables the Cloudflare inspector that was causing Miniflare EPIPE failures during prerender.
Resolves SW-4876.
Note
Medium Risk
Moderate risk because it changes URL normalization/redirect behavior and makes
bun run buildfail on broken internal links, which could impact navigation and CI if edge cases are missed.Overview
Improves internal docs link stability by expanding
normalizeDocsInternalHrefto canonicalize legacy paths/hashes, resolve relative MDX links (with file context), and apply redirect/alias maps, with updates toremark-link-pathsand a runtimeLegacyDocsLinkRedirectsfallback for old hash-only links.Adds automated link validation:
next-validate-linkchecks for source MD/MDX (check:links:source, plus a new test) and a post-build HTML crawl (check:links) that fails the build on missing internal paths or fragment IDs. Also updates docs content (iOS local resources page, variable reference table formatting, Android fragment fix), updatesAGENTS.mdfor the Vite/Start stack, and disables the Cloudflare inspector port to avoid prerenderEPIPEissues.Written by Cursor Bugbot for commit 8ea2545. This will update automatically on new commits. Configure here.