Skip to content

fix: Mentions popup remains open after canceling message edit#38635

Merged
dionisio-bot[bot] merged 4 commits intodevelopfrom
fix/mention-popup-stuck
Feb 26, 2026
Merged

fix: Mentions popup remains open after canceling message edit#38635
dionisio-bot[bot] merged 4 commits intodevelopfrom
fix/mention-popup-stuck

Conversation

@aleksandernsilva
Copy link
Contributor

@aleksandernsilva aleksandernsilva commented Feb 12, 2026

Proposed changes (including videos or screenshots)

This PR fixes an issue causing the composer's mentions popup to not close when canceling a message edit specifically by clicking on the "Cancel" button.

Before:
mention-popup-bug

After:
mention-popup-working

Issue(s)

CORE-1276

Steps to test or reproduce

  1. Navigate to any chat room.
  2. Send a normal message without any tags or special formatting.
  3. Locate the message you just sent and begin editing it.
  4. While in edit mode, type "@" in the message box to trigger the mentions tab.
  5. Cancel the message edit (“Esc”).
  6. Observe the mentions tab.

Further comments

Summary by CodeRabbit

  • Bug Fixes
    • Mention popup now closes reliably when canceling message edits (via Cancel button or Escape) and refreshes correctly if the edit content changes.
  • Tests
    • Added end-to-end tests covering message-edit cancellation and mention popup behavior to prevent regressions.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Feb 12, 2026

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

  • This PR is targeting the wrong base branch. It should target 8.3.0, but it targets 8.2.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

No actionable comments were generated in the recent review. 🎉

📜 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 3372416 and 058ce0f.

