Skip to content

fix: add team leave flow to room menu action#38448

Open
sezallagwal wants to merge 4 commits intoRocketChat:developfrom
sezallagwal:feat/team-leave-room-menu
Open

fix: add team leave flow to room menu action#38448
sezallagwal wants to merge 4 commits intoRocketChat:developfrom
sezallagwal:feat/team-leave-room-menu

Conversation

@sezallagwal
Copy link

@sezallagwal sezallagwal commented Jan 31, 2026

Addresses TODO in useLeaveRoom.tsx to consider team leaving when leaving rooms.

When leaving a team main room via the sidebar menu, users now see the LeaveTeam modal instead of a simple warning, allowing them to select which team channels to also leave.


Changes

  • apps/meteor/client/hooks/menuActions/useLeaveRoom.tsx

    • Added teamId and teamMain props to LeaveRoomProps
    • Added conditional logic to show LeaveTeam modal for team main rooms
    • Removed TODO comment
  • apps/meteor/client/hooks/useRoomMenuActions.ts

    • Pass teamId/teamMain from Rooms store to useLeaveRoomAction
  • apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.ts

    • Same changes as above

Verification

  • yarn lint → ✅ passes
  • Manual testing: Team main room shows LeaveTeam modal, regular rooms show simple warning
  • No runtime or API behavior changes for non-team rooms

Summary by CodeRabbit

  • New Features

    • Users can leave teams via a dedicated confirmation dialog.
  • Improvements

    • Leave action is context-aware: supports team vs. single-room flows, preserves existing single-room behavior, performs proper cleanup, shows success feedback, and navigates appropriately.
  • Tests

    • Added unit tests verifying team-aware leave parameters and menu behavior.

@sezallagwal sezallagwal requested a review from a team as a code owner January 31, 2026 09:28
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Jan 31, 2026

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

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

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 Jan 31, 2026

⚠️ No Changeset found

Latest commit: b3aa61f

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

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 31, 2026

Walkthrough

Adds team-aware leave behavior: teamId and teamMain are passed into the leave flow. If provided, a LeaveTeam modal is shown and the teams.leave endpoint is called; otherwise the existing per-room leave flow runs. Tests updated to cover team context.

Changes

Cohort / File(s) Summary
Team Leave Core Logic
apps/meteor/client/hooks/menuActions/useLeaveRoom.tsx
Added teamId?: string and teamMain?: boolean to LeaveRoomProps. Introduced conditional team-leave path that opens LeaveTeam modal, calls teams.leave on confirm (with optional rooms), shows success toast, navigates home if needed, closes legacy room, and ensures modal cleanup. Original per-room leave flow preserved for non-team cases.
Leave Action Integration
apps/meteor/client/hooks/useRoomMenuActions.ts, apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.ts
Imported useUserRoom and fetches room; updated calls to useLeaveRoomAction to pass teamId: room?.teamId and teamMain: room?.teamMain, enabling team-aware leave handling.
Tests and Specs
apps/meteor/client/hooks/useRoomMenuActions.spec.ts, apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
Added/updated unit tests and fixtures to supply room with team context, assert useLeaveRoomAction receives team params, and validate menu structure when room data is present. Extended test wrappers to include room fixtures.

Sequence Diagram

sequenceDiagram
    participant User
    participant LeaveAction as Leave Action Handler
    participant LeaveTeamModal as LeaveTeam Modal
    participant TeamsAPI as Teams API
    participant UI as UI/Navigation

    User->>LeaveAction: Trigger leave (includes teamId + teamMain)
    alt Team leave flow
        LeaveAction->>LeaveTeamModal: Open modal with teamId
        User->>LeaveTeamModal: Confirm leave
        LeaveTeamModal->>TeamsAPI: POST teams.leave (teamId, rooms?)
        TeamsAPI-->>LeaveTeamModal: Success
        LeaveTeamModal->>UI: Show success toast
        LeaveTeamModal->>UI: Navigate home (if active room)
        LeaveTeamModal->>UI: Close legacy room
        LeaveTeamModal->>LeaveTeamModal: Close/cleanup modal
    else Per-room flow
        LeaveAction->>UI: Execute existing per-room leave flow (modal, endpoint, toast, cleanup)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped in code to open the gate,
Teams can leave together — isn’t that great?
A modal wave, a tiny cheer,
Old room routes stay crystal clear.
Farewell, team — the carrot’s near! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 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 team leave flow support to the room menu action, which is the primary objective of this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 811370f and b3aa61f.

📒 Files selected for processing (2)
  • apps/meteor/client/hooks/useRoomMenuActions.ts
  • apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.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/navigation/sidepanel/hooks/useRoomMenuActions.ts
  • apps/meteor/client/hooks/useRoomMenuActions.ts
🧠 Learnings (3)
📚 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/navigation/sidepanel/hooks/useRoomMenuActions.ts
  • apps/meteor/client/hooks/useRoomMenuActions.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/navigation/sidepanel/hooks/useRoomMenuActions.ts
  • apps/meteor/client/hooks/useRoomMenuActions.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/navigation/sidepanel/hooks/useRoomMenuActions.ts
  • apps/meteor/client/hooks/useRoomMenuActions.ts
🧬 Code graph analysis (1)
apps/meteor/client/hooks/useRoomMenuActions.ts (2)
packages/ui-contexts/src/index.ts (1)
  • useUserRoom (87-87)
apps/meteor/client/hooks/menuActions/useLeaveRoom.tsx (1)
  • useLeaveRoomAction (30-95)
🔇 Additional comments (2)
apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.ts (1)

3-3: LGTM — team context cleanly threaded through to the leave action.

The addition of useUserRoom(rid) and optional chaining on room?.teamId / room?.teamMain is correct and consistent with the sibling hook file. The removed TODO aligns with the coding guideline to avoid code comments.

Also applies to: 40-40, 61-61

apps/meteor/client/hooks/useRoomMenuActions.ts (1)

3-3: LGTM — mirrors the sidepanel hook changes correctly.

Same pattern as the sibling file: useUserRoom retrieves team context, optional chaining guards against undefined, and the leave action receives the necessary teamId/teamMain props.

Also applies to: 35-35, 55-55

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@sezallagwal sezallagwal changed the title fix(rooms): add team leave flow to room menu action fix: add team leave flow to room menu action Jan 31, 2026
@dougfabris dougfabris added the contrib: valid A valid contribution where maintainers will review based on priority label Feb 6, 2026
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/navigation/sidepanel/hooks/useRoomMenuActions.ts (1)

3-3: 🛠️ Refactor suggestion | 🟠 Major

Merge useUserRoom into the existing @rocket.chat/ui-contexts import on line 3.

useUserRoom is imported separately on line 14, but line 3 already imports from the same package. Consolidate to avoid a duplicate import source.

-import { usePermission, useRouter, useSetting, useUserSubscription } from '@rocket.chat/ui-contexts';
+import { usePermission, useRouter, useSetting, useUserRoom, useUserSubscription } from '@rocket.chat/ui-contexts';
...
-import { useUserRoom } from '@rocket.chat/ui-contexts';

Also applies to: 14-14

🧹 Nitpick comments (2)
apps/meteor/client/hooks/useRoomMenuActions.spec.ts (2)

45-53: Inconsistent indentation: mixed spaces and tabs.

