Skip to content

feat(room): Embed Link Previews by channel#40861

Open
TasfinMahmud wants to merge 3 commits into
RocketChat:developfrom
TasfinMahmud:feat/embed-link-previews-by-channel
Open

feat(room): Embed Link Previews by channel#40861
TasfinMahmud wants to merge 3 commits into
RocketChat:developfrom
TasfinMahmud:feat/embed-link-previews-by-channel

Conversation

@TasfinMahmud

@TasfinMahmud TasfinMahmud commented Jun 9, 2026

Copy link
Copy Markdown

Proposed changes

Closes #7734.

This PR adds a per-channel setting to disable link previews. When enabled, the setting skips OEmbed metadata fetching and rendering for that specific room, overriding the global link preview setting.

  • Added disableLinkPreviews to IRoom schema and @rocket.chat/models methods.
  • Wired the new setting to RoomsSaveRoomSettingsProps and validation schemas in @rocket.chat/rest-typings.
  • Exposed a "Disable Link Previews" toggle in the "Advanced settings" section of the Room Edit form UI.
  • Hooked the setting up to AfterSaveOEmbed.ts to abort URL parsing when disableLinkPreviews is true.

Issue(s)

Closes #7734

How to test or reproduce

  1. Start the server and create a new channel.
  2. Send a message with a link. Observe that a link preview is generated.
  3. Edit the room settings and toggle "Disable Link Previews" on (under Advanced Settings).
  4. Send another message with a link. Observe that no link preview is generated for this new message.

Screenshots

N/A

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • New Features
    • Added a per-channel "Disable link previews" setting with a toggle in Room Info → Advanced settings (labeled "Disable link previews"). When enabled, link previews are not generated for that channel. The toggle is disabled for federated rooms and the UI includes the new English label.

@TasfinMahmud TasfinMahmud requested review from a team as code owners June 9, 2026 18:04
@dionisio-bot

dionisio-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a1d753d

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

This PR includes changesets to release 17 packages
Name Type
@rocket.chat/meteor Minor
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/models Minor
@rocket.chat/model-typings Minor
@rocket.chat/i18n Minor
@rocket.chat/ui-client Major
@rocket.chat/mock-providers Patch
@rocket.chat/ui-contexts Major
@rocket.chat/web-ui-registration Major
@rocket.chat/uikit-playground Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/ui-avatar Major
@rocket.chat/ui-video-conf Major
@rocket.chat/ui-voip Major

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

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

3 issues found across 9 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts">

<violation number="1" location="apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts:56">
P1: `disableLinkPreviews` is added to form initial values but never sent to the server in the save handler. In `EditRoomInfo.tsx`, `handleUpdateRoomData` destructures `disableLinkPreviews` from `formData` and then calls `saveAction({ ...data, ... })` without ever including `disableLinkPreviews`. The server endpoint `/v1/rooms.saveRoomSettings` does handle this field (see `saveRoomSettings.ts:355`), so the toggle will appear to work but changes will never be persisted.</violation>
</file>

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

Re-trigger cubic

@@ -18,6 +18,7 @@ export type EditRoomInfoFormData = {
archived: boolean;

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.

P1: disableLinkPreviews is added to form initial values but never sent to the server in the save handler. In EditRoomInfo.tsx, handleUpdateRoomData destructures disableLinkPreviews from formData and then calls saveAction({ ...data, ... }) without ever including disableLinkPreviews. The server endpoint /v1/rooms.saveRoomSettings does handle this field (see saveRoomSettings.ts:355), so the toggle will appear to work but changes will never be persisted.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts, line 56:

<comment>`disableLinkPreviews` is added to form initial values but never sent to the server in the save handler. In `EditRoomInfo.tsx`, `handleUpdateRoomData` destructures `disableLinkPreviews` from `formData` and then calls `saveAction({ ...data, ... })` without ever including `disableLinkPreviews`. The server endpoint `/v1/rooms.saveRoomSettings` does handle this field (see `saveRoomSettings.ts:355`), so the toggle will appear to work but changes will never be persisted.</comment>

<file context>
@@ -52,6 +53,7 @@ export const useEditRoomInitialValues = (room: IRoomWithRetentionPolicy): Partia
 			joinCodeRequired: !!joinCodeRequired,
 			systemMessages: Array.isArray(sysMes) ? sysMes : [],
 			hideSysMes: Array.isArray(sysMes) ? !!sysMes?.length : !!sysMes,
+			disableLinkPreviews: !!disableLinkPreviews,
 			encrypted,
 			...(canEditRoomRetentionPolicy &&
</file context>

Comment thread apps/meteor/server/services/messages/hooks/AfterSaveOEmbed.ts
Comment thread packages/i18n/src/locales/en.i18n.json Outdated
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7888cbc8-c3a9-4a5b-942f-5fef90ca67c8

📥 Commits

Reviewing files that changed from the base of the PR and between 3dcb2fc and a1d753d.

📒 Files selected for processing (3)
  • apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx
  • apps/meteor/server/services/messages/hooks/AfterSaveOEmbed.ts
  • packages/i18n/src/locales/en.i18n.json
💤 Files with no reviewable changes (1)
  • apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/i18n/src/locales/en.i18n.json
📜 Recent review details
⏰ 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 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/server/services/messages/hooks/AfterSaveOEmbed.ts
🧠 Learnings (3)
📚 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/server/services/messages/hooks/AfterSaveOEmbed.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/server/services/messages/hooks/AfterSaveOEmbed.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/server/services/messages/hooks/AfterSaveOEmbed.ts
🔇 Additional comments (2)
apps/meteor/server/services/messages/hooks/AfterSaveOEmbed.ts (2)

339-341: LGTM!


343-348: LGTM!


Walkthrough

Adds a per-channel disableLinkPreviews setting: type and i18n updates, model persistence, REST validation, server enforcement in OEmbed processing, client form state and UI toggle, and a changeset entry.

Changes

Per-Channel Link Preview Control

Layer / File(s) Summary
Type definitions and localization
packages/core-typings/src/IRoom.ts, packages/i18n/src/locales/en.i18n.json
IRoom interface extended with optional disableLinkPreviews boolean field; English localization adds Disable_Link_Previews.
Database model and persistence
packages/model-typings/src/models/IRoomsModel.ts, packages/models/src/models/Rooms.ts
IRoomsModel declares saveDisableLinkPreviewsById. RoomsRaw.saveDisableLinkPreviewsById implemented with conditional $set/$unset and updateOne.
REST API validation schema
packages/rest-typings/src/v1/rooms.ts
RoomsSaveRoomSettingsProps type and AJV RoomsSaveRoomSettingsSchema extended to accept optional disableLinkPreviews?: boolean.
Room settings save integration
apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts
RoomSettings gains disableLinkPreviews; settingSavers adds handler calling Rooms.saveDisableLinkPreviewsById; request-key whitelist extended to include 'disableLinkPreviews'.
OEmbed preview enforcement
apps/meteor/server/services/messages/hooks/AfterSaveOEmbed.ts
Rooms imported; rocketUrlParser loads room by message.rid (projecting disableLinkPreviews) and returns early when disableLinkPreviews is enabled to skip URL/OEmbed processing.
Client form data and initialization
apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts
EditRoomInfoFormData adds disableLinkPreviews; hook reads room value, coerces to boolean for initial form data, and includes it in memo deps.
Client UI form and rendering
apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx
Component watches disableLinkPreviews, creates control id via useId, and renders a controlled toggle labeled Disable_Link_Previews (disabled when federated) bound to form state.
Release notes
.changeset/embed-link-previews.md
Changeset entry records minor package bumps and the new per-channel disable link previews setting.

Sequence Diagram

sequenceDiagram
  participant Client
  participant saveRoomSettings as MeteorMethod:saveRoomSettings
  participant RoomsModel as Rooms.saveDisableLinkPreviewsById
  participant DB
  participant AfterSaveOEmbed as AfterSaveOEmbed/rocketUrlParser
  Client->>saveRoomSettings: submit dirty fields incl. disableLinkPreviews
  saveRoomSettings->>RoomsModel: call saveDisableLinkPreviewsById(rid, value)
  RoomsModel->>DB: updateOne({_id: rid}, { $set/$unset disableLinkPreviews })
  DB-->>RoomsModel: update result
  RoomsModel-->>saveRoomSettings: result
  Client->>AfterSaveOEmbed: send message with url and rid
  AfterSaveOEmbed->>DB: findOne({_id: rid}, { disableLinkPreviews: 1 })
  DB-->>AfterSaveOEmbed: { disableLinkPreviews: true/false }
  alt disableLinkPreviews true
    AfterSaveOEmbed-->>AfterSaveOEmbed: return message unchanged (skip OEmbed)
  else
    AfterSaveOEmbed-->>AfterSaveOEmbed: continue URL/OEmbed processing
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • tassoevan
  • MartinSchoeler
🚥 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 clearly summarizes the main feature: adding per-channel control for link previews, which is the primary change across all modified files.
Linked Issues check ✅ Passed The PR fully implements the requested feature from #7734: a per-room setting to disable link previews with UI toggle, validation, and OEmbed hook integration.
Out of Scope Changes check ✅ Passed All changes directly support the feature objective; no unrelated modifications detected beyond the scope of adding per-room link preview control.
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.

@coderabbitai coderabbitai Bot added the type: feature Pull requests that introduces new feature label Jun 9, 2026

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

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/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx (1)

154-197: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Critical: disableLinkPreviews will never be saved to the server.

The disableLinkPreviews parameter is destructured at line 157 but never included in the payload sent to saveAction. Fields handled via getDirtyFields (like roomName, roomDescription, etc.) must remain in the formData rest parameter, not be destructured separately.

Compare with retention fields (lines 179-187): when a field is destructured, it must be explicitly added to the payload. Currently, disableLinkPreviews is destructured but missing from the payload.

🐛 Fix: Remove from parameter destructuring
 const handleUpdateRoomData = useEffectEvent(
 	async ({
 		hideSysMes,
-		disableLinkPreviews,
 		joinCodeRequired,
 		retentionEnabled,

After this change, disableLinkPreviews will remain in formData and be included via getDirtyFields, just like other boolean toggles (readOnly, reactWhenReadOnly, etc.).

🤖 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/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx`
around lines 154 - 197, The handler handleUpdateRoomData is destructuring
disableLinkPreviews out of the incoming EditRoomInfoFormData so it never reaches
getDirtyFields and thus is not sent to saveAction; remove disableLinkPreviews
from the destructured parameters (leave it in the rest formData) so
getDirtyFields can capture it, or alternatively explicitly add
disableLinkPreviews to the payload passed to saveAction (in the saveAction call
near the spread of data) if you prefer an explicit approach; locate
handleUpdateRoomData, getDirtyFields, and the saveAction payload to apply the
change.
🤖 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.

Outside diff comments:
In
`@apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx`:
- Around line 154-197: The handler handleUpdateRoomData is destructuring
disableLinkPreviews out of the incoming EditRoomInfoFormData so it never reaches
getDirtyFields and thus is not sent to saveAction; remove disableLinkPreviews
from the destructured parameters (leave it in the rest formData) so
getDirtyFields can capture it, or alternatively explicitly add
disableLinkPreviews to the payload passed to saveAction (in the saveAction call
near the spread of data) if you prefer an explicit approach; locate
handleUpdateRoomData, getDirtyFields, and the saveAction payload to apply the
change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7b2ce3ab-041f-4a7d-a059-7ce3e67e370e

📥 Commits

Reviewing files that changed from the base of the PR and between 24dc6ec and 3dcb2fc.

📒 Files selected for processing (10)
  • .changeset/embed-link-previews.md
  • apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts
  • apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx
  • apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts
  • apps/meteor/server/services/messages/hooks/AfterSaveOEmbed.ts
  • packages/core-typings/src/IRoom.ts
  • packages/i18n/src/locales/en.i18n.json
  • packages/model-typings/src/models/IRoomsModel.ts
  • packages/models/src/models/Rooms.ts
  • packages/rest-typings/src/v1/rooms.ts
📜 Review details
⏰ 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 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:

  • packages/model-typings/src/models/IRoomsModel.ts
  • packages/core-typings/src/IRoom.ts
  • apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts
  • packages/models/src/models/Rooms.ts
  • apps/meteor/server/services/messages/hooks/AfterSaveOEmbed.ts
  • packages/rest-typings/src/v1/rooms.ts
  • apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts
  • apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx
🧠 Learnings (8)
📚 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/embed-link-previews.md
📚 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:

  • packages/model-typings/src/models/IRoomsModel.ts
  • packages/core-typings/src/IRoom.ts
  • apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts
  • packages/models/src/models/Rooms.ts
  • apps/meteor/server/services/messages/hooks/AfterSaveOEmbed.ts
  • packages/rest-typings/src/v1/rooms.ts
  • apps/meteor/app/channel-settings/server/methods/saveRoomSettings.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:

  • packages/model-typings/src/models/IRoomsModel.ts
  • packages/core-typings/src/IRoom.ts
  • apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts
  • packages/models/src/models/Rooms.ts
  • apps/meteor/server/services/messages/hooks/AfterSaveOEmbed.ts
  • packages/rest-typings/src/v1/rooms.ts
  • apps/meteor/app/channel-settings/server/methods/saveRoomSettings.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:

  • packages/model-typings/src/models/IRoomsModel.ts
  • packages/core-typings/src/IRoom.ts
  • apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts
  • packages/models/src/models/Rooms.ts
  • apps/meteor/server/services/messages/hooks/AfterSaveOEmbed.ts
  • packages/rest-typings/src/v1/rooms.ts
  • apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts
  • apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx
📚 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/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts
📚 Learning: 2026-05-11T20:30:35.265Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 40480
File: apps/meteor/client/meteor/startup/accounts.ts:59-61
Timestamp: 2026-05-11T20:30:35.265Z
Learning: In Rocket.Chat’s Meteor client code, when calling `dispatchToastMessage` with `{ type: 'error' }`, pass the raw caught error object as `message` without manual normalization. `dispatchToastMessage` is designed to accept `message: unknown` for error toasts, so avoid converting errors to strings (e.g., `String(error)`) or extracting `error.message` before passing them.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts
📚 Learning: 2026-05-11T23:14:59.316Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 40469
File: packages/rest-typings/src/v1/users.ts:337-337
Timestamp: 2026-05-11T23:14:59.316Z
Learning: In Rocket.Chat REST endpoint typings (e.g., packages/rest-typings/src/v1/users.ts and other rest-typings files), keep the established convention of deriving field types from the domain model (e.g., use IUser indexed access like IUser['statusExpiresAt']) rather than swapping individual fields to serialized primitives (like string) in an ad-hoc way. If a truly different “serialized” representation is needed, perform the refactor consistently across the codebase (not just a single endpoint/field) and ensure all related REST typings stay aligned with the shared serialization types.

Applied to files:

  • packages/rest-typings/src/v1/rooms.ts
📚 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/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx
🔇 Additional comments (10)
.changeset/embed-link-previews.md (1)

1-10: LGTM!

packages/core-typings/src/IRoom.ts (1)

35-36: LGTM!

packages/model-typings/src/models/IRoomsModel.ts (1)

305-305: LGTM!

packages/models/src/models/Rooms.ts (1)

1900-1912: LGTM!

packages/rest-typings/src/v1/rooms.ts (1)

385-385: LGTM!

Also applies to: 470-470

apps/meteor/app/channel-settings/server/methods/saveRoomSettings.ts (1)

51-51: LGTM!

Also applies to: 355-357, 394-394

apps/meteor/server/services/messages/hooks/AfterSaveOEmbed.ts (1)

11-11: LGTM!

Also applies to: 339-344

apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts (1)

21-21: LGTM!

Also applies to: 39-39, 56-56, 82-82

apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx (1)

496-509: LGTM!

packages/i18n/src/locales/en.i18n.json (1)

2527-2527: LGTM!

@TasfinMahmud TasfinMahmud force-pushed the feat/embed-link-previews-by-channel branch from d52038b to a1d753d Compare June 9, 2026 18:25
@coderabbitai coderabbitai Bot removed the type: feature Pull requests that introduces new feature label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Embed Link Previews by channel

1 participant