Skip to content

feat: ory network cta for oss only#2634

Merged
wassimoo merged 2 commits into
masterfrom
feat/oss-network-cta-sticky
Jun 19, 2026
Merged

feat: ory network cta for oss only#2634
wassimoo merged 2 commits into
masterfrom
feat/oss-network-cta-sticky

Conversation

@wassimoo

@wassimoo wassimoo commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • I have read the contributing guidelines and signed the CLA.
  • I have referenced an issue containing the design document if my change introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security vulnerability.
    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.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation within the code base (if appropriate).

Summary by CodeRabbit

  • Style

    • Updated the network CTA’s layout, typography, and button sizing for improved spacing and visual alignment
    • Added a theme-consistent sticky-bottom styling for the CTA container
  • Refactor

    • The network CTA now renders only on “Ory Open Source” documentation pages, based on the current route/sidebar context

@wassimoo wassimoo changed the title feat: Ory Network CTA for OSS deployment only feat: ory network cta for oss only Jun 18, 2026
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

OryNetworkCta switches from useBaseUrl fallback to bundler-resolved networkImg import with TypeScript suppression, and updates component styling. TOCWrapper conditionally renders OryNetworkCta only for OSS deployments using a new isOssDeployment helper that checks sidebar labels and pathname. A new .ory-network-cta-sticky CSS rule provides sticky bottom positioning and theming.

Changes

OryNetworkCta OSS gating and refactor

Layer / File(s) Summary
OryNetworkCta image resolution and styling refactor
src/components/OryNetworkCta/ory-network-cta.tsx
Removes useBaseUrl fallback and uses bundler-resolved networkImg PNG import directly as <img src> with // @ts-expect-error`` suppression. Updates anchor, container, image margin, text typography, and button/span sizing Tailwind classes.
Conditional OSS rendering in TOCWrapper with sticky CSS
src/theme/TOC/index.js, src/theme/TOC/index.css
Introduces isOssDeployment(pathname, sidebar) helper that checks for "Ory Open Source" sidebar category label, then falls back to docsDeploymentFromPathname(pathname) === "oss". TOCWrapper renders OryNetworkCta only when isOss is true inside a new .ory-network-cta-sticky container with themed sticky bottom positioning.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐇 Hop, hop, the CTA's tucked away,
Only OSS pages get to see its display.
A sticky footer, themed just right,
Bundler imports resolve the image tight.
The sidebar whispers, "Open Source is here!"
And the bunny nods — the diff is clear. 🌿

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is largely incomplete and lacks critical information. It only includes the uncompleted checklist section while omitting the 'Big Picture', 'Related Issue or Design Document' sections, and concrete details about the feature. Add a 'Big Picture' section explaining the rationale, include a link to the related issue or design document (especially important for new features), and provide context about why this OSS-only CTA was introduced.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'feat: ory network cta for oss only' clearly describes the main change—restricting the Ory Network CTA component to OSS deployments only. It aligns well with the actual code changes across three files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/oss-network-cta-sticky

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/OryNetworkCta/ory-network-cta.tsx (1)

2-2: Replace @ts-expect-error with a typed static-asset module declaration.

Line 2 uses a global TypeScript error suppression for PNG imports. Since the repo has no existing *.png module declaration and webpack handles static assets at build time, add a type declaration file to properly type static imports and remove the suppression. This improves type safety while documenting how the build system resolves these assets.

Create a .d.ts file (e.g., src/types/assets.d.ts) with:

declare module "*.png" {
  const content: string;
  export default content;
}

Then remove the @ts-expect-error comment from line 2.

🤖 Prompt for 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.

In `@src/components/OryNetworkCta/ory-network-cta.tsx` at line 2, To fix the type
safety issue in ory-network-cta.tsx, create a new `.d.ts` file at
`src/types/assets.d.ts` that declares the module type for PNG imports,
specifying that PNG files resolve to string content at build time. Then remove
the `@ts-expect-error` comment from line 2 in the ory-network-cta.tsx file so
that TypeScript will use the proper module declaration instead of suppressing
the error.
🤖 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.

Nitpick comments:
In `@src/components/OryNetworkCta/ory-network-cta.tsx`:
- Line 2: To fix the type safety issue in ory-network-cta.tsx, create a new
`.d.ts` file at `src/types/assets.d.ts` that declares the module type for PNG
imports, specifying that PNG files resolve to string content at build time. Then
remove the `@ts-expect-error` comment from line 2 in the ory-network-cta.tsx
file so that TypeScript will use the proper module declaration instead of
suppressing the error.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1fcf8884-abdb-46b6-844d-d3e5cd4e4f4a

📥 Commits

Reviewing files that changed from the base of the PR and between 68e84f6 and ffc8c3c.

📒 Files selected for processing (1)
  • src/components/OryNetworkCta/ory-network-cta.tsx

@unatasha8 unatasha8 left a comment

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.

LGTM

@wassimoo wassimoo merged commit 658b688 into master Jun 19, 2026
14 checks passed
@wassimoo wassimoo deleted the feat/oss-network-cta-sticky branch June 19, 2026 05:29
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.

3 participants