Skip to content

Conversation

@ggazzo
Copy link
Member

@ggazzo ggazzo commented Dec 9, 2025

split from #37612

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Refactor
    • Toolbox injection moved to a slots-based approach for the room header.
    • Toolbox visibility now respects a new hidden flag so it’s only shown when not hidden.
    • End-to-end encryption setup is now injected via slots to keep header behavior consistent.

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

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Dec 9, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2025

⚠️ No Changeset found

Latest commit: c984124

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

@ggazzo ggazzo added this to the 7.14.0 milestone Dec 9, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Replaces the roomToolbox prop on RoomHeader with a slots-based API: slots.toolbox.content, and adds slots.toolbox?.hidden?: boolean to control whether the toolbox is rendered. Internal E2EE setup callers updated to pass toolbox UI via slots.toolbox.content.

Changes

Cohort / File(s) Summary
RoomHeader (Header)
apps/meteor/client/views/room/Header/RoomHeader.tsx
Removed roomToolbox from RoomHeaderProps and the component signature. Added slots.toolbox?.hidden?: boolean. Toolbox rendering now conditional on slots.toolbox?.hidden !== true, using slots.toolbox?.content or falling back to RoomToolbox, wrapped in Suspense when rendered.
RoomHeader (HeaderV2)
apps/meteor/client/views/room/HeaderV2/RoomHeader.tsx
Removed roomToolbox prop and added toolbox.hidden to the slot interface. Conditional toolbox rendering now respects toolbox.hidden and uses slots.toolbox?.content with the same fallback and Suspense behavior.
E2EE setup callers
apps/meteor/client/views/room/Header/RoomHeaderE2EESetup.tsx, apps/meteor/client/views/room/HeaderV2/RoomHeaderE2EESetup.tsx
Updated calls to RoomHeader to provide toolbox UI via slots.toolbox.content instead of the removed roomToolbox prop; branching/conditions preserved.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Check for any remaining roomToolbox usages across the codebase.
  • Verify slots.toolbox?.hidden semantics (true = hidden).
  • Confirm Suspense and fallback (RoomToolbox) only render when toolbox is shown.

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • dougfabris
  • tassoevan

Poem

🐰 I hopped through props and slots with glee,
Swapped a prop for a nest where content can be.
Toolbox tucked in a slot so fine,
Hidden or shown by a simple sign.
Hooray — the header’s neat and free! 🎩✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: removing the roomToolbox prop from the RoomHeader component, which is the primary refactoring work across multiple related files.
✨ 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 chore/room-header

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.

@ggazzo ggazzo marked this pull request as ready for review December 9, 2025 20:13
@ggazzo ggazzo requested a review from a team as a code owner December 9, 2025 20:13
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

🧹 Nitpick comments (1)
apps/meteor/client/views/room/HeaderV2/RoomHeaderE2EESetup.tsx (1)

10-10: Consider accepting slots parameter for API consistency.

Unlike Header/RoomHeaderE2EESetup.tsx (line 10), this component does not accept a slots parameter. This creates an inconsistency between the two versions and prevents this component from preserving any existing slots that might be passed through.

If this inconsistency is unintentional, apply this diff to align the API:

