Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

feat: Added invitation badge to room members list

Open aleksandernsilva opened this issue 2 months ago • 7 comments

Proposed changes (including videos or screenshots)

This pull request adds a visual badge for invited users in the room members contextual. The changes also add a new story and snapshot test for rooms with invited members.

Screenshot 2025-12-01 at 10 22 51

Issue(s)

FB-63

Steps to test or reproduce

ℹ️ Currently invitation requests are only available for federated rooms. ℹ️ You'll need two workspaces with federation enabled (I'll refer to them as ws-a and ws-b)

  • Create a room federated room (ws-a)
  • Invite an user from ws-b to the room (ws-a)
  • Send a message
  • Access members list in the room toolbox
  • Invited status should be displayed besides the inviter user

Further comments

Summary by CodeRabbit

  • New Features

    • Added a visual invitation badge indicator for invited members displayed in the room member list, improving clarity on member invitation status.
  • Tests

    • Added test coverage for invited member scenarios.

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

aleksandernsilva avatar Nov 28 '25 20:11 aleksandernsilva

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

dionisio-bot[bot] avatar Nov 28 '25 20:11 dionisio-bot[bot]

🦋 Changeset detected

Latest commit: 930fea49aae641250673fecda0ebb87e214412ce

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 42 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/i18n Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-voip Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/gazzodown Patch
@rocket.chat/livechat Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/queue-worker Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/http-router Patch
@rocket.chat/model-typings Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/presence-service Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch

Not sure what this means? Click here to learn what changesets are.

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

changeset-bot[bot] avatar Nov 28 '25 20:11 changeset-bot[bot]

Walkthrough

Adds an InvitationBadge component, threads a new optional subscription field (including invited status) through RoomMember types and member-list components, adds Storybook coverage for an invited member, updates i18n keys, and includes tests and a changeset.

Changes

Cohort / File(s) Change Summary
InvitationBadge component
apps/meteor/client/components/InvitationBadge/InvitationBadge.tsx, apps/meteor/client/components/InvitationBadge/index.ts, apps/meteor/client/components/InvitationBadge/InvitationBadge.spec.tsx
New InvitationBadge component rendering a mail icon with optional date-aware title (uses useTimeAgo and i18n). Added index re-export and snapshot tests for no-date, ISO string, and Date object cases.
Room members UI
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembers.tsx, apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersItem.tsx, apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembersRow.tsx
Replaced local RoomMemberUser type with shared RoomMember; threaded subscription through Row → Item and conditionally render InvitationBadge when subscription.status indicates invited. Adjusted prop types and internal groupings.
Members hook types
apps/meteor/client/views/hooks/useMembersList.ts
Expanded exported RoomMember type to Serialized<...> including federated, updated roles typing, and optional subscription (Pick of ISubscription fields). Added imports for ISubscription and Serialized.
Storybook
apps/meteor/client/views/room/contextualBar/RoomMembers/RoomMembers.stories.tsx
Added WithInvitedMember story providing a member with a nested subscription having status: 'INVITED' to demonstrate invited state.
Translations
packages/i18n/src/locales/en.i18n.json
Added "Invited": "Invited" and "Invited__date__": "Invited {{date}}".
Changeset
.changeset/nasty-moons-speak.md
Patch bumps for @rocket.chat/meteor and @rocket.chat/i18n with note "Adds invitation badge to room members list."

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Verify RoomMember Serialized wrapper and subscription shape are compatible with all consumers (including ones not changed here).
  • Check TypeScript propagation where RoomMember replaced local types (RoomMembers, Row, Item).
  • Review InvitationBadge formatting (useTimeAgo) and i18n key usage for both string and Date inputs.
  • Confirm Storybook story uses the correct status value/enum expected at runtime.

Possibly related PRs

  • RocketChat/Rocket.Chat#37349 — Touches RoomMembers stories/props and ABAC-related props; likely overlaps with Storybook and RoomMembers surface changes.

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • dougfabris
  • ggazzo
  • gabriellsh

Poem

🐰 An envelope hops in, tiny and bright,
A badge that says "Invited" — soft candlelight.
Types chased upstream, dates learned to say "ago",
I nibble the changes and watch them grow. ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding an invitation badge to the room members list, which is the primary feature introduced across all modified files.
Linked Issues check ✅ Passed The pull request implements the core requirement from FB-63 by adding a visual invitation badge for invited users in the room members list with supporting components, stories, tests, and translations.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the invitation badge feature: type refactoring for RoomMember (to support subscription data), new InvitationBadge component, stories, tests, and i18n translations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment
  • [ ] Commit unit tests in branch feat/members-list-invite-badge

📜 Recent 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 dcc2f102402b3bd3c8c4d5546c37b00ccda94c82 and 930fea49aae641250673fecda0ebb87e214412ce.

📒 Files selected for processing (1)
  • packages/i18n/src/locales/en.i18n.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/i18n/src/locales/en.i18n.json
⏰ 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.

coderabbitai[bot] avatar Nov 28 '25 20:11 coderabbitai[bot]

@coderabbitai review

aleksandernsilva avatar Dec 01 '25 13:12 aleksandernsilva

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

coderabbitai[bot] avatar Dec 01 '25 13:12 coderabbitai[bot]

📦 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 +127B
queue-worker-service 132MiB 132MiB -1.5KiB
ddp-streamer-service 126MiB 126MiB -1.3KiB
account-service 113MiB 113MiB -456B
stream-hub-service 111MiB 111MiB +18B
presence-service 111MiB 111MiB +646B
authorization-service 111MiB 111MiB +420B

📊 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 13:38 (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]
  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]
  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]
  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]
  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]
  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]
  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.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]

Statistics (last 20 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-37643
  • Baseline: develop
  • Timestamp: 2025-12-15 13:38:46 UTC
  • Historical data points: 20

Updated: Mon, 15 Dec 2025 13:38:47 GMT

github-actions[bot] avatar Dec 03 '25 20:12 github-actions[bot]

Codecov Report

:x: Patch coverage is 50.00000% with 6 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 67.72%. Comparing base (d3538e7) to head (930fea4). :warning: Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37643      +/-   ##
===========================================
- Coverage    67.80%   67.72%   -0.09%     
===========================================
  Files         3458     3459       +1     
  Lines       113955   113957       +2     
  Branches     20927    20929       +2     
===========================================
- Hits         77271    77176      -95     
- Misses       34553    34647      +94     
- Partials      2131     2134       +3     
Flag Coverage Δ
e2e 57.35% <50.00%> (-0.02%) :arrow_down:
e2e-api 42.32% <ø> (-0.96%) :arrow_down:

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

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

codecov[bot] avatar Dec 03 '25 20:12 codecov[bot]