feat: add same deployment link util#2546
Conversation
…eneral ownership
📝 WalkthroughWalkthroughThis pull request introduces path-based deployment resolution for documentation navigation. It adds utilities to infer deployment segments (network, oel, oss) from URLs, a new SameDeploymentLink component for preserving navigation within deployment contexts, and wires deployment awareness through the context system. Documentation and ownership references are also updated. ChangesPath-Based Deployment Infrastructure
Deployment-Aware Navigation Component
Documentation and Configuration Updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/SameDeploymentLink.tsx`:
- Around line 51-55: overrideForCurrentDeployment is only normalized and
therefore bypasses deployment-scoped rewriting; change the href computation so
that when overrideForCurrentDeployment is present you pass the normalized
override through rewriteToCurrentDeployment (e.g. href =
rewriteToCurrentDeployment(normalizePath(overrideForCurrentDeployment))) instead
of using normalizePath(...) alone, keeping the existing fallback to
rewriteToCurrentDeployment(to) when no override exists; use the same symbols
overrideForCurrentDeployment, normalizePath, and rewriteToCurrentDeployment so
the override resolves to a deployment-scoped docs route and avoids broken links.
In `@src/theme/DocRoot/index.js`:
- Around line 83-90: docsDeploymentFromPathname currently returns "network" for
both explicit "/docs/network/..." URLs and default non-segmented routes, which
loses routing intent when only that value is passed to
QuickstartsDeploymentProvider; update the call site in DocRoot (where
docsDeploymentFromPathname(pathname) is computed) to also derive an explicit
flag (e.g. const isNetworkExplicit = pathname.includes('/docs/network/')) and
pass that flag to QuickstartsDeploymentProvider as syncFromInitialDeployment (in
addition to initialDeployment), and then update QuickstartsDeploymentProvider to
gate its useEffect sync on the syncFromInitialDeployment prop (instead of
checking initialDeployment === "network") so picker/sidebar state preserves
explicit-vs-default routing intent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 6fcb5101-f222-4f0b-be18-5d2ac0b8ee17
⛔ Files ignored due to path filters (1)
src/components/Shared/kratos/index.mdxis excluded by!**/*.mdx
📒 Files selected for processing (7)
.github/CODEOWNERSAGENTS.mdsrc/components/SameDeploymentLink.tsxsrc/contexts/QuickstartsDeploymentContext.tsxsrc/theme/DocRoot/index.jssrc/theme/MDXComponents.jssrc/utils/docsDeploymentFromPathname.ts
Related Issue or Design Document
Checklist
If this pull request addresses a security vulnerability,
I confirm that I got approval (please contact security@ory.com) from the maintainers to push the changes.
Further comments
Summary by CodeRabbit
New Features
Documentation