📒 Files selected for processing (4)
  • apps/meteor/client/views/room/composer/hooks/useComposerBoxPopup.ts
  • apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
  • apps/meteor/tests/e2e/message-composer.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
  • apps/meteor/tests/e2e/message-composer.spec.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{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/tests/e2e/page-objects/fragments/composer.ts
  • apps/meteor/client/views/room/composer/hooks/useComposerBoxPopup.ts
apps/meteor/tests/e2e/page-objects/**/*.ts

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

Utilize existing page objects pattern from apps/meteor/tests/e2e/page-objects/

Files:

  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
apps/meteor/tests/e2e/**/*.{ts,spec.ts}

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

apps/meteor/tests/e2e/**/*.{ts,spec.ts}: Store commonly used locators in variables/constants for reuse
Follow Page Object Model pattern consistently in Playwright tests

Files:

  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
🧠 Learnings (6)
📚 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 : Avoid using `page.locator()` in Playwright tests - always prefer semantic locators such as `page.getByRole()`, `page.getByLabel()`, `page.getByText()`, or `page.getByTitle()`

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/composer.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/tests/e2e/page-objects/fragments/composer.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/tests/e2e/page-objects/fragments/composer.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/tests/e2e/page-objects/fragments/composer.ts
📚 Learning: 2025-12-16T17:29:40.430Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37834
File: apps/meteor/tests/e2e/page-objects/fragments/admin-flextab-emoji.ts:12-22
Timestamp: 2025-12-16T17:29:40.430Z
Learning: In all page-object files under apps/meteor/tests/e2e/page-objects/, import expect from ../../utils/test (Playwright's async expect) instead of from Jest. Jest's expect is synchronous and incompatible with web-first assertions like toBeVisible, which can cause TypeScript errors.

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
📚 Learning: 2026-02-10T16:32:42.586Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38528
File: apps/meteor/client/startup/roles.ts:14-14
Timestamp: 2026-02-10T16:32:42.586Z
Learning: In Rocket.Chat's Meteor client code, DDP streams use EJSON and Date fields arrive as Date objects; do not manually construct new Date() in stream handlers (for example, in sdk.stream()). Only REST API responses return plain JSON where dates are strings, so implement explicit conversion there if needed. Apply this guidance to all TypeScript files under apps/meteor/client to ensure consistent date handling in DDP streams and REST responses.

Applied to files:

  • apps/meteor/client/views/room/composer/hooks/useComposerBoxPopup.ts
⏰ 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). (10)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: cubic · AI code reviewer
🔇 Additional comments (3)
apps/meteor/client/views/room/composer/hooks/useComposerBoxPopup.ts (2)

31-31: LGTM — update field added consistently to both union branches.

The type addition is clean and consistent across both branches of the discriminated union.

Also applies to: 43-43


274-274: LGTM — wiring update to setOptionByInput in both return paths.

This correctly exposes the ability for callers (e.g., MessageBox.tsx) to re-evaluate popup state after composer content changes, which is the mechanism that closes the mentions popup on edit cancellation.

Also applies to: 288-288

apps/meteor/tests/e2e/page-objects/fragments/composer.ts (1)

36-38: LGTM — btnCancel follows the established page-object pattern.

Uses semantic getByRole with exact: true, consistent with other button getters in the class. Based on learnings: "Avoid using page.locator() in Playwright tests - always prefer semantic locators such as page.getByRole()".


Walkthrough

Adds an update() callable to the composer popup hook return, changes edit-close logic to refresh/clear the popup based on reset, and adds E2E tests plus a page-object accessor validating popup closure on edit cancellation.

Changes

Cohort / File(s) Summary
Composer popup hook
apps/meteor/client/views/room/composer/hooks/useComposerBoxPopup.ts
Adds update(): void to both branches of ComposerBoxPopupResult<T> and wires it to setOptionByInput so the popup can be recomputed on demand.
MessageBox edit flow
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
Alters closeEditing logic: when reset is truthy, invokes popup update and returns early; when falsy, proceeds to cancel/stop and clears the popup. Minor formatting change.
E2E tests & page object
apps/meteor/tests/e2e/message-composer.spec.ts, apps/meteor/tests/e2e/page-objects/fragments/composer.ts
Adds two E2E tests asserting mention popup closes when cancelling an edit (via Cancel button and Escape), and adds get btnCancel(): Locator to the Composer page object.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant User
participant MessageBox
participant ComposerHook as ComposerHook/useComposerBoxPopup
participant MentionsPopup as MentionsPopup

User->>MessageBox: Start editing message
MessageBox->>ComposerHook: open/init with input ("@")
ComposerHook->>MentionsPopup: show mention suggestions
User->>MessageBox: Cancel edit (button or Esc)
MessageBox->>ComposerHook: call update() (when reset truthy) or clear popup
ComposerHook->>MentionsPopup: recompute/close suggestions
MentionsPopup-->>MessageBox: hidden

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nudged the popup with a twitch of my nose,
An update() hop, and the stubborn thing goes.
Cancel was pressed, the mentions took flight—
Tests clap their paws in the soft evening light. ✨

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (18 files):

⚔️ apps/meteor/client/components/deviceManagement/DeviceManagementTable/DeviceManagementTable.tsx (content)
⚔️ apps/meteor/client/views/account/deviceManagement/DeviceManagementAccountTable/DeviceManagementAccountRow.tsx (content)
⚔️ apps/meteor/client/views/admin/deviceManagement/DeviceManagementAdminTable/DeviceManagementAdminRow.tsx (content)
⚔️ apps/meteor/client/views/room/composer/hooks/useComposerBoxPopup.ts (content)
⚔️ apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx (content)
⚔️ apps/meteor/client/views/root/hooks/loggedIn/useForceLogout.ts (content)
⚔️ apps/meteor/definition/externals/meteor/meteor.d.ts (content)
⚔️ apps/meteor/ee/server/api/sessions.ts (content)
⚔️ apps/meteor/server/modules/listeners/listeners.module.ts (content)
⚔️ apps/meteor/tests/e2e/message-composer.spec.ts (content)
⚔️ apps/meteor/tests/e2e/page-objects/auth.ts (content)
⚔️ apps/meteor/tests/e2e/page-objects/fragments/composer.ts (content)
⚔️ apps/meteor/tests/e2e/page-objects/fragments/index.ts (content)
⚔️ apps/meteor/tests/e2e/page-objects/fragments/modals/index.ts (content)
⚔️ apps/meteor/tests/e2e/page-objects/fragments/table.ts (content)
⚔️ packages/core-services/src/events/Events.ts (content)
⚔️ packages/ddp-client/src/types/streams.ts (content)
⚔️ packages/i18n/src/locales/en.i18n.json (content)

These conflicts must be resolved before merging into develop.
Resolve conflicts locally and push changes to this branch.
✅ 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 clearly and concisely summarizes the main fix: closing the mentions popup when canceling a message edit, which directly corresponds to the primary change across all modified files.
Linked Issues check ✅ Passed The PR successfully addresses CORE-1276 by adding the update method to close popups, modifying editing cancellation logic to trigger popup refresh, and adding comprehensive E2E tests validating popup closure on edit cancellation.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the mentions popup bug: hook updates enable popup closure, MessageBox logic implements the fix, tests validate the behavior, and page object additions support test execution.
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.


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.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.47%. Comparing base (cb3e570) to head (058ce0f).
⚠️ Report is 127 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #38635   +/-   ##
========================================
  Coverage    70.46%   70.47%           
========================================
  Files         3175     3175           
  Lines       111091   111094    +3     
  Branches     20029    20028    -1     
========================================
+ Hits         78278    78289   +11     
+ Misses       30763    30761    -2     
+ Partials      2050     2044    -6     
Flag Coverage Δ
e2e 60.46% <100.00%> (+0.04%) ⬆️
e2e-api 47.73% <ø> (+0.01%) ⬆️
unit 71.44% <ø> (-0.02%) ⬇️

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.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.1GiB 1.1GiB +11MiB
rocketchat 360MiB 349MiB +11MiB
omnichannel-transcript-service 134MiB 134MiB -489B
queue-worker-service 134MiB 134MiB -455B
ddp-streamer-service 128MiB 128MiB -4.5KiB
account-service 115MiB 115MiB -3.6KiB
authorization-service 112MiB 112MiB -214B
presence-service 112MiB 112MiB -1.3KiB

📊 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/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 21:03", "12/22 18:54", "12/23 16:16", "12/24 19:38", "12/25 17:51", "12/26 13:18", "12/29 19:01", "12/30 20:52", "02/12 22:57", "02/13 15:52", "02/13 19:17 (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, 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, 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, 0.12, 0.12, 0.12, 0.12]
  line "omnichannel-transcript-service" [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, 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, 0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [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, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "rocketchat" [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.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.35]
Loading

Statistics (last 30 days):

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

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

  • Tag: pr-38635
  • Baseline: develop
  • Timestamp: 2026-02-13 19:17:29 UTC
  • Historical data points: 30

Updated: Fri, 13 Feb 2026 19:17:30 GMT

@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2026

⚠️ No Changeset found

Latest commit: 058ce0f

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

@aleksandernsilva
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

✅ 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: 2

🤖 Fix all issues with AI agents
In `@apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx`:
- Line 386: Remove the leftover debug console.log in MessageBox.tsx by deleting
the line that logs 'COMPOSER' along with shouldPopupPreview and popup.option;
locate the statement inside the MessageBox component where those symbols are
used and ensure no other debug-only console.log calls remain (leave behavior and
state of shouldPopupPreview and popup.option unchanged).

In `@apps/meteor/tests/e2e/message-composer.spec.ts`:
- Line 123: Fix the typo in the test step descriptions: locate the two test.step
calls using the exact string "expect to edit last message message" (occurrences
in message-composer.spec.ts) and change the description to "expect to edit last
message" for both instances so the step name is not duplicated.
🧹 Nitpick comments (1)
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx (1)

180-189: Logic looks correct for the fix, but remove the code comment.

The branching makes sense: when reset is truthy (content was changed and reverted), re-evaluate the popup; when falsy (no changes to revert), exit editing and clear the popup entirely.

However, the inline comment on Line 181 should be removed per coding guidelines. As per coding guidelines, **/*.{ts,tsx,js}: "Avoid code comments in the implementation."

Proposed fix
 			chat.currentEditingMessage.reset().then((reset) => {
-				// NOTE: if the message was reset (i.e. content changed), we just update the popup (to re-apply/remove the preview)
 				if (reset) {
 					popup.update();
 					return;
 				}
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 379c2b2 and 3372416.

📒 Files selected for processing (4)
  • apps/meteor/client/views/room/composer/hooks/useComposerBoxPopup.ts
  • apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
  • apps/meteor/tests/e2e/message-composer.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{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/tests/e2e/page-objects/fragments/composer.ts
  • apps/meteor/tests/e2e/message-composer.spec.ts
  • apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx
  • apps/meteor/client/views/room/composer/hooks/useComposerBoxPopup.ts
apps/meteor/tests/e2e/page-objects/**/*.ts

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

Utilize existing page objects pattern from apps/meteor/tests/e2e/page-objects/

Files:

  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
apps/meteor/tests/e2e/**/*.{ts,spec.ts}

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

apps/meteor/tests/e2e/**/*.{ts,spec.ts}: Store commonly used locators in variables/constants for reuse
Follow Page Object Model pattern consistently in Playwright tests

Files:

  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
  • apps/meteor/tests/e2e/message-composer.spec.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/tests/e2e/message-composer.spec.ts
apps/meteor/tests/e2e/**/*.spec.ts

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

apps/meteor/tests/e2e/**/*.spec.ts: All test files must be created in apps/meteor/tests/e2e/ directory
Avoid using page.locator() in Playwright tests - always prefer semantic locators such as page.getByRole(), page.getByLabel(), page.getByText(), or page.getByTitle()
Use test.beforeAll() and test.afterAll() for setup/teardown in Playwright tests
Use test.step() for complex test scenarios to improve organization in Playwright tests
Group related tests in the same file
Utilize Playwright fixtures (test, page, expect) for consistency in test files
Prefer web-first assertions (toBeVisible, toHaveText, etc.) in Playwright tests
Use expect matchers for assertions (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements in Playwright tests
Use page.waitFor() with specific conditions instead of hardcoded timeouts in Playwright tests
Implement proper wait strategies for dynamic content in Playwright tests
Maintain test isolation between test cases in Playwright tests
Ensure clean state for each test execution in Playwright tests
Ensure tests run reliably in parallel without shared state conflicts

Files:

  • apps/meteor/tests/e2e/message-composer.spec.ts
🧠 Learnings (15)
📚 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 : Avoid using `page.locator()` in Playwright tests - always prefer semantic locators such as `page.getByRole()`, `page.getByLabel()`, `page.getByText()`, or `page.getByTitle()`

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/composer.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/tests/e2e/page-objects/fragments/composer.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/tests/e2e/page-objects/fragments/composer.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/tests/e2e/page-objects/fragments/composer.ts
  • apps/meteor/tests/e2e/message-composer.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 : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
  • apps/meteor/tests/e2e/message-composer.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 : Prefer web-first assertions (`toBeVisible`, `toHaveText`, etc.) in Playwright tests

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
  • apps/meteor/tests/e2e/message-composer.spec.ts
📚 Learning: 2025-12-16T17:29:40.430Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37834
File: apps/meteor/tests/e2e/page-objects/fragments/admin-flextab-emoji.ts:12-22
Timestamp: 2025-12-16T17:29:40.430Z
Learning: In all page-object files under apps/meteor/tests/e2e/page-objects/, import expect from ../../utils/test (Playwright's async expect) instead of from Jest. Jest's expect is synchronous and incompatible with web-first assertions like toBeVisible, which can cause TypeScript errors.

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/composer.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 clean state for each test execution in Playwright tests

Applied to files:

  • apps/meteor/tests/e2e/message-composer.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/tests/e2e/message-composer.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/tests/e2e/message-composer.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 : Implement proper wait strategies for dynamic content in Playwright tests

Applied to files:

  • apps/meteor/tests/e2e/message-composer.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 `test.step()` for complex test scenarios to improve organization in Playwright tests

Applied to files:

  • apps/meteor/tests/e2e/message-composer.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/tests/e2e/message-composer.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/tests/e2e/message-composer.spec.ts
📚 Learning: 2026-02-10T16:32:42.586Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38528
File: apps/meteor/client/startup/roles.ts:14-14
Timestamp: 2026-02-10T16:32:42.586Z
Learning: In Rocket.Chat's Meteor client code, DDP streams use EJSON and Date fields arrive as Date objects; do not manually construct new Date() in stream handlers (for example, in sdk.stream()). Only REST API responses return plain JSON where dates are strings, so implement explicit conversion there if needed. Apply this guidance to all TypeScript files under apps/meteor/client to ensure consistent date handling in DDP streams and REST responses.

Applied to files:

  • apps/meteor/client/views/room/composer/hooks/useComposerBoxPopup.ts
🧬 Code graph analysis (1)
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx (1)
apps/meteor/tests/e2e/page-objects/fragments/modals/omnichannel-reset-priorities-modal.ts (1)
  • reset (14-17)
⏰ 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 (3)
apps/meteor/client/views/room/composer/hooks/useComposerBoxPopup.ts (1)

31-31: LGTM — update method cleanly exposes setOptionByInput.

The new update field is correctly typed and wired in both branches of the union. The () => void signature appropriately discards the return value of setOptionByInput.

Also applies to: 43-43, 274-274, 288-288

apps/meteor/tests/e2e/page-objects/fragments/composer.ts (1)

36-38: LGTM — follows existing patterns and uses semantic locators.

apps/meteor/tests/e2e/message-composer.spec.ts (1)

119-173: Good test coverage for both cancellation flows.

Both tests properly use test.step() for organization, web-first assertions, and the Page Object Model. The Cancel button and Escape key paths are well-covered with verification of popup dismissal, input value preservation on first cancel, and editing exit on second cancel.

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

@aleksandernsilva aleksandernsilva marked this pull request as ready for review February 16, 2026 13:06
@aleksandernsilva aleksandernsilva requested a review from a team as a code owner February 16, 2026 13:06
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 4 files

Copy link
Contributor

@juliajforesti juliajforesti left a comment

Choose a reason for hiding this comment

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

LGTM :)

@dougfabris dougfabris added this to the 8.3.0 milestone Feb 25, 2026
@aleksandernsilva aleksandernsilva added the stat: QA assured Means it has been tested and approved by a company insider label Feb 26, 2026
@dionisio-bot dionisio-bot bot added this pull request to the merge queue Feb 26, 2026
Merged via the queue into develop with commit 5f6b887 Feb 26, 2026
80 of 82 checks passed
@dionisio-bot dionisio-bot bot deleted the fix/mention-popup-stuck branch February 26, 2026 11:55
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants