[mobile][photos] Enable text selection during zoom#10023
[mobile][photos] Enable text selection during zoom#10023Amrithesh-Kakkoth wants to merge 3 commits intoente-io:mainfrom
Conversation
Amrithesh-Kakkoth
commented
Apr 12, 2026
- Add ZoomTransform (scale + offset) propagated via InheritedDetailPageState
- Subscribe to PhotoViewController.outputStateStream in ZoomableImage to push continuous transform updates on every gesture frame
- Wrap OCR overlay in a Transform that mirrors the zoom instead of hiding it; text boundaries stay aligned with the image during pinch-to-zoom
- Overlay becomes interactive 200ms after gesture settles
- Use a Listener to count active pointers; force IgnorePointer when 2+ fingers are down so pinch gestures always reach PhotoView
- Increase teardrop handle hitbox from 52 to 72px for easier grabbing
- Add ZoomTransform (scale + offset) propagated via InheritedDetailPageState - Subscribe to PhotoViewController.outputStateStream in ZoomableImage to push continuous transform updates on every gesture frame - Wrap OCR overlay in a Transform that mirrors the zoom instead of hiding it; text boundaries stay aligned with the image during pinch-to-zoom - Overlay becomes interactive 200ms after gesture settles - Use a Listener to count active pointers; force IgnorePointer when 2+ fingers are down so pinch gestures always reach PhotoView - Increase teardrop handle hitbox from 52 to 72px for easier grabbing
Resolve conflict in zoomable_image.dart: keep zoom transform tracking (zoomTransformNotifier reset + initialScale reset) from our branch, drop debug print from upstream.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80fde5b732
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3dbbd2aa14
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3dbbd2aa14
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| unawaited(_zoomStreamSubscription?.cancel()); | ||
| _photoViewController = PhotoViewController( | ||
| initialPosition: currentPosition, | ||
| initialScale: scale, | ||
| ); | ||
| _subscribeToZoomStream(); |
There was a problem hiding this comment.
Reset zoom baseline after swapping PhotoViewController
When _updatePhotoViewController replaces _photoViewController for a higher-resolution image during an active zoom, the code resubscribes to outputStateStream but never resets _initialScale. Because _subscribeToZoomStream computes relativeScale as value.scale / _initialScale, this reuses a baseline from the old controller even though the new controller’s scale was renormalized (scale is adjusted by image-width ratio). In practice, users who are zoomed in when the final image loads can get a mis-scaled OCR overlay (text bounds drift) until zoom returns to initial state.
Useful? React with 👍 / 👎.
- Reset _initialScale when swapping PhotoViewController in _updatePhotoViewController so the new controller's scale range is used as the baseline, preventing overlay transform jumps when the final image loads while the user is zoomed in. - Fix overlay settle debounce not restarting after a post-settle re-zoom (e.g. double-tap). Previously the !_zoomGestureSettled guard meant the 200ms timer was never restarted once settled, leaving the overlay interactive during subsequent zoom animations. Now every incoming transform resets the flag and restarts the debounce within the same builder pass.