Skip to content

fix: Disable composer actions without subscription to channel - #41202

Merged
dionisio-bot[bot] merged 10 commits into
developfrom
fix/disabled-composer-actions
Jul 16, 2026
Merged

dionisio-bot[bot] merged 10 commits into
developfrom
fix/disabled-composer-actions

Conversation

@yash-rajpal

@yash-rajpal yash-rajpal commented Jul 6, 2026 •

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Disables all composer actions when user is not subscribed to a channel.

Issue(s)

Steps to test or reproduce

  • Open a public channel, the user isn't a part of
  • Some composer actions are not disabled

Further comments

CORE-2349

Summary by CodeRabbit

Summary

  • Bug Fixes

    • During public channel previews, all composer primary toolbar actions remain visible but are disabled until the channel is joined.
    • Composer “More actions” is now disabled when recording is in progress or when sending isn’t allowed.
    • Timestamp, discussion, and share-location actions now correctly respect the shared disabled state.
  • Tests

    • Added end-to-end coverage to verify that, in public channel preview mode, all composer primary actions are present and disabled.

@dionisio-bot

dionisio-bot Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

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

@changeset-bot

changeset-bot Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8f687e7

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

This PR includes changesets to release 3 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings 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

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Composer actions are disabled during public channel preview when sending is unavailable, recording is active, or editing is in progress. The timestamp, discussion, and location actions now receive disabled state from the toolbar, and the preview E2E test and changeset were updated.

Changes

Composer action disabling

Layer / File(s) Summary
Toolbar disabled state and action hooks
apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/MessageBoxActionsToolbar.tsx, apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useTimestampAction.tsx, apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useCreateDiscussionAction.tsx, apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useShareLocationAction.tsx
Derives a shared disabled flag in the toolbar, applies it to mapped menu items and the More_actions menu, and threads it through the timestamp, discussion, and share-location hooks so their returned actions reflect the disabled state. The toolbar also changes a type import and removes the icon cast.
Preview test and changeset
apps/meteor/tests/e2e/preview-public-channel.spec.ts, .changeset/light-geckos-start.md
Adds a preview-public-channel E2E check that asserts composer primary actions are disabled, and adds a patch changeset describing the behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: type: bug

Suggested reviewers: dougfabris

🚥 Pre-merge checks | ✅ 5
✅ 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 summarizes the main change: composer actions are disabled when the user is not subscribed to a channel.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • CORE-2349: Request failed with status code 401

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.

@yash-rajpal yash-rajpal added this to the 8.7.0 milestone Jul 6, 2026
@yash-rajpal yash-rajpal added the stat: QA assured Means it has been tested and approved by a company insider label Jul 6, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jul 6, 2026
@yash-rajpal
yash-rajpal marked this pull request as ready for review July 6, 2026 20:59
@yash-rajpal
yash-rajpal requested a review from a team as a code owner July 6, 2026 20:59

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 (2)
apps/meteor/tests/e2e/message-composer.spec.ts (2)

196-227: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider test.step() for readability.

The new test mixes several distinct phases (switch user, navigate, assert toolbar disabled state, assert "More actions" menu items) in one flat block. Wrapping each phase in test.step() would improve report readability and align with the project convention used elsewhere in this same file (e.g., lines 73-101).

As per path instructions for apps/meteor/tests/e2e/**/*.spec.ts: "Use test.step() for complex test scenarios to improve organization in Playwright tests."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/tests/e2e/message-composer.spec.ts` around lines 196 - 227, The
new Playwright test in the disabled actions block is too flat and should be
split into named steps for readability. Update the test in the `disabled
actions` describe group by wrapping the login switch, navigation,
disabled-toolbar assertions, and the “More actions” menu assertions in separate
`test.step()` calls, following the pattern already used elsewhere in this spec
and the `test('should disable all toolbar actions when user is not part of
room', ...)` flow.

Source: Path instructions


215-220: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid .locator(':not(:last-child)'); prefer semantic filtering.

This CSS-selector chain is fragile (depends on DOM ordering to exclude the "More actions" button) and departs from the project's semantic-locator convention.

♻️ Suggested alternative
-			const actions = await poHomeChannel.composer.allPrimaryActions.locator(':not(:last-child)').all();
+			const actions = await poHomeChannel.composer.allPrimaryActions
+				.filter({ hasNotText: 'More actions' })
+				.all();

As per path instructions, apps/meteor/tests/e2e/**/*.spec.ts guidelines state: "Avoid using page.locator() in Playwright tests - always prefer semantic locators such as page.getByRole(), page.getByLabel(), page.getByText(), or page.getByTitle()."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/tests/e2e/message-composer.spec.ts` around lines 215 - 220, The
test in message-composer.spec.ts is using a fragile CSS exclusion selector to
skip the “More actions” button, so replace the
`allPrimaryActions.locator(':not(:last-child)')` usage with a semantic
locator/filter approach based on the actual button roles or labels. Update the
`poHomeChannel.composer.allPrimaryActions` selection logic so the `actions`
collection excludes the “More actions” control without relying on DOM order, and
keep the `expect(action).toBeDisabled()` assertion unchanged.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/MessageBoxActionsToolbar.tsx`:
- Line 62: The WebDAV actions in MessageBoxActionsToolbar still leave the static
“Add Server” item enabled too early. Update the WebDAV action construction so
the `webdav-add` entry also respects `disableBasicActions` (in addition to the
existing success state), likely within `useWebdavActions`, and verify the
`webdavActions` returned to `MessageBoxActionsToolbar` disables “Add Server”
until joining is complete.

---

Nitpick comments:
In `@apps/meteor/tests/e2e/message-composer.spec.ts`:
- Around line 196-227: The new Playwright test in the disabled actions block is
too flat and should be split into named steps for readability. Update the test
in the `disabled actions` describe group by wrapping the login switch,
navigation, disabled-toolbar assertions, and the “More actions” menu assertions
in separate `test.step()` calls, following the pattern already used elsewhere in
this spec and the `test('should disable all toolbar actions when user is not
part of room', ...)` flow.
- Around line 215-220: The test in message-composer.spec.ts is using a fragile
CSS exclusion selector to skip the “More actions” button, so replace the
`allPrimaryActions.locator(':not(:last-child)')` usage with a semantic
locator/filter approach based on the actual button roles or labels. Update the
`poHomeChannel.composer.allPrimaryActions` selection logic so the `actions`
collection excludes the “More actions” control without relying on DOM order, and
keep the `expect(action).toBeDisabled()` assertion unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 37c51c8e-55c8-443e-a5b2-7daf30b5ce7d

📥 Commits

Reviewing files that changed from the base of the PR and between b2b5edf and fd866de.

📒 Files selected for processing (7)
  • .changeset/light-geckos-start.md
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/MessageBoxActionsToolbar.tsx
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useCreateDiscussionAction.tsx
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useShareLocationAction.tsx
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useTimestampAction.tsx
  • apps/meteor/tests/e2e/message-composer.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
🧰 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/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useShareLocationAction.tsx
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useCreateDiscussionAction.tsx
  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
  • apps/meteor/tests/e2e/message-composer.spec.ts
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/MessageBoxActionsToolbar.tsx
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useTimestampAction.tsx
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 (9)
📚 Learning: 2026-03-16T21:50:37.589Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39676
File: .changeset/migrate-users-register-openapi.md:3-3
Timestamp: 2026-03-16T21:50:37.589Z
Learning: For changes related to OpenAPI migrations in Rocket.Chat/OpenAPI, when removing endpoint types and validators from rocket.chat/rest-typings (e.g., UserRegisterParamsPOST, /v1/users.register) document this as a minor changeset (not breaking) per RocketChat/Rocket.Chat-Open-API#150 Rule 7. Note that the endpoint type is re-exposed via a module augmentation .d.ts in the consuming package (e.g., packages/web-ui-registration/src/users-register.d.ts). In reviews, ensure the changeset clearly states: this is a non-breaking change, the major version should not be bumped, and the changeset reflects a minor version bump. Do not treat this as a breaking change during OpenAPI migrations.

Applied to files:

  • .changeset/light-geckos-start.md
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.

Applied to files:

  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useShareLocationAction.tsx
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useCreateDiscussionAction.tsx
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/MessageBoxActionsToolbar.tsx
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useTimestampAction.tsx
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useShareLocationAction.tsx
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useCreateDiscussionAction.tsx
  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
  • apps/meteor/tests/e2e/message-composer.spec.ts
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/MessageBoxActionsToolbar.tsx
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useTimestampAction.tsx
📚 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-24T19:39:42.247Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/page-objects/fragments/message.ts:7-7
Timestamp: 2026-02-24T19:39:42.247Z
Learning: In RocketChat e2e tests, avoid using data-qa attributes to locate elements. Prefer semantic locators such as getByRole, getByLabel, getByText, getByTitle and ARIA-based selectors. Apply this rule to all TypeScript files under apps/meteor/tests/e2e to improve test reliability, accessibility, and maintainability.

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
  • apps/meteor/tests/e2e/message-composer.spec.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
  • apps/meteor/tests/e2e/message-composer.spec.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/composer.ts
  • apps/meteor/tests/e2e/message-composer.spec.ts
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/tests/e2e/message-composer.spec.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/tests/e2e/message-composer.spec.ts
🔇 Additional comments (7)
apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useCreateDiscussionAction.tsx (1)

8-8: LGTM!

Also applies to: 31-31

apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useShareLocationAction.tsx (1)

9-9: LGTM!

Also applies to: 31-31

apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useTimestampAction.tsx (1)

8-8: LGTM!

Also applies to: 25-25

apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/MessageBoxActionsToolbar.tsx (1)

39-166: LGTM on the rest of the wiring — disableBasicActions is correctly threaded into fileUploadAction, createDiscussionAction, shareLocationAction, timestampAction, and the generic app/message-box action items (line 126), which addresses the core reported bug of undisabled composer actions.

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

201-213: LGTM!

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

125-132: LGTM!

.changeset/light-geckos-start.md (1)

1-5: LGTM!

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

4 issues found across 7 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread apps/meteor/tests/e2e/page-objects/fragments/composer.ts Outdated
Comment thread apps/meteor/tests/e2e/message-composer.spec.ts Outdated
Comment thread apps/meteor/tests/e2e/page-objects/fragments/composer.ts
Comment thread apps/meteor/tests/e2e/message-composer.spec.ts
@codecov

codecov Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 68.41%. Comparing base (b634242) to head (8f687e7).
⚠️ Report is 16 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #41202      +/-   ##
===========================================
+ Coverage    68.27%   68.41%   +0.13%     
===========================================
  Files         3968     3970       +2     
  Lines       154740   154939     +199     
  Branches     27847    27880      +33     
===========================================
+ Hits        105652   105998     +346     
+ Misses       44294    44193     -101     
+ Partials      4794     4748      -46     
Flag Coverage Δ
e2e 59.25% <92.85%> (-0.13%) ⬇️
e2e-api 44.34% <ø> (-0.03%) ⬇️
unit 70.31% <ø> (-0.36%) ⬇️

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
apps/meteor/tests/e2e/preview-public-channel.spec.ts (1)

52-57: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider a simple loop instead of Promise.all(map).

Since assertions here don't need to run in parallel for correctness, a for...of loop is more idiomatic/readable than wrapping in Promise.all.

♻️ Optional simplification
-			const actions = await poHomeChannel.composer.allPrimaryActions.all();
-			await Promise.all(
-				actions.map(async (action) => {
-					await expect(action).toBeDisabled();
-				}),
-			);
+			const actions = await poHomeChannel.composer.allPrimaryActions.all();
+			for (const action of actions) {
+				await expect(action).toBeDisabled();
+			}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/meteor/tests/e2e/preview-public-channel.spec.ts` around lines 52 - 57,
The assertion block in preview-public-channel.spec.ts is using Promise.all with
actions.map even though the checks do not need parallel execution. Update the
test around poHomeChannel.composer.allPrimaryActions.all() to iterate through
actions with a simple for...of loop and await expect(action).toBeDisabled()
sequentially, keeping the same assertion behavior while improving readability.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/meteor/tests/e2e/preview-public-channel.spec.ts`:
- Around line 52-57: The assertion block in preview-public-channel.spec.ts is
using Promise.all with actions.map even though the checks do not need parallel
execution. Update the test around poHomeChannel.composer.allPrimaryActions.all()
to iterate through actions with a simple for...of loop and await
expect(action).toBeDisabled() sequentially, keeping the same assertion behavior
while improving readability.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fb300b2d-1e89-435c-ad60-22d97ec9046f

📥 Commits

Reviewing files that changed from the base of the PR and between fd866de and 848f11d.

📒 Files selected for processing (2)
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/MessageBoxActionsToolbar.tsx
  • apps/meteor/tests/e2e/preview-public-channel.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/MessageBoxActionsToolbar.tsx
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
⚠️ CI failures not shown inline (2)

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ✅ **QA assured**
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**

GitHub Check: Dionisio QA: Some checks did not pass

Conclusion: failure

View job details

**Conclusion:** failure
### Steps
- ✅ **No merge conflicts**
- ✅ **QA assured**
- ✅ **Mergeable**
- ✅ **Has milestone or project**
- ✅ **Valid PR title**
- ✅ **Correct target version**
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{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/preview-public-channel.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/preview-public-channel.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/preview-public-channel.spec.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/preview-public-channel.spec.ts
🧠 Learnings (6)
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/tests/e2e/preview-public-channel.spec.ts
📚 Learning: 2026-02-24T19:39:42.247Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/page-objects/fragments/message.ts:7-7
Timestamp: 2026-02-24T19:39:42.247Z
Learning: In RocketChat e2e tests, avoid using data-qa attributes to locate elements. Prefer semantic locators such as getByRole, getByLabel, getByText, getByTitle and ARIA-based selectors. Apply this rule to all TypeScript files under apps/meteor/tests/e2e to improve test reliability, accessibility, and maintainability.

Applied to files:

  • apps/meteor/tests/e2e/preview-public-channel.spec.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/tests/e2e/preview-public-channel.spec.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/tests/e2e/preview-public-channel.spec.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/tests/e2e/preview-public-channel.spec.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/tests/e2e/preview-public-channel.spec.ts
🔇 Additional comments (2)
apps/meteor/tests/e2e/preview-public-channel.spec.ts (2)

1-117: LGTM!


45-58: 🎯 Functional Correctness

No change needed for the toolbar action assertions. allPrimaryActions already covers every button in the composer primary-actions toolbar, including the More_actions menu, so this test is fine.

			> Likely an incorrect or invalid review comment.

@yash-rajpal
yash-rajpal requested a review from dougfabris July 7, 2026 19:28

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 8 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

dougfabris
dougfabris previously approved these changes Jul 8, 2026
@dougfabris dougfabris removed the stat: QA assured Means it has been tested and approved by a company insider label Jul 9, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label Jul 9, 2026
@dougfabris dougfabris added the stat: QA assured Means it has been tested and approved by a company insider label Jul 9, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jul 9, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Jul 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 9, 2026
@dougfabris
dougfabris force-pushed the fix/disabled-composer-actions branch from fe25f0d to 8f687e7 Compare July 15, 2026 17:04
@dougfabris dougfabris removed the stat: QA assured Means it has been tested and approved by a company insider label Jul 15, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label Jul 15, 2026
@dougfabris dougfabris added the stat: QA assured Means it has been tested and approved by a company insider label Jul 15, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jul 15, 2026
@dougfabris dougfabris removed the stat: QA assured Means it has been tested and approved by a company insider label Jul 15, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label Jul 15, 2026
@dougfabris dougfabris added the stat: QA assured Means it has been tested and approved by a company insider label Jul 15, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jul 15, 2026
@dougfabris dougfabris modified the milestone: 8.7.0 Jul 15, 2026
@dionisio-bot dionisio-bot Bot added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Jul 15, 2026
@yash-rajpal yash-rajpal removed the stat: QA assured Means it has been tested and approved by a company insider label Jul 15, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label Jul 15, 2026
@yash-rajpal yash-rajpal added stat: ready to merge PR tested and approved waiting for merge stat: QA assured Means it has been tested and approved by a company insider labels Jul 15, 2026
@yash-rajpal
yash-rajpal requested a review from dougfabris July 15, 2026 19:55
@yash-rajpal yash-rajpal added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Jul 15, 2026
@dougfabris dougfabris removed the stat: QA assured Means it has been tested and approved by a company insider label Jul 15, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label Jul 15, 2026
@dougfabris dougfabris added the stat: QA assured Means it has been tested and approved by a company insider label Jul 15, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jul 15, 2026
@dionisio-bot
dionisio-bot Bot added this pull request to the merge queue Jul 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 15, 2026
@yash-rajpal yash-rajpal removed the stat: QA assured Means it has been tested and approved by a company insider label Jul 16, 2026
This was referenced Jul 20, 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 type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants