Skip to content

[Bug]: Android image previews retain half-screen width after window expansion #13854

Closed

Description

@dylan1020

Area

apps/mobile

Description

On a Google Pixel 10 Fold, full-screen image previews appear on only one side of the unfolded display. This is reported from both chat and Files, both when opening T3 already unfolded and after unfolding.

I reproduced the same half-width layout in an Android emulator by expanding a window after JavaScript initialized in split screen. The modal header and background fill the display, but the image keeps the old narrow width. Physical fold/unfold has not yet been directly tested.

Steps to reproduce

Using an Android development client on a Pixel 10 Pro Fold AVD:

  1. Make a PNG available in a chat message and the project's Files panel.
  2. Put T3 in Android split screen beside Settings.
  3. Reload JavaScript through the Expo development menu while T3 is narrow.
  4. Close the companion Settings app so T3 expands to the full display, preserving T3's runtime.
  5. Open the image from chat, then try Files → full-screen preview.
  6. Close and reopen the preview.

Expected behavior

The image fits and centers within the current app viewport after a window-size change, including when a preview is reopened.

Actual behavior

Both entry points keep the image in the left half. Reopening the Files preview does not recover it. Reloading JavaScript at full width restores correct sizing.

On the 2076-pixel-wide display, the visible test image's center is x=512.5 after expansion, matching the old 1026-pixel window. The correct center before the transition and after a full-width reload is x=1037.5.

Version and environment

  • Commit: 95030dc674883f0f2a7fd034b32ce742c8cf55d0
  • Android 16 / API 36, Pixel 10 Pro Fold emulator, x86_64
  • React Native 0.86.3, Expo 57.0.18, react-native-image-viewing 0.2.2
  • Development build includes a separate local native startup fix for Shiki; image viewer code is unchanged.
  • The physical phone's app and Android versions are not yet recorded. Whether an already-unfolded launch resumed an existing process is unknown.

Investigation

react-native-image-viewing captures dimensions at module scope in its Android image item, gallery, loading view, and gesture hook. The Android image item continues using that initial window width. T3's shared MediaImagePreview already requests full-screen presentation.

The dependency has a closely matching report: jobtoday/react-native-image-viewing#141. A targeted search found no exact T3 duplicate.

A fix should cover both chat and Files, opening after resize and resizing while open, and zoom/pan bounds. A fresh reload at full width recovers the emulator; restarting after unfolding is not yet verified as a workaround on the physical phone.

Screenshots

Chat after expansion:

Chat image stays in the old narrow width

Files after expansion:

Files image stays in the old narrow width

Activity

  1. juliusmarminge commented on Sep 26, 2026

    @juliusmarminge
    Member

    Confirmed on current main. This is an Android-only bug in the full-screen image viewer, and the emulator steps are enough to treat it as real.

    Chat and Files both open images through FilePreviewModal. On Android that renders react-native-image-viewing (MediaImagePreview when the source has actions, which both of those entry points do; the no-actions fallback uses the same library). presentationStyle="fullScreen" only affects the React Native modal. iOS does not use this viewer; FilePreview.ios.tsx hands the file to Quick Look.

    [email protected] (April 2022, still the latest release) snapshots size at import time:

    • ImageItem.android and usePanResponder call Dimensions.get("window") and keep that width for the image frame and zoom/pan bounds.
    • ImageViewing and ImageLoading call Dimensions.get("screen") and keep that width for gallery item layout.

    Those constants are not read again when the modal opens. The modal chrome is flex: 1 / width: "100%", so the header and backdrop follow the new window while the image stays in the width captured at JavaScript startup. That matches the reported centers: x=512.5 in the old 1026px window, x=1037.5 after a full-width reload. Closing and reopening the preview cannot recover, because the module is already evaluated. A JavaScript reload at the new width can.

    The same snapshot is why zoom and pan stay wrong after a resize, including a resize while the preview is open. A fix has to size the Android image item, gallery layout, loading view, and gesture bounds from the current window (and update them on change). Remounting our wrapper is not enough while the library keeps module-scope constants. There is no patch for this package in the repo, and no existing T3 issue for this layout. Upstream jobtoday/react-native-image-viewing#141 is the same class of bug and is still open.

    The physical Pixel 10 Fold app version, and whether that launch resumed an already-running process, are still unrecorded. They are not needed to accept the bug: starting JavaScript while the window is narrow and then expanding it is the failure mode, and the split-screen emulator sequence hits the same code.

  2. added
    bug
    accepted
    via-triage
    on Sep 26, 2026
  3. juliusmarminge commented on Oct 20, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    Fixed by #13859, which just merged to main: Android image previews in chat and Files now refit to the current window size after a fold, split-screen change, or resize. Please reopen if you still see the half-width layout on a build that includes it.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedbugvia-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions