Skip to content

fix(mobile): video previews keep their fit on iOS - #32195

Open
bartlomiejbloniarz wants to merge 1 commit into
pingdotgg:mainfrom
bartlomiejbloniarz:fix/video-preview-fit
Open

bartlomiejbloniarz wants to merge 1 commit into
pingdotgg:mainfrom
bartlomiejbloniarz:fix/video-preview-fit

Conversation

@bartlomiejbloniarz

@bartlomiejbloniarz bartlomiejbloniarz commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On iOS, an inline video preview is sometimes drawn zoomed in and cropped instead of letterboxed. It stays that way until the view is recreated. This happens on main, for example in PR descriptions with portrait recordings.

expo-image draws a frame object as soon as it is set, with the contentFit the view has at that moment. A preview frame that arrives in the same update that mounts the image view is drawn with the default cover fit, even though the view asks for contain.

Change

VideoThumbnailImage keeps its image view mounted and passes the frame only after the view's first layout. By then contentFit is applied, so the frame is drawn with the requested fit.

Related PRs

This follows #25988, which kept before/after video tables intact in PR descriptions. #32196 fixes a separate bug where previews never load on mobile; the two PRs are independent. A fix for videos keeping their own aspect ratio will follow once these merge.

Scope and approval

A small fix of a visible bug: portrait previews are shown zoomed in. It changes only VideoThumbnailImage.

Verification

  • vp test run src/lib/videoThumbnails.test.ts src/lib/filePreview.test.ts src/components in apps/mobile: passes.
  • vp run typecheck in apps/mobile, vp lint and vp fmt --check on the changed file: pass.
  • iOS simulator, on current main and with this change: the same portrait recording's preview is cropped before and letterboxed after.

iOS — preview of a portrait recording in a PR description

BeforeAfter

Before

After

Claude Opus 5.5 in Claude Code, running in T3 Code.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 6, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at b22bb98

Macroscope's review found this PR approvable — Video thumbnails now receive their frame after layout so iOS preserves the intended fit. The change is limited to preview rendering and leaves loading behavior and product defaults unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

VideoThumbnailImage now renders its image view with a null source until layout completes. After layout, it sets the source to the loaded or cached thumbnail.

Changes: Thumbnail image layout

Layer / File(s) Summary
Keep the image mounted until layout
apps/mobile/src/components/VideoThumbnailImage.tsx
The component tracks whether the image view has laid out. It renders the image with a null source before layout, then uses the thumbnail source. Previously, it returned null when no thumbnail was available.

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

Change: Bug fix

Suggested labels: bugfix, size:S

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to b22bb

Video previews defer their frame until layout. No merge-blocking regression was established.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly describes the iOS video preview fit fix.
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.
Description check Passed The description covers the problem, change, scope, and verification. It includes before and after screenshots and identifies the agent used.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b90e554 and b22bb98.

Files selected for processing: 1

  • apps/mobile/src/components/VideoThumbnailImage.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

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

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant