Skip to content

Conversation

@aleksandernsilva
Copy link
Contributor

@aleksandernsilva aleksandernsilva commented Dec 7, 2025

Proposed changes (including videos or screenshots)

Issue(s)

FB-66

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • New Features

    • Show invitation dates for invited users in member info panels.
    • Add option to revoke pending invitations from user actions.
    • Distinguish invited users from active members across member lists and actions.
  • Localization

    • Added translations for "Invitation date" and "Revoke invitation".

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

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Dec 7, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Dec 7, 2025

⚠️ No Changeset found

Latest commit: faf1beb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 7, 2025

Walkthrough

Adds invitation metadata and invite-state handling across room member and user-info UI: introduces invitationDate and isInvited props, derives invite state from subscription, surfaces an invitation date in UserInfo, and adapts user-action hooks to allow revoking invitations with new i18n keys.

Changes

Cohort / File(s) Change Summary
UserInfo Component & Story
apps/meteor/client/components/UserInfo/UserInfo.tsx, apps/meteor/client/components/UserInfo/UserInfo.stories.tsx
Added optional invitationDate?: string to UserInfo props; conditionally renders an Invitation date InfoPanelField. Added InvitedUser story with invitationDate: '2025-01-01T12:00:00Z'.
Room Members Item
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
Updated props to include subscription; derives isInvited and invitationDate from subscription; adds data-invitationdate attribute; passes isInvited to UserActions.
Room Members Data & Actions
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx, apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersActions.tsx
RoomMembersWithData state refactored from userId → nested user: { id?, invitationDate? }; openUserInfo reads dataset invitationdate. RoomMembersActions accepts isInvited and forwards it to useUserInfoActions (uses isMember: !isInvited).
UserInfo Views & Actions
apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx, apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoActions.tsx
UserInfoWithData now accepts invitationDate?: string, passes invitationDate and isInvited={Boolean(invitationDate)} into UserInfo. UserInfoActions accepts isInvited and forwards it to useUserInfoActions; changed size argument from 3 → 2.
User Action Hooks
apps/meteor/client/views/room/hooks/useUserInfoActions/useUserInfoActions.ts, apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx
Added optional isInvited to UserInfoActionsParams and propagated it through hook calls. useRemoveUserAction gains invited?: boolean param; confirmation text becomes Revoke_invitation when invited; refactored memoization to separate content from permission checks. Removal eligibility expanded to `(isMember
Localization
packages/i18n/src/locales/en.i18n.json
Added Invitation_date: "Invitation date" and Revoke_invitation: "Revoke invitation".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to memoization and conditional-content refactor in useRemoveUserAction.tsx.
  • Verify state shape changes in RoomMembersWithData.tsx (userId → user) across event handlers.
  • Trace prop propagation: RoomMembersItem → UserActions → UserInfoActions → useUserInfoActions → useRemoveUserAction.

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • ggazzo
  • dougfabris

Poem

🐰 I nibble props and hop with glee,
Dates and invites now plain to see,
A tiny badge, a revoke so sweet,
Carrots of code make the flow complete! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The linked issue FB-66 lacks detailed coding requirements, making it impossible to verify whether all objectives were met. Provide detailed requirements from FB-66 to validate that all coding objectives have been implemented.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: Added invitation information to user info contextual bar' accurately summarizes the main change in the PR, which adds invitation-related properties and UI elements across multiple components.
Out of Scope Changes check ✅ Passed All changes are scoped to adding invitation information: new props (invitationDate, isInvited), UI components (InvitedUser story, InvitationBadge), localization keys, and related action handlers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/invitation-user-info

📜 Recent review details

Configuration used: Organization 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 8fcbe66 and faf1beb.

📒 Files selected for processing (1)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.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). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build

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.

@aleksandernsilva aleksandernsilva changed the base branch from develop to feat/invites December 7, 2025 21:09
@aleksandernsilva
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 7, 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.

Copy link
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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/meteor/client/views/hooks/useMembersList.ts (1)

113-146: The endpoint consolidation is incomplete and will fail for direct messages.

The code hardcodes /v1/rooms.membersOrderedByRole for all room types, but this endpoint only supports public channels ('c') and private groups ('p'). Direct messages ('d') require /v1/im.members instead. Add conditional endpoint selection: use /v1/im.members when roomType === 'd', otherwise use /v1/rooms.membersOrderedByRole.

🧹 Nitpick comments (5)
packages/i18n/src/locales/en.i18n.json (2)

2676-2676: Align key casing with existing Invitation_ pattern*

Nearby keys use Title_Case segments (e.g., Invitation_HTML, Invitation_Subject). Recommend renaming to Invitation_Date for consistency. Based on learnings, only en.i18n.json needs updates.

-  "Invitation_date": "Invitation date",
+  "Invitation_Date": "Invitation date",

Please update all call sites accordingly (grep for "Invitation_date").


4479-4479: Consistent casing for action label

Use Title_Case segments to match common convention; suggest Revoke_Invitation.

-  "Revoke_invitation": "Revoke invitation",
+  "Revoke_Invitation": "Revoke invitation",

Verify and update usages of "Revoke_invitation" after the rename.

apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersRow.tsx (1)

1-1: Tighten user typing instead of | {} and keep subscription wiring

The new RoomMember import and subscription={user.subscription} wiring are consistent with the updated RoomMember shape and look good.

However, the current type

user: Pick<RoomMember, 'federated' | 'username' | 'name' | '_id' | 'freeSwitchExtension' | 'subscription'> | {};

is type‑unsafe: accessing user.username, user._id, etc. on a {} | Pick<...> union will fail TypeScript and doesn’t reflect the actual runtime contract (we only ever render RoomMembersItem when we have a real member).

You can make this safer and simpler by modeling user as optional and dropping the {} union, relying on the early return:

-	type RoomMembersRowProps = {
-	user: Pick<RoomMember, 'federated' | 'username' | 'name' | '_id' | 'freeSwitchExtension' | 'subscription'> | {};
+	type RoomMembersRowProps = {
+	user?: Pick<RoomMember, 'federated' | 'username' | 'name' | '_id' | 'freeSwitchExtension' | 'subscription'>;
@@
-const RoomMembersRow = ({ user, data: { onClickView, rid }, index, reload, useRealName }: RoomMembersRowProps): ReactElement => {
-	if (!user?._id) {
+const RoomMembersRow = ({ user, data: { onClickView, rid }, index, reload, useRealName }: RoomMembersRowProps): ReactElement => {
+	if (!user) {
 		return <RoomMembersItem.Skeleton />;
 	}

This keeps the runtime behavior but restores type safety for all subsequent user.* property accesses.

Also applies to: 6-9, 24-35

apps/meteor/client/views/room/hooks/useUserInfoActions/useUserInfoActions.ts (1)

53-60: Check UX for invited non‑members now that removeUser is shown when isInvited

The new isInvited parameter and its propagation:

  • Into useRemoveUserAction(user, rid, reload, isInvited), and
  • Into userinfoActions via ...((isMember || isInvited) && removeUser && { removeUser }), plus the updated deps

are all consistent and correctly wired.

One behavioral point to verify: for a user who is invited but not yet a member (isInvited === true, isMember === false), the action set will now include:

  • addUser via !isMember && addUser, and
  • removeUser (labelled “Revoke invitation”) via (isMember || isInvited) && removeUser.

If the intended UX is to only allow revoking the invitation in that state (and not also “Add user”), you could tighten the add condition:

-			...(!isMember && addUser && { addUser }),
+			...(!isMember && !isInvited && addUser && { addUser }),

Otherwise, if both actions are intentionally available, the current implementation is fine.

Also applies to: 62-69, 79-80, 86-100, 102-119

apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx (1)

56-63: Optional: avoid storing event objects in showButton state

The new data-invitationdate attribute and passing isInvited/reload into UserActions look correct and align with the updated invitation flow.

Currently, handleMenuEvent forwards the React event object directly into setShowButton (because setShowButton is used as the handler), so showButton will hold the last event object rather than a boolean. Since you only rely on its truthiness to toggle between the kebab icon and <UserActions />, you can make this state explicitly boolean and avoid retaining event objects:

-	const [showButton, setShowButton] = useState();
+	const [showButton, setShowButton] = useState(false);
@@
-	const handleMenuEvent = {
-		[isReduceMotionEnabled ? 'onMouseEnter' : 'onTransitionEnd']: setShowButton,
-	};
+	const handleMenuEvent = {
+		[isReduceMotionEnabled ? 'onMouseEnter' : 'onTransitionEnd']: () => setShowButton(true),
+	};

This keeps the behavior the same while improving typing and avoiding unnecessary event retention.

Also applies to: 71-81

📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 01f4703 and 03286ac.

📒 Files selected for processing (13)
  • apps/meteor/client/components/UserInfo/UserInfo.stories.tsx (1 hunks)
  • apps/meteor/client/components/UserInfo/UserInfo.tsx (3 hunks)
  • apps/meteor/client/views/hooks/useMembersList.ts (3 hunks)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersActions.tsx (1 hunks)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx (5 hunks)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersRow.tsx (2 hunks)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx (3 hunks)
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoActions.tsx (2 hunks)
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx (2 hunks)
  • apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx (2 hunks)
  • apps/meteor/client/views/room/hooks/useUserInfoActions/useUserInfoActions.ts (5 hunks)
  • packages/i18n/src/locales/en.i18n.json (2 hunks)
  • packages/rest-typings/src/v1/rooms.ts (2 hunks)
🧰 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/components/UserInfo/UserInfo.tsx
  • apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx
  • apps/meteor/client/components/UserInfo/UserInfo.stories.tsx
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoActions.tsx
  • packages/rest-typings/src/v1/rooms.ts
  • apps/meteor/client/views/hooks/useMembersList.ts
  • apps/meteor/client/views/room/hooks/useUserInfoActions/useUserInfoActions.ts
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersRow.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersActions.tsx
🧠 Learnings (6)
📓 Common learnings
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.
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.
📚 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/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx
  • packages/rest-typings/src/v1/rooms.ts
  • apps/meteor/client/views/hooks/useMembersList.ts
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersRow.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersActions.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:

  • packages/rest-typings/src/v1/rooms.ts
  • apps/meteor/client/views/hooks/useMembersList.ts
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings (mapping subscription documents to room IDs), never undefined, even when user has no room subscriptions.

Applied to files:

  • packages/rest-typings/src/v1/rooms.ts
  • apps/meteor/client/views/hooks/useMembersList.ts
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersRow.tsx
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings by mapping subscription documents to room IDs, never undefined, even when user has no room subscriptions.

Applied to files:

  • packages/rest-typings/src/v1/rooms.ts
  • apps/meteor/client/views/hooks/useMembersList.ts
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersRow.tsx
📚 Learning: 2025-11-19T12:32:29.696Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.

Applied to files:

  • packages/i18n/src/locales/en.i18n.json
🧬 Code graph analysis (8)
apps/meteor/client/components/UserInfo/UserInfo.tsx (1)
apps/meteor/client/lib/utils/timeAgo.ts (1)
  • timeAgo (12-26)
packages/rest-typings/src/v1/rooms.ts (1)
packages/core-typings/src/ISubscription.ts (1)
  • SubscriptionStatus (10-10)
apps/meteor/client/views/hooks/useMembersList.ts (2)
packages/core-typings/src/IUser.ts (1)
  • IUser (186-256)
packages/core-typings/src/ISubscription.ts (1)
  • SubscriptionStatus (10-10)
apps/meteor/client/views/room/hooks/useUserInfoActions/useUserInfoActions.ts (1)
apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx (1)
  • useRemoveUserAction (24-141)
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx (3)
apps/meteor/client/views/hooks/useMembersList.ts (1)
  • RoomMember (17-23)
packages/core-typings/src/IRoom.ts (1)
  • IRoom (21-95)
packages/ui-kit/src/index.ts (1)
  • Option (2-2)
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx (1)
packages/core-typings/src/IUser.ts (1)
  • IUser (186-256)
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersRow.tsx (1)
apps/meteor/client/views/hooks/useMembersList.ts (1)
  • RoomMember (17-23)
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersActions.tsx (1)
apps/meteor/client/views/room/hooks/useUserInfoActions/useUserInfoActions.ts (1)
  • useUserInfoActions (62-153)
🔇 Additional comments (14)
apps/meteor/client/components/UserInfo/UserInfo.tsx (3)

53-53: LGTM! Clean type addition.

The optional invitationDate prop follows the existing pattern for optional string fields in the component.


78-78: LGTM! Proper destructuring.

The invitationDate prop is correctly destructured and matches the type definition.


211-216: LGTM! Clean implementation following existing patterns.

The invitation date field rendering follows the same pattern as other optional fields in the component:

  • Conditional rendering with && operator
  • Consistent use of InfoPanelField, InfoPanelLabel, and InfoPanelText
  • Proper use of the timeAgo function for date formatting

The placement between custom fields and createdAt is logical, grouping invitation-related information appropriately.

apps/meteor/client/components/UserInfo/UserInfo.stories.tsx (1)

49-52: LGTM!

The new story variant provides appropriate test coverage for the invitation feature with a clear example of the invitationDate prop.

apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx (1)

114-138: LGTM!

The refactoring to separate content computation from the action option construction is clean. The memos correctly include all dependencies (invited, room?.teamMain, t for content; and roomCanRemove, userCanRemove, removeUserOptionAction, content for the final option).

apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersActions.tsx (1)

8-32: LGTM!

The component correctly threads the isInvited flag through to useUserInfoActions and appropriately sets isMember: !isInvited to distinguish between invited and active members.

apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx (2)

27-34: LGTM!

The addition of invitationDate to the props is consistent with the invitation feature flow.


117-123: LGTM!

The component correctly passes invitationDate to UserInfo and derives isInvited using Boolean(invitationDate) for UserInfoActions, maintaining a clear data flow for the invitation state.

packages/rest-typings/src/v1/rooms.ts (2)

1-11: LGTM!

The addition of SubscriptionStatus to the imports is necessary for the type refinement below.


895-899: LGTM!

The type refinement from string to SubscriptionStatus improves type safety and aligns with the core-typings definition. This ensures that only valid subscription status values are used throughout the codebase.

apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx (2)

96-106: LGTM!

The conditional rendering correctly checks for state.user?.id and passes both uid and invitationDate to UserInfoWithData, enabling the invitation information display.


51-82: No action needed. The dataset attribute naming is correct and consistent.

RoomMembersItem.tsx sets data-userid and data-invitationdate attributes, which the browser's dataset API automatically converts to dataset.userid and dataset.invitationdate when accessed in RoomMembersWithData.tsx. This is standard HTML/JavaScript behavior and requires no changes.

Likely an incorrect or invalid review comment.

apps/meteor/client/views/hooks/useMembersList.ts (1)

17-23: LGTM!

The RoomMember type extension to include federated, freeSwitchExtension, and the new subscription field with status and createdAt properly supports the invitation feature and aligns with the type updates in packages/rest-typings/src/v1/rooms.ts.

apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoActions.tsx (1)

13-42: The isInvited prop is correctly threaded through to useUserInfoActions.

The size: 2 parameter is the default value defined in the hook (not a change from 3). UserCardWithData.tsx is the only location that explicitly overrides this to size: 3. No action required.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 358MiB 347MiB +12MiB
omnichannel-transcript-service 132MiB 132MiB -189B
queue-worker-service 132MiB 132MiB -2.3KiB
ddp-streamer-service 126MiB 126MiB -1.1KiB
account-service 113MiB 113MiB -110B
authorization-service 111MiB 111MiB -238B
stream-hub-service 111MiB 111MiB -174B
presence-service 111MiB 111MiB -106B

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/15 22:28", "11/16 01:28", "11/17 23:50", "11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 21:00", "12/04 18:17", "12/05 21:56", "12/08 20:15", "12/09 22:17", "12/10 23:26", "12/11 21:56", "12/12 22:45", "12/13 01:34", "12/15 22:31", "12/16 22:18", "12/17 21:04", "12/18 23:12", "12/19 23:27", "12/20 00:15", "12/20 00:32 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "rocketchat" [0.36, 0.36, 0.35, 0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.35]
  line "stream-hub-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
Loading

Statistics (last 26 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.2GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 1.2GiB
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-37712
  • Baseline: develop
  • Timestamp: 2025-12-20 00:32:58 UTC
  • Historical data points: 26

Updated: Sat, 20 Dec 2025 00:32:58 GMT

@aleksandernsilva aleksandernsilva force-pushed the feat/invitation-user-info branch from e8af0cb to f26796b Compare December 8, 2025 01:00
@sampaiodiego sampaiodiego force-pushed the feat/invites branch 2 times, most recently from c420eb2 to 36e006f Compare December 8, 2025 14:17
@aleksandernsilva aleksandernsilva force-pushed the feat/invitation-user-info branch from 3f2f57e to 0703b45 Compare December 8, 2025 18:26
@aleksandernsilva aleksandernsilva force-pushed the feat/invitation-user-info branch from 0703b45 to fff9239 Compare December 8, 2025 23:12
@sampaiodiego sampaiodiego force-pushed the feat/invitation-user-info branch from fff9239 to a6b0b80 Compare December 9, 2025 20:29
Base automatically changed from feat/invites to develop December 10, 2025 01:45
@sampaiodiego sampaiodiego force-pushed the feat/invitation-user-info branch from aef1327 to 7e82fb1 Compare December 10, 2025 12:47
@sampaiodiego sampaiodiego changed the title feat: Added invitation information to user info contextual bar feat(federation): Added invitation information to user info contextual bar Dec 10, 2025
@aleksandernsilva aleksandernsilva force-pushed the feat/invitation-user-info branch from 7e82fb1 to 239cd6f Compare December 10, 2025 20:03
@aleksandernsilva aleksandernsilva changed the title feat(federation): Added invitation information to user info contextual bar feat: Added invitation information to user info contextual bar Dec 10, 2025
@aleksandernsilva aleksandernsilva force-pushed the feat/invitation-user-info branch from 239cd6f to 0e0465d Compare December 10, 2025 22:58
@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 79.16667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.69%. Comparing base (0b39d87) to head (faf1beb).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37712      +/-   ##
===========================================
- Coverage    67.70%   67.69%   -0.02%     
===========================================
  Files         3475     3475              
  Lines       113860   113871      +11     
  Branches     20943    20947       +4     
===========================================
- Hits         77093    77084       -9     
- Misses       34586    34601      +15     
- Partials      2181     2186       +5     
Flag Coverage Δ
e2e 57.16% <79.16%> (-0.03%) ⬇️
e2e-api 44.01% <ø> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 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.

@aleksandernsilva aleksandernsilva marked this pull request as ready for review December 11, 2025 00:06
@aleksandernsilva aleksandernsilva requested a review from a team as a code owner December 11, 2025 00:06
@aleksandernsilva aleksandernsilva added this to the 7.14.0 milestone Dec 11, 2025
Copy link
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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembers.stories.tsx (1)

23-29: Story data aligned with new RoomMember shape; consider consistency across stories

Adding roles: ['user'] here keeps the Default story in sync with the expanded RoomMember type and should help prevent type errors or missing-role UI paths during development.

For consistency and to better exercise role‑aware UI, you might also add a roles field to the member object in WithABACRoom.args.members (even if the prop is optional), e.g. roles: ['user'] or a role set that reflects the ABAC scenario.

📜 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 03286ac and 0e0465d.

⛔ Files ignored due to path filters (1)
  • apps/meteor/client/components/UserInfo/__snapshots__/UserInfo.spec.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (13)
  • apps/meteor/client/components/UserInfo/UserInfo.stories.tsx (1 hunks)
  • apps/meteor/client/components/UserInfo/UserInfo.tsx (3 hunks)
  • apps/meteor/client/views/hooks/useMembersList.ts (2 hunks)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembers.stories.tsx (1 hunks)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembers.tsx (4 hunks)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersActions.tsx (1 hunks)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx (5 hunks)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersRow.tsx (2 hunks)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx (3 hunks)
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoActions.tsx (2 hunks)
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx (2 hunks)
  • apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx (2 hunks)
  • apps/meteor/client/views/room/hooks/useUserInfoActions/useUserInfoActions.ts (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • apps/meteor/client/views/room/hooks/useUserInfoActions/useUserInfoActions.ts
  • apps/meteor/client/components/UserInfo/UserInfo.tsx
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersRow.tsx
  • apps/meteor/client/components/UserInfo/UserInfo.stories.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersActions.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.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/room/contextualBar/RoomMembers/RoomMembers.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoActions.tsx
  • apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembers.stories.tsx
  • apps/meteor/client/views/hooks/useMembersList.ts
🧠 Learnings (7)
📓 Common learnings
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.
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.
📚 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/RoomMembers/RoomMembers.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx
  • apps/meteor/client/views/hooks/useMembersList.ts
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings (mapping subscription documents to room IDs), never undefined, even when user has no room subscriptions.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembers.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • apps/meteor/client/views/hooks/useMembersList.ts
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings by mapping subscription documents to room IDs, never undefined, even when user has no room subscriptions.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembers.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • apps/meteor/client/views/hooks/useMembersList.ts
📚 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/RoomMembers/RoomMembers.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
  • apps/meteor/client/views/hooks/useMembersList.ts
📚 Learning: 2025-10-06T20:32:23.658Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37152
File: packages/apps-engine/tests/test-data/utilities.ts:557-573
Timestamp: 2025-10-06T20:32:23.658Z
Learning: In packages/apps-engine/tests/test-data/utilities.ts, the field name `isSubscripbedViaBundle` in the `IMarketplaceSubscriptionInfo` type should not be flagged as a typo, as it may match the upstream API's field name.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: UserBridge.doGetUserRoomIds in packages/apps-engine/src/server/bridges/UserBridge.ts has a bug where it implicitly returns undefined when the app lacks read permission (missing return statement in the else case of the permission check).

Applied to files:

  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
🧬 Code graph analysis (3)
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembers.tsx (1)
apps/meteor/client/views/hooks/useMembersList.ts (1)
  • RoomMember (23-28)
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx (2)
apps/meteor/client/views/hooks/useMembersList.ts (1)
  • RoomMember (23-28)
packages/core-typings/src/IRoom.ts (1)
  • IRoom (21-95)
apps/meteor/client/views/hooks/useMembersList.ts (2)
packages/core-typings/src/IUser.ts (1)
  • IUser (186-256)
packages/core-typings/src/ISubscription.ts (1)
  • ISubscription (11-79)
🔇 Additional comments (8)
apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx (2)

24-29: LGTM on the function signature update.

The optional invited parameter is correctly placed at the end of the parameter list, maintaining backward compatibility with existing callers.


126-138: LGTM on the refactored memoization.

The early return pattern improves readability, and the dependencies array correctly includes all referenced values: roomCanRemove, userCanRemove, removeUserOptionAction, and content.

apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoActions.tsx (2)

16-16: LGTM: Invitation state propagation looks correct.

The isInvited prop is correctly added to the component signature and properly threaded through to useUserInfoActions.

Also applies to: 20-20, 37-37


35-35: The size parameter change is intentional and appropriate.

The size parameter controls how many user action buttons display inline versus in the overflow menu. UserInfoActions uses size: 2 (matching the hook's default), showing 2 action buttons inline in the contextual bar sidebar. This differs from UserCardWithData which uses size: 3 for the popup context. The change reflects appropriate layout constraints for the component's context and is unrelated to the invitation feature changes.

apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembers.tsx (1)

1-1: LGTM: Consistent type migration to centralized RoomMember.

The transition from RoomMemberUser[] to RoomMember[] is implemented consistently throughout the file, with proper imports and type declarations. This aligns with the centralized type definition in useMembersList.ts.

Also applies to: 25-25, 36-36, 93-96

apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx (2)

45-46: LGTM: TypeScript safety is correctly handled.

The optional chaining on subscription?.ts (line 46) properly handles the case where subscription may be undefined, ensuring type safety. The invitation state derivation is correct and safe.


24-29: LGTM: Invitation data integration is well-structured.

The component correctly:

  • Accepts subscription through props derived from RoomMember
  • Computes isInvited based on subscription status
  • Propagates isInvited to UserActions
  • Exposes invitationDate via data attribute for UI consumption

Also applies to: 39-42, 73-81

apps/meteor/client/views/hooks/useMembersList.ts (1)

1-1: LGTM: RoomMember type expansion supports invitation tracking.

The enhanced RoomMember type correctly:

  • Wraps in Serialized<> for API response data handling
  • Adds subscription field with status and ts for invitation state tracking
  • Includes federated and freeSwitchExtension from IUser for complete member data
  • Maintains backward compatibility with optional fields

This provides the foundation for invitation information display throughout the UI.

Also applies to: 23-28

gabriellsh
gabriellsh previously approved these changes Dec 16, 2025
@sampaiodiego sampaiodiego force-pushed the feat/invitation-user-info branch from 2a7e07c to 8fcbe66 Compare December 20, 2025 00:04
Copy link
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.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx (1)

32-44: Fix duplicate parameter subscription.

The parameter subscription is declared twice (lines 40 and 43), which is a syntax error. Remove the duplicate declaration on line 43.

🔎 Proposed fix
 const RoomMembersItem = ({
 	_id,
 	name,
 	username,
 	federated,
 	freeSwitchExtension,
 	onClickView,
 	rid,
 	subscription,
 	reload,
 	useRealName,
-	subscription,
 }: RoomMembersItemProps): ReactElement => {
♻️ Duplicate comments (1)
apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx (1)

101-111: Modal body text inconsistency for invitation context.

The confirmText (line 104) correctly switches to "Revoke_invitation" when invited is true, but the modal body (line 109) still displays the generic "The_user_will_be_removed_from_s" message. This creates a UX mismatch.

🔎 Proposed fix
 setModal(
   <GenericModal
     variant='danger'
     confirmText={invited ? t('Revoke_invitation') : t('Yes_remove_user')}
     onClose={closeModal}
     onCancel={closeModal}
     onConfirm={(): Promise<void> => handleRemoveFromRoom(rid, uid)}
   >
-    {t('The_user_will_be_removed_from_s', roomName)}
+    {invited ? t('The_invitation_will_be_revoked') : t('The_user_will_be_removed_from_s', roomName)}
   </GenericModal>,
 );

Note: This requires adding the The_invitation_will_be_revoked i18n key.

🧹 Nitpick comments (1)
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx (1)

73-77: Use optional chaining for consistency and TypeScript safety.

While the conditional on line 73 checks subscription?.status === 'INVITED', TypeScript may not narrow the type inside JSX blocks. Use subscription?.ts on line 75 for consistency with line 48 and to avoid potential type errors under strict null checks.

🔎 Proposed fix
 			{subscription?.status === 'INVITED' && (
 				<OptionColumn>
-					<InvitationBadge mbs={2} size='x20' invitationDate={subscription.ts} />
+					<InvitationBadge mbs={2} size='x20' invitationDate={subscription?.ts} />
 				</OptionColumn>
 			)}
📜 Review details

Configuration used: Organization 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 365e2ab and 8fcbe66.

⛔ Files ignored due to path filters (1)
  • apps/meteor/client/components/UserInfo/__snapshots__/UserInfo.spec.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (10)
  • apps/meteor/client/components/UserInfo/UserInfo.stories.tsx (1 hunks)
  • apps/meteor/client/components/UserInfo/UserInfo.tsx (3 hunks)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersActions.tsx (1 hunks)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx (3 hunks)
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx (3 hunks)
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoActions.tsx (2 hunks)
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx (2 hunks)
  • apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx (3 hunks)
  • apps/meteor/client/views/room/hooks/useUserInfoActions/useUserInfoActions.ts (5 hunks)
  • packages/i18n/src/locales/en.i18n.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • apps/meteor/client/components/UserInfo/UserInfo.stories.tsx
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoActions.tsx
  • packages/i18n/src/locales/en.i18n.json
  • apps/meteor/client/components/UserInfo/UserInfo.tsx
  • apps/meteor/client/views/room/hooks/useUserInfoActions/useUserInfoActions.ts
🧰 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/room/contextualBar/RoomMembers/RoomMembersActions.tsx
  • apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx
  • apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
🧠 Learnings (5)
📚 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/RoomMembers/RoomMembersActions.tsx
  • apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings (mapping subscription documents to room IDs), never undefined, even when user has no room subscriptions.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: AppUserBridge.getUserRoomIds in apps/meteor/app/apps/server/bridges/users.ts always returns an array of strings by mapping subscription documents to room IDs, never undefined, even when user has no room subscriptions.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx
  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
📚 Learning: 2025-10-06T20:32:23.658Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37152
File: packages/apps-engine/tests/test-data/utilities.ts:557-573
Timestamp: 2025-10-06T20:32:23.658Z
Learning: In packages/apps-engine/tests/test-data/utilities.ts, the field name `isSubscripbedViaBundle` in the `IMarketplaceSubscriptionInfo` type should not be flagged as a typo, as it may match the upstream API's field name.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
📚 Learning: 2025-09-25T09:59:26.461Z
Learnt from: Dnouv
Repo: RocketChat/Rocket.Chat PR: 37057
File: packages/apps-engine/src/definition/accessors/IUserRead.ts:23-27
Timestamp: 2025-09-25T09:59:26.461Z
Learning: UserBridge.doGetUserRoomIds in packages/apps-engine/src/server/bridges/UserBridge.ts has a bug where it implicitly returns undefined when the app lacks read permission (missing return statement in the else case of the permission check).

Applied to files:

  • apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx
🧬 Code graph analysis (3)
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersActions.tsx (1)
apps/meteor/client/views/room/hooks/useUserInfoActions/useUserInfoActions.ts (1)
  • useUserInfoActions (62-153)
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx (1)
packages/core-typings/src/IUser.ts (1)
  • IUser (187-259)
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx (1)
packages/ui-kit/src/index.ts (1)
  • Option (2-2)
🪛 Biome (2.1.2)
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx

[error] 43-43: Duplicate parameter name.

The parameter overrides a preceding parameter by using the same name.

(lint/suspicious/noDuplicateParameters)


[error] 43-43: Shouldn't redeclare 'subscription'. Consider to delete it or rename it.

'subscription' is defined here:

(lint/suspicious/noRedeclare)

⏰ 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). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (7)
apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx (3)

24-29: LGTM!

The optional invited parameter is a clean, non-breaking addition to the hook signature that enables invitation-specific behavior.


114-124: LGTM!

The content memo correctly prioritizes the invitation case, then team context, with a sensible fallback for regular rooms. Dependencies are properly specified.


126-138: LGTM!

The removeUserOption memo cleanly separates permission checks from content determination. The early return for missing permissions is appropriate, and the action object structure is well-typed.

apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersActions.tsx (1)

10-10: LGTM: Invitation state properly threaded through.

The isInvited prop is correctly added to the type, destructured, and passed to useUserInfoActions. The logic isMember: !isInvited appropriately reflects that invited users are not yet members.

Also applies to: 20-20, 30-31

apps/meteor/client/views/room/contextualBar/UserInfo/UserInfoWithData.tsx (1)

31-31: LGTM: Invitation date propagated correctly.

The invitationDate prop is properly added to the type signature, accepted by the component, and passed through to UserInfo. Deriving isInvited={Boolean(invitationDate)} for UserInfoActions is a clean approach.

Also applies to: 36-36, 117-123

apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersWithData.tsx (1)

51-54: LGTM: State refactored to group invitation data.

The state structure change from a flat userId to a nested user: { id, invitationDate } cleanly groups related data. The dataset attribute invitationdate (lowercase) is consistently read and propagated to UserInfoWithData.

Also applies to: 76-82, 96-106

apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx (1)

47-48: LGTM: Invitation state correctly derived and propagated.

The isInvited flag and invitationDate are correctly derived from subscription using optional chaining. The data-invitationdate attribute and isInvited prop are properly passed to enable invitation-aware UI and actions.

Also applies to: 58-65, 80-88

@sampaiodiego sampaiodiego merged commit 626f0d2 into develop Dec 20, 2025
51 checks passed
@sampaiodiego sampaiodiego deleted the feat/invitation-user-info branch December 20, 2025 01:28
gaolin1 pushed a commit to gaolin1/medsense.webchat that referenced this pull request Jan 6, 2026
@dougfabris dougfabris modified the milestones: 7.14.0, 8.0.0 Jan 19, 2026
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.

5 participants