-
Notifications
You must be signed in to change notification settings - Fork 13k
chore: Move InfoPanel component to ui-client package
#37701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
WalkthroughThis PR migrates InfoPanel components from local module paths to the centralized Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.stories.tsx (1)
11-18: EnsurefakeRoomdata is deterministic for snapshot-driven tests.
fakeRoomis created once at module load viacreateFakeRoom(), which internally relies on faker. Unless faker is globally seeded elsewhere, Story-rendered markup may vary between runs and make Jest snapshots (which consume these stories) flaky. Consider either:
- passing explicit, fixed overrides into
createFakeRoom(...)so the rendered content is stable, or- seeding faker in a shared test/setup file before these stories are imported.
apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.spec.tsx (1)
9-23: Tighten timer handling and async usage in tests.The first test switches to fake timers and sets a fixed system time, while the second switches back to real timers for
jest-axe. This works, but future tests in this file could be affected if they assume a default timer mode. Consider centralizing timer setup/teardown (e.g., inbeforeEach/afterEach) and/or explicitly restoring timers at the end of the first test, and drop the unnecessaryasyncon the first test since nothing is awaited.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (2)
apps/meteor/client/components/InfoPanel/__snapshots__/RetentionPolicyCallout.spec.tsx.snapis excluded by!**/*.snappackages/ui-client/src/components/InfoPanel/__snapshots__/InfoPanel.spec.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (16)
apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.spec.tsx(1 hunks)apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.stories.tsx(1 hunks)apps/meteor/client/components/UserInfo/UserInfo.tsx(2 hunks)apps/meteor/client/views/admin/deviceManagement/DeviceManagementInfo/DeviceManagementInfo.tsx(1 hunks)apps/meteor/client/views/omnichannel/additionalForms/MaxChatsPerAgentDisplay.tsx(1 hunks)apps/meteor/client/views/omnichannel/agents/AgentInfo.tsx(1 hunks)apps/meteor/client/views/omnichannel/components/CustomField.tsx(1 hunks)apps/meteor/client/views/omnichannel/directory/calls/contextualBar/InfoField.tsx(1 hunks)apps/meteor/client/views/omnichannel/directory/calls/contextualBar/VoipInfo.tsx(1 hunks)apps/meteor/client/views/omnichannel/directory/chats/ChatInfo/ChatInfo.tsx(1 hunks)apps/meteor/client/views/room/contextualBar/Info/RoomInfo/ABAC/RoomInfoABACSection.tsx(1 hunks)apps/meteor/client/views/room/contextualBar/Info/RoomInfo/RoomInfo.tsx(1 hunks)apps/meteor/client/views/room/contextualBar/Info/RoomInfo/RoomInfoActions.tsx(1 hunks)apps/meteor/client/views/teams/contextualBar/info/TeamsInfo.tsx(1 hunks)packages/ui-client/src/components/InfoPanel/InfoPanel.stories.tsx(0 hunks)packages/ui-client/src/components/index.ts(1 hunks)
💤 Files with no reviewable changes (1)
- packages/ui-client/src/components/InfoPanel/InfoPanel.stories.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
apps/meteor/client/views/omnichannel/agents/AgentInfo.tsxapps/meteor/client/components/InfoPanel/RetentionPolicyCallout.spec.tsxapps/meteor/client/components/InfoPanel/RetentionPolicyCallout.stories.tsxapps/meteor/client/views/omnichannel/directory/chats/ChatInfo/ChatInfo.tsxapps/meteor/client/components/UserInfo/UserInfo.tsxapps/meteor/client/views/room/contextualBar/Info/RoomInfo/RoomInfoActions.tsxapps/meteor/client/views/room/contextualBar/Info/RoomInfo/RoomInfo.tsxpackages/ui-client/src/components/index.tsapps/meteor/client/views/room/contextualBar/Info/RoomInfo/ABAC/RoomInfoABACSection.tsxapps/meteor/client/views/omnichannel/directory/calls/contextualBar/VoipInfo.tsxapps/meteor/client/views/teams/contextualBar/info/TeamsInfo.tsxapps/meteor/client/views/admin/deviceManagement/DeviceManagementInfo/DeviceManagementInfo.tsxapps/meteor/client/views/omnichannel/additionalForms/MaxChatsPerAgentDisplay.tsxapps/meteor/client/views/omnichannel/directory/calls/contextualBar/InfoField.tsxapps/meteor/client/views/omnichannel/components/CustomField.tsx
🧠 Learnings (14)
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files
Applied to files:
apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts
Applied to files:
apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests
Applied to files:
apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.step()` for complex test scenarios to improve organization in Playwright tests
Applied to files:
apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases in Playwright tests
Applied to files:
apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,spec.ts} : Follow Page Object Model pattern consistently in Playwright tests
Applied to files:
apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Prefer web-first assertions (`toBeVisible`, `toHaveText`, etc.) in Playwright tests
Applied to files:
apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file
Applied to files:
apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure clean state for each test execution in Playwright tests
Applied to files:
apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.spec.ts : Use descriptive test names that clearly communicate expected behavior in Playwright tests
Applied to files:
apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.spec.tsx
📚 Learning: 2025-11-17T15:07:13.273Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37398
File: packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx:357-363
Timestamp: 2025-11-17T15:07:13.273Z
Learning: In packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx, IconElement is a presentational, non-actionable element that does not require wrapping in AppIdProvider, similar to plain_text and mrkdwn renderers. Only actionable elements (those with actions, actionId, or interactive behavior) should be wrapped in AppIdProvider.
Applied to files:
apps/meteor/client/components/UserInfo/UserInfo.tsxapps/meteor/client/views/room/contextualBar/Info/RoomInfo/RoomInfoActions.tsx
📚 Learning: 2025-10-28T16:53:42.761Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37205
File: ee/packages/federation-matrix/src/FederationMatrix.ts:296-301
Timestamp: 2025-10-28T16:53:42.761Z
Learning: In the Rocket.Chat federation-matrix integration (ee/packages/federation-matrix/), the createRoom method from rocket.chat/federation-sdk will support a 4-argument signature (userId, roomName, visibility, displayName) in newer versions. Code using this 4-argument call is forward-compatible with planned library updates and should not be flagged as an error.
Applied to files:
apps/meteor/client/views/room/contextualBar/Info/RoomInfo/RoomInfoActions.tsxapps/meteor/client/views/room/contextualBar/Info/RoomInfo/RoomInfo.tsxapps/meteor/client/views/room/contextualBar/Info/RoomInfo/ABAC/RoomInfoABACSection.tsx
📚 Learning: 2025-11-27T17:56:26.050Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37557
File: apps/meteor/client/views/admin/ABAC/AdminABACRooms.tsx:115-116
Timestamp: 2025-11-27T17:56:26.050Z
Learning: In Rocket.Chat, the GET /v1/abac/rooms endpoint (implemented in ee/packages/abac/src/index.ts) only returns rooms where abacAttributes exists and is not an empty array (query: { abacAttributes: { $exists: true, $ne: [] } }). Therefore, in components consuming this endpoint (like AdminABACRooms.tsx), room.abacAttributes is guaranteed to be defined for all returned rooms, and optional chaining before calling array methods like .join() is sufficient without additional null coalescing.
Applied to files:
apps/meteor/client/views/room/contextualBar/Info/RoomInfo/ABAC/RoomInfoABACSection.tsx
📚 Learning: 2025-11-19T18:20:07.720Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: packages/i18n/src/locales/en.i18n.json:918-921
Timestamp: 2025-11-19T18:20:07.720Z
Learning: Repo: RocketChat/Rocket.Chat — i18n/formatting
Learning: This repository uses a custom message formatting parser in UI blocks/messages; do not assume standard Markdown rules. For keys like Call_ended_bold, Call_not_answered_bold, Call_failed_bold, and Call_transferred_bold in packages/i18n/src/locales/en.i18n.json, retain the existing single-asterisk emphasis unless maintainers request otherwise.
Applied to files:
apps/meteor/client/views/omnichannel/additionalForms/MaxChatsPerAgentDisplay.tsx
🧬 Code graph analysis (1)
apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.stories.tsx (1)
apps/meteor/tests/mocks/data.ts (1)
createFakeRoom(46-61)
⏰ 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). (18)
- GitHub Check: 🔨 Test UI (EE) / MongoDB 5.0 (4/5)
- GitHub Check: 🔨 Test UI (EE) / MongoDB 5.0 (5/5)
- GitHub Check: 🔨 Test UI (EE) / MongoDB 8.2 [legacy watchers] coverage (2/5)
- GitHub Check: 🔨 Test UI (EE) / MongoDB 5.0 (3/5)
- GitHub Check: 🔨 Test UI (EE) / MongoDB 5.0 (2/5)
- GitHub Check: 🔨 Test UI (CE) / MongoDB 8.2 (4/4)
- GitHub Check: 🔨 Test UI (EE) / MongoDB 5.0 (1/5)
- GitHub Check: 🔨 Test UI (CE) / MongoDB 8.2 (2/4)
- GitHub Check: 🔨 Test API (EE) / MongoDB 8.2 coverage (1/1)
- GitHub Check: 🔨 Test UI (CE) / MongoDB 8.2 (3/4)
- GitHub Check: 🔨 Test UI (CE) / MongoDB 8.2 (1/4)
- GitHub Check: 🔨 Test API (EE) / MongoDB 5.0 (1/1)
- GitHub Check: 🔨 Test UI (EE) / MongoDB 8.2 [legacy watchers] coverage (5/5)
- GitHub Check: 🔨 Test UI (EE) / MongoDB 8.2 [legacy watchers] coverage (3/5)
- GitHub Check: 🔨 Test UI (EE) / MongoDB 8.2 [legacy watchers] coverage (4/5)
- GitHub Check: 🔨 Test UI (EE) / MongoDB 8.2 [legacy watchers] coverage (1/5)
- GitHub Check: 🔨 Test API (CE) / MongoDB 8.2 (1/1)
- GitHub Check: 🔨 Test Federation Matrix
🔇 Additional comments (14)
apps/meteor/client/views/omnichannel/components/CustomField.tsx (1)
1-3: Import migration to@rocket.chat/ui-clientis correct and completeThe refactor cleanly switches
InfoPanelField,InfoPanelLabel, andInfoPanelTextto the shared@rocket.chat/ui-clientpackage. The components are properly exported frompackages/ui-client/src/components/InfoPanel/index.tsand re-exported at the package root viaexport * from './components', making the import valid. No remaining imports of these three components from the old path exist in the codebase.packages/ui-client/src/components/index.ts (1)
23-23: LGTM! Clean barrel export addition.The InfoPanel export follows the established pattern in this index file and properly exposes InfoPanel components through the public API.
apps/meteor/client/views/omnichannel/additionalForms/MaxChatsPerAgentDisplay.tsx (1)
1-1: LGTM! Import successfully migrated to ui-client package.The import source change from local path to
@rocket.chat/ui-clientis clean and aligns with the PR's objective to centralize InfoPanel components.apps/meteor/client/views/omnichannel/agents/AgentInfo.tsx (1)
8-10: LGTM! InfoPanel components properly migrated.The import migration to
@rocket.chat/ui-clientis correct and maintains existing functionality.apps/meteor/client/views/teams/contextualBar/info/TeamsInfo.tsx (1)
4-24: LGTM! Import reorganization completed successfully.The migration of InfoPanel components to
@rocket.chat/ui-clientis clean. The import block is well-organized and all necessary components are properly sourced from the centralized package.apps/meteor/client/views/omnichannel/directory/calls/contextualBar/InfoField.tsx (1)
1-1: LGTM! Import migrated correctly.Clean migration of InfoPanel components to the centralized
@rocket.chat/ui-clientpackage.apps/meteor/client/views/room/contextualBar/Info/RoomInfo/ABAC/RoomInfoABACSection.tsx (1)
3-3: LGTM! Import source updated correctly.The migration to
@rocket.chat/ui-clientis clean and maintains existing functionality.apps/meteor/client/components/UserInfo/UserInfo.tsx (1)
3-21: LGTM! Comprehensive import reorganization completed.The migration successfully moves all InfoPanel components to
@rocket.chat/ui-clientwhile properly organizing the import block. The reorganization improves code maintainability without affecting functionality.apps/meteor/client/views/omnichannel/directory/chats/ChatInfo/ChatInfo.tsx (1)
4-4: LGTM! Import consolidation successful.The migration consolidates InfoPanel component imports into the
@rocket.chat/ui-clientpackage, improving import organization while maintaining existing functionality.apps/meteor/client/views/omnichannel/directory/calls/contextualBar/VoipInfo.tsx (1)
12-16: InfoPanel imports correctly migrated to@rocket.chat/ui-client.Importing
InfoPaneland related components from the ui-client barrel keeps usage unchanged and aligns with the centralization goal; nothing else in this file needs adjustment.apps/meteor/client/views/admin/deviceManagement/DeviceManagementInfo/DeviceManagementInfo.tsx (1)
10-14: Centralizing InfoPanel imports looks good.Switching
InfoPanel*to the@rocket.chat/ui-clientbarrel is consistent with the rest of the PR and keeps the component’s behavior intact in this file.apps/meteor/client/views/room/contextualBar/Info/RoomInfo/RoomInfoActions.tsx (1)
2-2:InfoPanelActionimport migration is consistent and safe.Using
InfoPanelActionfrom@rocket.chat/ui-clientmatches the new pattern and doesn’t alter howRoomInfoActionsrenders its actions.apps/meteor/client/views/room/contextualBar/Info/RoomInfo/RoomInfo.tsx (1)
21-25: InfoPanel and related imports correctly consolidated.Importing all
Contextualbar*andInfoPanel*pieces from@rocket.chat/ui-client, alongside the explicituseTranslationandRoomInfoActionsimports, keepsRoomInfobehavior intact and aligns with the new barrel usage.apps/meteor/client/components/InfoPanel/RetentionPolicyCallout.spec.tsx (1)
1-15: Story-driven, per-variant tests look solid.Using
composeStorieswithtestCasesto exercise each RetentionPolicyCallout story, plus per-story snapshots, is a good way to keep tests aligned with Storybook variants.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #37701 +/- ##
===========================================
+ Coverage 67.89% 68.78% +0.89%
===========================================
Files 3449 3362 -87
Lines 114020 114173 +153
Branches 20956 20612 -344
===========================================
+ Hits 77410 78538 +1128
+ Misses 34491 33537 -954
+ Partials 2119 2098 -21
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
dougfabris
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Proposed changes (including videos or screenshots)
Issue(s)
VGA-98
Steps to test or reproduce
Further comments
Summary by CodeRabbit
Tests
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.