-const RoomHeaderE2EESetup = ({ room }: RoomHeaderProps) => {
+const RoomHeaderE2EESetup = ({ room, slots = {} }: RoomHeaderProps) => {

Then update the slots injection on lines 18-22 to spread existing slots:

 		return (
 			<RoomHeader
 				room={room}
 				slots={{
+					...slots,
 					toolbox: {
+						...slots.toolbox,
 						content: <RoomToolboxE2EESetup />,
 					},
 				}}
 			/>
 		);

And pass slots through on line 27:

-	return <RoomHeader room={room} />;
+	return <RoomHeader room={room} slots={slots} />;
📜 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 1a9225e and e7fb4ad.

📒 Files selected for processing (3)
  • apps/meteor/client/views/room/Header/RoomHeader.tsx (2 hunks)
  • apps/meteor/client/views/room/Header/RoomHeaderE2EESetup.tsx (1 hunks)
  • apps/meteor/client/views/room/HeaderV2/RoomHeaderE2EESetup.tsx (1 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/views/room/HeaderV2/RoomHeaderE2EESetup.tsx
  • apps/meteor/client/views/room/Header/RoomHeader.tsx
  • apps/meteor/client/views/room/Header/RoomHeaderE2EESetup.tsx
🧠 Learnings (1)
📚 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/HeaderV2/RoomHeaderE2EESetup.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). (1)
  • GitHub Check: 📦 Build Packages
🔇 Additional comments (2)
apps/meteor/client/views/room/Header/RoomHeaderE2EESetup.tsx (1)

15-26: LGTM! Proper slots composition.

The slots spreading logic correctly preserves existing slot content while injecting the E2EE setup toolbox. The nested spread on line 21 ensures any existing slots.toolbox.pre or slots.toolbox.pos values are retained.

apps/meteor/client/views/room/Header/RoomHeader.tsx (1)

66-74: Verify all call sites provide slots.toolbox for backward compatibility.

The toolbox rendering is now gated behind slots.toolbox existence (line 66). Previously, the toolbox was always rendered via the roomToolbox prop. This means any existing usage of <RoomHeader room={room} /> without passing slots.toolbox will no longer render the toolbox UI.

Run the following script to identify all RoomHeader call sites and verify they provide slots.toolbox:

#!/bin/bash
# Find all RoomHeader usages and check if they pass slots.toolbox

echo "=== Finding RoomHeader component usages ==="
rg -n -C 5 '<RoomHeader\s' --type=tsx --type=ts -g '!**/Header/RoomHeader.tsx'

echo -e "\n=== Checking for imports of RoomHeader ==="
rg -n "import.*RoomHeader.*from.*Header/RoomHeader" --type=tsx --type=ts

dougfabris
dougfabris previously approved these changes Dec 9, 2025
@dougfabris dougfabris changed the title refactor: deprecate roomToolbox prop in RoomHeader component refactor: remove roomToolbox prop in RoomHeader component Dec 9, 2025
sampaiodiego
sampaiodiego previously approved these changes Dec 9, 2025
@ggazzo ggazzo requested a review from Copilot December 9, 2025 20:26
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: 2

📜 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 e7fb4ad and 0177d9b.

📒 Files selected for processing (4)
  • apps/meteor/client/views/room/Header/RoomHeader.tsx (2 hunks)
  • apps/meteor/client/views/room/Header/RoomHeaderE2EESetup.tsx (1 hunks)
  • apps/meteor/client/views/room/HeaderV2/RoomHeader.tsx (2 hunks)
  • apps/meteor/client/views/room/HeaderV2/RoomHeaderE2EESetup.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/client/views/room/HeaderV2/RoomHeaderE2EESetup.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/HeaderV2/RoomHeader.tsx
  • apps/meteor/client/views/room/Header/RoomHeader.tsx
  • apps/meteor/client/views/room/Header/RoomHeaderE2EESetup.tsx
🧠 Learnings (1)
📚 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/HeaderV2/RoomHeader.tsx
🧬 Code graph analysis (2)
apps/meteor/client/views/room/HeaderV2/RoomHeader.tsx (1)
apps/meteor/client/views/room/Header/RoomHeader.tsx (1)
  • RoomHeaderProps (19-35)
apps/meteor/client/views/room/Header/RoomHeader.tsx (1)
apps/meteor/client/views/room/HeaderV2/RoomHeader.tsx (1)
  • RoomHeaderProps (17-32)
⏰ 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). (2)
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (5)
apps/meteor/client/views/room/HeaderV2/RoomHeader.tsx (2)

29-29: LGTM: Type definition addition is correct.

The hidden?: boolean property enables conditional rendering of the toolbox, aligning with the slots-based API refactor.


34-34: LGTM: Signature correctly implements the refactor.

The removal of the roomToolbox prop and reliance on slots aligns with the PR objective to migrate to a slots-based API.

apps/meteor/client/views/room/Header/RoomHeaderE2EESetup.tsx (1)

15-26: LGTM: Slot merging correctly preserves existing values.

The implementation properly spreads existing slots and toolbox properties before adding the E2EE-specific content, ensuring no slot values are lost during the merge.

apps/meteor/client/views/room/Header/RoomHeader.tsx (2)

32-32: LGTM: Type definition addition is correct.

The hidden?: boolean property enables conditional rendering of the toolbox, consistent with the HeaderV2 implementation.


37-37: LGTM: Signature correctly implements the refactor.

The removal of the roomToolbox prop and reliance on slots aligns with the PR objective to migrate to a slots-based API.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the RoomHeader component to remove the roomToolbox prop in favor of a more flexible slots-based approach for injecting toolbox content.

Key Changes:

  • Removed the roomToolbox prop from RoomHeader components
  • Extended the slots.toolbox object to include a content property for toolbox injection
  • Added a hidden flag to slots.toolbox for conditional toolbox visibility

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
apps/meteor/client/views/room/HeaderV2/RoomHeader.tsx Updated to remove roomToolbox prop and use slots.toolbox.content instead; added conditional rendering based on slots.toolbox.hidden
apps/meteor/client/views/room/HeaderV2/RoomHeaderE2EESetup.tsx Migrated from using roomToolbox prop to slots.toolbox.content for E2EE setup toolbox
apps/meteor/client/views/room/Header/RoomHeader.tsx Updated to remove roomToolbox prop and use slots.toolbox.content instead; added conditional rendering based on slots.toolbox.hidden
apps/meteor/client/views/room/Header/RoomHeaderE2EESetup.tsx Migrated from using roomToolbox prop to slots.toolbox.content for E2EE setup toolbox, with proper slots spreading

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ggazzo ggazzo requested a review from Copilot December 9, 2025 20:33
@ggazzo ggazzo changed the title refactor: remove roomToolbox prop in RoomHeader component chore: remove roomToolbox prop in RoomHeader component Dec 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 360MiB 349MiB +12MiB
omnichannel-transcript-service 132MiB 132MiB +21B
queue-worker-service 132MiB 132MiB -97B
ddp-streamer-service 126MiB 126MiB -524B
account-service 113MiB 113MiB -1.3KiB
stream-hub-service 111MiB 111MiB +129B
authorization-service 111MiB 111MiB +773B
presence-service 111MiB 111MiB +14B

📊 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 19:25", "12/09 21:03 (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]
  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]
  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]
  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]
  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]
  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]
  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.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]
Loading

Statistics (last 16 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-37755
  • Baseline: develop
  • Timestamp: 2025-12-09 21:03:30 UTC
  • Historical data points: 16

Updated: Tue, 09 Dec 2025 21:03:31 GMT

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 67.73%. Comparing base (06991bc) to head (c984124).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37755      +/-   ##
===========================================
+ Coverage    67.71%   67.73%   +0.02%     
===========================================
  Files         3449     3448       -1     
  Lines       113927   113900      -27     
  Branches     20915    20912       -3     
===========================================
+ Hits         77143    77149       +6     
+ Misses       34661    34627      -34     
- Partials      2123     2124       +1     
Flag Coverage Δ
e2e 57.30% <85.71%> (-0.01%) ⬇️
e2e-api 42.31% <ø> (+0.10%) ⬆️

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.

@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Dec 9, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Dec 9, 2025
@ggazzo ggazzo merged commit 607fa6e into develop Dec 9, 2025
58 of 59 checks passed
@ggazzo ggazzo deleted the chore/room-header branch December 9, 2025 21:48
@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

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants