Skip to content

fix: full screen video resizing and moving message list#40993

Open
MartinSchoeler wants to merge 2 commits into
developfrom
fix/message-list-grow
Open

fix: full screen video resizing and moving message list#40993
MartinSchoeler wants to merge 2 commits into
developfrom
fix/message-list-grow

Conversation

@MartinSchoeler

@MartinSchoeler MartinSchoeler commented Jun 17, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Issue(s)

CORE-2272

Steps to test or reproduce

Further comments

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Video attachment previews now maintain stable dimensions when loading, preventing layout shifts during playback initialization.

@MartinSchoeler MartinSchoeler added this to the 8.6.0 milestone Jun 17, 2026
@MartinSchoeler MartinSchoeler requested a review from a team as a code owner June 17, 2026 19:04
@dionisio-bot

dionisio-bot Bot commented Jun 17, 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 targeting the wrong base branch. It should target 8.7.0, but it targets 8.6.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0275dd3

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

@coderabbitai

coderabbitai Bot commented Jun 17, 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: d33119b9-a898-45f9-9196-2968153b6327

📥 Commits

Reviewing files that changed from the base of the PR and between 236eef2 and 9869cfd.

📒 Files selected for processing (1)
  • apps/meteor/client/components/message/content/attachments/file/VideoAttachment.tsx
📜 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). (5)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

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

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/components/message/content/attachments/file/VideoAttachment.tsx
🧠 Learnings (2)
📚 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/components/message/content/attachments/file/VideoAttachment.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/components/message/content/attachments/file/VideoAttachment.tsx
🔇 Additional comments (1)
apps/meteor/client/components/message/content/attachments/file/VideoAttachment.tsx (1)

4-4: LGTM!

Also applies to: 26-26, 32-43


Walkthrough

VideoAttachment adds a lockedHeight state via useState. MessageGenericPreview now receives lockedHeight as its minHeight. An onLoadedMetadata handler on the video element reads the parent element's offsetHeight and stores it in lockedHeight.

Changes

Video Preview Height Lock

Layer / File(s) Summary
lockedHeight state and metadata handler
apps/meteor/client/components/message/content/attachments/file/VideoAttachment.tsx
Adds useState import and a lockedHeight state (initially undefined). MessageGenericPreview uses lockedHeight for minHeight. An onLoadedMetadata callback on the <video> element reads parentElement.offsetHeight and stores it in lockedHeight.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Suggested labels

type: bug

🚥 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 directly matches the main change: fixing full screen video resizing issues by implementing dynamic height locking for video previews.
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.

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

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • CORE-2272: 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 and usage tips.

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

No issues found across 1 file

Re-trigger cubic

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 14.28571% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.09%. Comparing base (6033e93) to head (0275dd3).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40993      +/-   ##
===========================================
- Coverage    70.13%   70.09%   -0.05%     
===========================================
  Files         3358     3358              
  Lines       129563   129574      +11     
  Branches     22405    22444      +39     
===========================================
- Hits         90866    90821      -45     
- Misses       35386    35441      +55     
- Partials      3311     3312       +1     
Flag Coverage Δ
e2e 59.33% <33.33%> (+0.02%) ⬆️
e2e-api 46.18% <ø> (-0.13%) ⬇️
unit 70.00% <7.14%> (-0.07%) ⬇️

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.

@alfredodelfabro alfredodelfabro modified the milestones: 8.6.0, 8.7.0 Jun 19, 2026

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

changeset?

ref={mediaRef}
onLoadedMetadata={(event) => {
const video = event.currentTarget as HTMLVideoElement;
setLockedHeight(video.parentElement?.offsetHeight);

@juliajforesti juliajforesti Jun 19, 2026

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.

isn't this too weak? if this structure changes, the locator no longer points to where we are expecting...
maybe add ref to the element we want to track the size and change its height directly through the ref?

Comment on lines +32 to +43
<MessageGenericPreview style={{ maxWidth: 368, width: '100%', minHeight: lockedHeight }}>
<Box
is='video'
minHeight={80}
controls
preload='metadata'
ref={mediaRef}
onLoadedMetadata={(event) => {
const video = event.currentTarget as HTMLVideoElement;
setLockedHeight(video.parentElement?.offsetHeight);
}}
>

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.

no need for useState this way:

Suggested change
<MessageGenericPreview style={{ maxWidth: 368, width: '100%', minHeight: lockedHeight }}>
<Box
is='video'
minHeight={80}
controls
preload='metadata'
ref={mediaRef}
onLoadedMetadata={(event) => {
const video = event.currentTarget as HTMLVideoElement;
setLockedHeight(video.parentElement?.offsetHeight);
}}
>
<MessageGenericPreview ref={previewRef} style={{ maxWidth: 368, width: '100%' }}>
<Box
is='video'
minHeight={80}
controls
preload='metadata'
ref={mediaRef}
onLoadedMetadata={() => {
if (previewRef.current) {
previewRef.current.style.minHeight = `${previewRef.current.offsetHeight}px`;
}
}}
>

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.

3 participants