Repository navigation
fix(mobile): resize Android image previews with the window - #13859
Conversation
Refresh viewer sizing and gesture bounds after Android window changes, and remount the gallery at its current image to reset zoom. Fixes pingdotgg#13854.
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — The PR applies a substantial third-party dependency patch to the production Android image-preview path, changing dimension handling, list remounting, gesture state, and scroll/index lifecycle. Because this is an existing-path runtime behavior change involving native resize timing, human review is warranted. You can add or adjust custom eligibility rules. Learn more. |
|
Note Reviews pausedIt 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
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Taking over this one for maintainer batch terminal-preview-13. I will bring it onto current main, keep the Android resize fix focused, and push the reviewed changes to this branch. |
…mage-viewer # Conflicts: # pnpm-lock.yaml # pnpm-workspace.yaml
# Conflicts: # pnpm-workspace.yaml
Android image previews use the current window size when opened and after a fold, split-screen, width change, or height change. The dependency previously cached its startup dimensions, leaving the image, loading indicator, and pan bounds at the old size.
The dependency patch refits the image and resets zoom, paging, and header controls on resize. It keeps the nearest gallery image reported by scroll events, including during a swipe, and ignores callbacks from the replaced list. A native page movement whose scroll event has not yet reached JavaScript remains an unresolved timing case. The image list remounts while the header retains its state, so resizing no longer aborts a share download. Both MediaImagePreview and FilePreview use the patched boundary. iOS keeps its existing geometry and momentum-end indexing. Stable animation values are shared; the first gallery image can now unmount after paging away and briefly reload when returning, matching the other pages. Include this in the iOS regression pass.
Credit to @dylan1020 for the original fix in #13859. The takeover preserves the original commits, merges current main, and handles galleries now present on main. The dependency changes are candidates for upstreaming; no upstream PR was opened.
Validation:
Diagnostic output: original patch gallery failure, current head, including pre-commit events and the unresolved conditional ordering, fractional-width before, fractional-width after.
Header lifecycle diagnostic: before, after. This checks component preservation, not a native share sheet.
Native proof is still required. Device access is disabled in this environment, so there are no current-head Android or iOS screenshots/recordings. Verify both preview entry paths on Android: fold/unfold or split-screen, height-only resize, delayed image loading, zoom/pan then resize, and resize during gallery dragging/momentum. Confirm native event ordering, fractional-density gallery paging and save/share targets, close controls, safe-area/Modal behavior, and iOS regressions. macOS, Windows, and Electron desktop were not exercised; those surfaces use separate image preview UIs.
Independent full-diff review: round 1 found the fractional-density regression (fixed) and the conditional delayed-scroll case (unresolved native verification). Round 2 identified a guard that discarded valid pre-commit events (fixed by deletion). Round 3 identified a header remount that aborted a pending share (fixed by moving the resize key to the list). Round 4 returned no confirmed code defects from either reviewer. The minor first-cell retention change is accepted and documented above. Current-head build/typecheck, lint, test jobs, release smoke, Rust, and native fingerprint checks passed. An earlier cancelled fingerprint run was superseded by a successful run. Macroscope correctness passed; approvability requires human review of the native runtime changes. This PR is not ready for merge without native proof.
Implemented with Codex gpt-6.1-sol; test analysis with Codex gpt-6-astra; adversarial review with Claude Opus 5.5 and Codex gpt-6-sol, through T3 Code.