Skip to content

refactor: mark props as readonly in multiple frontend components#3426

Merged
arkid15r merged 4 commits intoOWASP:mainfrom
ThetaLogN:refactor/frontend-readonly-props-v2
Jan 20, 2026
Merged

refactor: mark props as readonly in multiple frontend components#3426
arkid15r merged 4 commits intoOWASP:mainfrom
ThetaLogN:refactor/frontend-readonly-props-v2

Conversation

@ThetaLogN
Copy link
Contributor

Resolves #3418

This PR refactors 7 components to ensure that properties are marked as read-only.

Changes applied to:

  • GlobalError
  • UserDetailsLayout
  • ProjectsLayout
  • LogoCarousel
  • MarkdownWrapper
  • NavDropDown
  • Providers

Checklist

  • Required: I followed the contributing workflow
  • Required: I verified that my code works as intended and resolves the issue as described
  • Required: I ran make check-test locally: all warnings addressed, tests passed
  • I used AI for code, documentation, tests, or communication related to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

Summary by CodeRabbit

  • Refactor
    • Enhanced type safety across React components by enforcing immutability constraints on component props at the type level. No changes to user-facing functionality or behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Wraps props type annotations with Readonly<> across seven frontend React components, changing parameter types to immutable Readonly-wrapped objects. No runtime logic or control-flow changes.

Changes

Cohort / File(s) Summary
App layout components
frontend/src/app/global-error.tsx, frontend/src/app/members/[memberKey]/layout.tsx, frontend/src/app/projects/layout.tsx
Component prop parameter types changed to Readonly<...> (e.g., { error: Error }Readonly<{ error: Error }>).
UI components
frontend/src/components/LogoCarousel.tsx, frontend/src/components/MarkdownWrapper.tsx, frontend/src/components/NavDropDown.tsx
Props parameter types updated to Readonly<...> for MovingLogos, Markdown, and NavDropdown.
Provider wrapper
frontend/src/wrappers/provider.tsx
Providers component props updated to Readonly<{ children: React.ReactNode }>.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • kasya
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: marking props as readonly in multiple frontend components, which is the primary objective of the changeset.
Description check ✅ Passed The description is clearly related to the changeset, specifying the issue resolved, the components affected, and confirming the author followed the contributing workflow and ran tests.
Linked Issues check ✅ Passed The PR successfully addresses issue #3418 by applying Readonly type wrapping to props in all seven specified components: GlobalError, UserDetailsLayout, ProjectsLayout, LogoCarousel, MarkdownWrapper, NavDropDown, and Providers.
Out of Scope Changes check ✅ Passed All changes are within scope—only type annotations wrapping props with Readonly are modified across the specified seven components, with no unrelated logic or functionality alterations.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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[bot]
coderabbitai bot previously approved these changes Jan 19, 2026
@arkid15r arkid15r enabled auto-merge January 20, 2026 03:39
@sonarqubecloud
Copy link

@arkid15r arkid15r added this pull request to the merge queue Jan 20, 2026
Merged via the queue into OWASP:main with commit d40493f Jan 20, 2026
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Mark props as Readonly in several frontend components

2 participants

Comments