Skip to content

Conversation

@TomasEng
Copy link
Contributor

@TomasEng TomasEng commented Dec 31, 2025

Description

The menu component in the content library is named PageRouter, but it's not a router. This pull request renames it to Menu.

The image below displays where to find the component in the graphical interface.
image

Verification

  • Related issues are connected (if applicable)
  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • No need to add new tests; refactoring only

Summary by CodeRabbit

  • Refactor

    • Replaced an internal navigation component and reorganised exports within the content library to streamline structure and maintainability.
  • Tests

    • Updated test suites to reflect the internal component reorganisation.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 31, 2025

📝 Walkthrough

Walkthrough

PagesRouter was renamed to Menu across the content library: imports and JSX updated to render Menu, PagesRouter re-export removed, Menu re-export added, and tests updated to reference Menu. Internal component logic and public function signatures remained unchanged.

Changes

Cohort / File(s) Summary
Component Rename
src/Designer/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/Menu/Menu.tsx
Exported component renamed from PagesRouterMenu; local prop type renamed PagesRouterPropsMenuProps. Internal logic unchanged.
Parent Component Update
src/Designer/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/LibraryBody.tsx
Import updated from PagesRouterMenu and JSX changed from <PagesRouter config={config} /><Menu config={config} />.
Index Exports (Added)
src/Designer/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/Menu/index.ts
Added export { Menu } from './Menu'; to expose Menu via the barrel.
Index Exports (Removed)
src/Designer/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/PagesRouter/index.ts
Removed export { PagesRouter } from './PagesRouter';, deleting PagesRouter from the module public API.
Tests
src/Designer/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/Menu/Menu.test.tsx
Tests updated to import and describe Menu instead of PagesRouter; helper renamed renderPagesRouterrenderMenu.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐇 A nimble rename, a tidy little run,
PagesRouter is Menu — a fresh morning sun.
Imports and tests all hopped into place,
Same logic, new name, a soft codebase embrace.
✨🥕

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: renaming the PagesRouter component to Menu to give it a more appropriate name.
Description check ✅ Passed The description includes all required sections: a clear explanation of the change, a visual reference, and a completed verification checklist with appropriate notes about refactoring-only changes.

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

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 721d8a1 and d24d926.

📒 Files selected for processing (3)
  • src/Designer/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/LibraryBody.tsx
  • src/Designer/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/Menu/Menu.test.tsx
  • src/Designer/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/Menu/Menu.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/Designer/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/LibraryBody.tsx
  • src/Designer/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/Menu/Menu.tsx
  • src/Designer/frontend/libs/studio-content-library/src/ContentLibrary/LibraryBody/Menu/Menu.test.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Build environment and run e2e test
  • GitHub Check: Testing
  • GitHub Check: CodeQL
  • GitHub Check: Typechecking and linting

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.

@github-actions github-actions bot added skip-releasenotes Issues that do not make sense to list in our release notes frontend solution/studio/designer labels Dec 31, 2025
@TomasEng TomasEng added area/content-library Area: Related to library for shared resources squad/data Issues that belongs to the named squad. quality/code Violations from current rules for code, best practices, etc. Or just bad code. labels Dec 31, 2025
@TomasEng TomasEng moved this to 👷 In progress in Team Altinn Studio Dec 31, 2025
@TomasEng TomasEng linked an issue Dec 31, 2025 that may be closed by this pull request
6 tasks
@TomasEng TomasEng mentioned this pull request Dec 31, 2025
6 tasks
@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.24%. Comparing base (788c6d9) to head (d24d926).
⚠️ Report is 117 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17345      +/-   ##
==========================================
- Coverage   96.26%   96.24%   -0.03%     
==========================================
  Files        2384     2392       +8     
  Lines       30282    30376      +94     
  Branches     3529     3540      +11     
==========================================
+ Hits        29150    29234      +84     
- Misses        820      832      +12     
+ Partials      312      310       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@TomasEng
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 31, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@TomasEng TomasEng marked this pull request as ready for review December 31, 2025 11:31
@TomasEng TomasEng moved this from 👷 In progress to 🔎 In review in Team Altinn Studio Dec 31, 2025
@Konrad-Simso
Copy link
Contributor

Ser det er noen konflikter, har du mulighet til å løse dem @TomasEng?

@TomasEng TomasEng added the skip-second-approval Pull requests that only need one approval from a reviewer. label Jan 8, 2026
@TomasEng TomasEng merged commit 5e7cdc1 into main Jan 8, 2026
11 checks passed
@TomasEng TomasEng deleted the rename-menu-component-in-library branch January 8, 2026 13:59
@github-project-automation github-project-automation bot moved this from 🔎 In review to ✅ Done in Team Altinn Studio Jan 8, 2026
@TomasEng TomasEng removed their assignment Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/content-library Area: Related to library for shared resources frontend quality/code Violations from current rules for code, best practices, etc. Or just bad code. skip-releasenotes Issues that do not make sense to list in our release notes skip-second-approval Pull requests that only need one approval from a reviewer. solution/studio/designer squad/data Issues that belongs to the named squad.

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Content library refactorings

2 participants