Skip to content

ECHOES-1280 Fix architecture issue ("common" depending on "components")#670

Merged
david-cho-lerat-sonarsource merged 1 commit intomainfrom
david/fix-architecture-issue
Apr 17, 2026
Merged

ECHOES-1280 Fix architecture issue ("common" depending on "components")#670
david-cho-lerat-sonarsource merged 1 commit intomainfrom
david/fix-architecture-issue

Conversation

@david-cho-lerat-sonarsource
Copy link
Copy Markdown
Contributor

@david-cho-lerat-sonarsource david-cho-lerat-sonarsource commented Apr 16, 2026

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 16, 2026

Deploy Preview for echoes-react ready!

Name Link
🔨 Latest commit 045237a
🔍 Latest deploy log https://app.netlify.com/projects/echoes-react/deploys/69e0ef5ef59d4f000879b730
😎 Deploy Preview https://deploy-preview-670--echoes-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@david-cho-lerat-sonarsource david-cho-lerat-sonarsource changed the title Fix architecture issue ("common" dependeding on "components") Fix architecture issue ("common" depending on "components") Apr 16, 2026
@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod Bot changed the title Fix architecture issue ("common" depending on "components") ECHOES-1280 Fix architecture issue ("common" depending on "components") Apr 16, 2026
@hashicorp-vault-sonar-prod
Copy link
Copy Markdown

hashicorp-vault-sonar-prod Bot commented Apr 16, 2026

ECHOES-1280

@sonarqube-next
Copy link
Copy Markdown

@david-cho-lerat-sonarsource david-cho-lerat-sonarsource marked this pull request as ready for review April 16, 2026 14:23
@sonar-review-alpha
Copy link
Copy Markdown

sonar-review-alpha Bot commented Apr 16, 2026

Summary

This PR fixes an architectural layering issue where src/common/components/PromotedSectionStyles.tsx was importing from src/components/badges, causing the lower-level "common" module to depend on the higher-level "components" module.

The fix moves the BADGE_VARIETIES constant from the common layer to src/components/promoted-section/PromotedSection.tsx where it's actually used, along with its direct import of BadgeVariety. This restores proper module layering: only "components" depends on "common", not the reverse.

What reviewers should know

What changed:

  • Removed BADGE_VARIETIES and the cross-layer import from PromotedSectionStyles.tsx
  • Added BADGE_VARIETIES as a local constant in PromotedSection.tsx where it's consumed
  • Updated imports in PromotedSection.tsx to get BadgeVariety directly from ../badges

Why it matters: This prevents "common" from depending on "components", keeping architectural boundaries clean. The constant is only used in PromotedSection, so colocating it there is more appropriate.

To review: Check that the moved constant still has the same values and behavior in its new location, and verify that the BadgeVariety import works correctly.


  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

Copy link
Copy Markdown

@sonar-review-alpha sonar-review-alpha Bot left a comment

Choose a reason for hiding this comment

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

LGTM! ✅

Clean, minimal fix with no issues to flag. The refactor correctly moves BADGE_VARIETIES from the shared common layer to its only consumer, and the addition of as const on the moved constant is a small improvement over the original.

🗣️ Give feedback

@david-cho-lerat-sonarsource david-cho-lerat-sonarsource merged commit 00ada76 into main Apr 17, 2026
12 checks passed
@david-cho-lerat-sonarsource david-cho-lerat-sonarsource deleted the david/fix-architecture-issue branch April 17, 2026 08:20
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.

2 participants