Skip to content

fix: DR-8495 Update blog#7882

Open
carlagn wants to merge 1 commit intomainfrom
fix/DR-8495-blog-fixes
Open

fix: DR-8495 Update blog#7882
carlagn wants to merge 1 commit intomainfrom
fix/DR-8495-blog-fixes

Conversation

@carlagn
Copy link
Copy Markdown
Contributor

@carlagn carlagn commented May 8, 2026

Fixes #DR-8495

Summary by CodeRabbit

  • New Features
    • Footer compliance badges (GDPR, HIPAA, ISO27, SOC2) now support light and dark theme variants for improved visual consistency.
    • Footer component enhanced with support for configurable paths, enabling flexible deployment across different routes.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

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

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment May 8, 2026 9:51am
docs Ready Ready Preview, Comment May 8, 2026 9:51am
eclipse Ready Ready Preview, Comment May 8, 2026 9:51am
site Ready Ready Preview, Comment May 8, 2026 9:51am

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack

Walkthrough

This PR adds basePath configuration to the Footer component and compliance badge exports, enabling dynamic asset URLs for theme-aware (light/dark) badge rendering. Footer accepts an optional basePath prop, badge functions now accept basePath to build image sources, and the blog layout passes basePath="/blog" to Footer.

Changes

Footer basePath Theme Badges

Layer / File(s) Summary
Props Contract
packages/ui/src/components/footer.tsx
FooterProps gains optional basePath?: string field.
Badge Function Implementations
packages/ui/src/components/footer-badges.tsx
gdpr, hipaa, iso27, and soc2 exports change from static JSX elements to functions accepting basePath (default ""), each rendering light/dark badge variants with conditional Tailwind visibility classes.
Footer Component Integration
packages/ui/src/components/footer.tsx
Footer destructures basePath prop and passes it to all four badge helper function calls in the compliance badges section.
Blog Layout Consumer
apps/blog/src/app/(blog)/layout.tsx
Blog Layout passes basePath="/blog" to Footer component.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
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.
Title check ❓ Inconclusive The title 'fix: DR-8495 Update blog' is vague and generic. It doesn't clearly convey what was actually changed—compliance badge refactoring, light/dark mode support, or basePath prop introduction. Use a more specific title that captures the main change, such as 'fix: Add basePath support for blog compliance badges with dark mode variants' or 'fix: Refactor compliance badges to support multiple basePath contexts'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.


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

@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented May 8, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - May 8, 2026, 10:07 AM

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/ui/src/components/footer-badges.tsx (1)

1-83: ⚡ Quick win

Normalize basePath before composing badge URLs.

On Line 4 (and the equivalent src lines), raw concatenation can generate double-slash paths when callers pass a trailing slash (e.g. /blog/). Normalizing once also removes duplication across all badge builders.

Proposed refactor
+const normalizeBasePath = (basePath = "") => basePath.replace(/\/+$/, "");
+const badgeSrc = (basePath: string, fileName: string) =>
+  `${normalizeBasePath(basePath)}/badges/${fileName}`;
+
 export const gdpr = (basePath = "") => (
   <>
     <img
-      src={`${basePath}/badges/gdpr.svg`}
+      src={badgeSrc(basePath, "gdpr.svg")}
       alt="GDPR"
       width={26}
       height={26}
       loading="lazy"
       className="hidden dark:block"
     />
     <img
-      src={`${basePath}/badges/gdpr_light.svg`}
+      src={badgeSrc(basePath, "gdpr_light.svg")}
       alt="GDPR"
       width={26}
       height={26}
       className="block dark:hidden"
       loading="lazy"
     />
   </>
 );
🤖 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 `@packages/ui/src/components/footer-badges.tsx` around lines 1 - 83, Trim any
trailing slashes from the incoming basePath once and reuse the normalized value
in all badge builders to avoid double slashes; add a small helper (e.g.,
normalizeBasePath) that does basePath = (basePath || "").replace(/\/+$/, "") and
then in gdpr, hipaa, iso27, and soc2 compute const p =
normalizeBasePath(basePath) and use `${p}/badges/...` for src, so callers
passing "/blog/" or "/blog" both produce "/blog/badges/..." while an empty
basePath still yields "/badges/...".
🤖 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 `@packages/ui/src/components/footer-badges.tsx`:
- Around line 1-83: Trim any trailing slashes from the incoming basePath once
and reuse the normalized value in all badge builders to avoid double slashes;
add a small helper (e.g., normalizeBasePath) that does basePath = (basePath ||
"").replace(/\/+$/, "") and then in gdpr, hipaa, iso27, and soc2 compute const p
= normalizeBasePath(basePath) and use `${p}/badges/...` for src, so callers
passing "/blog/" or "/blog" both produce "/blog/badges/..." while an empty
basePath still yields "/badges/...".

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9f6fb9ea-cabd-4602-aba7-dc2a2e34d4d6

📥 Commits

Reviewing files that changed from the base of the PR and between 6f3c41d and 5e9f138.

⛔ Files ignored due to path filters (8)
  • apps/blog/public/badges/gdpr.svg is excluded by !**/*.svg
  • apps/blog/public/badges/gdpr_light.svg is excluded by !**/*.svg
  • apps/blog/public/badges/hipaa.svg is excluded by !**/*.svg
  • apps/blog/public/badges/hipaa_light.svg is excluded by !**/*.svg
  • apps/blog/public/badges/iso27.svg is excluded by !**/*.svg
  • apps/blog/public/badges/iso27_light.svg is excluded by !**/*.svg
  • apps/blog/public/badges/soc2.svg is excluded by !**/*.svg
  • apps/blog/public/badges/soc2_light.svg is excluded by !**/*.svg
📒 Files selected for processing (3)
  • apps/blog/src/app/(blog)/layout.tsx
  • packages/ui/src/components/footer-badges.tsx
  • packages/ui/src/components/footer.tsx

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.

1 participant