Lines 48 and 65 use spaces for indentation on .withRoom(...), while all other chained calls use tabs. This should be consistent.

 		renderHook(() => useRoomMenuActions(mockHookProps), {
 			wrapper: mockAppRoot()
 				.withSubscription({ ...mockSubscription, rid: 'room1' })
-                .withRoom(roomWithTeam)
+				.withRoom(roomWithTeam)
 				.withPermission('leave-c')

41-76: Consider resetting mocks between tests to prevent state leakage.

useLeaveRoomAction is a jest.fn() whose call history persists across tests. The second test's assertions don't depend on it, but adding a beforeEach(() => jest.clearAllMocks()) is a good practice to keep tests isolated.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9aea3f and 811370f.

📒 Files selected for processing (4)
  • apps/meteor/client/hooks/useRoomMenuActions.spec.ts
  • apps/meteor/client/hooks/useRoomMenuActions.ts
  • apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
  • apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/client/hooks/useRoomMenuActions.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{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/hooks/useRoomMenuActions.spec.ts
  • apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
  • apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/client/hooks/useRoomMenuActions.spec.ts
  • apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
🧠 Learnings (16)
📚 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/hooks/useRoomMenuActions.spec.ts
  • apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.

Applied to files:

  • apps/meteor/client/hooks/useRoomMenuActions.spec.ts
  • apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
📚 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/hooks/useRoomMenuActions.spec.ts
  • apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
📚 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/page-objects/**/*.ts : Utilize existing page objects pattern from `apps/meteor/tests/e2e/page-objects/`

Applied to files:

  • apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
📚 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/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
📚 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/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
📚 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/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
📚 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/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
📚 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} : Store commonly used locators in variables/constants for reuse

Applied to files:

  • apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
📚 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 : All test files must be created in `apps/meteor/tests/e2e/` directory

Applied to files:

  • apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
📚 Learning: 2026-01-19T18:08:13.423Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38169
File: packages/ui-client/src/hooks/useGoToDirectMessage.ts:20-27
Timestamp: 2026-01-19T18:08:13.423Z
Learning: In React hooks, including custom hooks like useUserSubscriptionByName, must always be called unconditionally and in the same order on every render, per the Rules of Hooks. Passing empty strings or fallback values to hooks is the correct approach when dealing with potentially undefined values, rather than conditionally calling the hook based on whether the value exists.

Applied to files:

  • apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts
📚 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/navigation/sidepanel/hooks/useRoomMenuActions.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/navigation/sidepanel/hooks/useRoomMenuActions.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/navigation/sidepanel/hooks/useRoomMenuActions.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: 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/navigation/sidepanel/hooks/useRoomMenuActions.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/navigation/sidepanel/hooks/useRoomMenuActions.ts
🧬 Code graph analysis (2)
apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts (1)
apps/meteor/tests/mocks/data.ts (2)
  • createFakeSubscription (97-124)
  • createFakeRoom (47-62)
apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.ts (2)
packages/ui-contexts/src/index.ts (1)
  • useUserRoom (87-87)
apps/meteor/client/hooks/menuActions/useLeaveRoom.tsx (1)
  • useLeaveRoomAction (30-95)
⏰ 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: cubic · AI code reviewer
🔇 Additional comments (3)
apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.ts (1)

40-41: LGTM — team context plumbing looks correct.

useUserRoom(rid) is called unconditionally, and optional chaining on room?.teamId / room?.teamMain safely handles the case where the room is not yet loaded. The values flow correctly into useLeaveRoomAction.

Also applies to: 61-61

apps/meteor/client/views/navigation/sidepanel/hooks/useRoomMenuActions.spec.ts (1)

5-8: LGTM — room context correctly supplied to all test cases.

The addition of createFakeRoom and .withRoom(mockRoom) ensures useUserRoom(rid) returns valid data in all test wrappers, aligning with the new room dependency in the hook.

Also applies to: 45-45, 63-63, 81-81, 95-95

apps/meteor/client/hooks/useRoomMenuActions.spec.ts (1)

11-29: No mock needed — useToggleNotificationAction is not imported by useRoomMenuActions.

The implementation file does not import useToggleNotificationAction, so the missing mock is not an issue. The spec file already mocks all the hooks that the implementation actually uses.

Likely an incorrect or invalid review comment.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contrib: valid A valid contribution where maintainers will review based on priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants