Skip to content

iOS: add zoomCoverScale so the flying cover matches a zoomed card - #6

Merged
artemlitch merged 1 commit into
readwisefrom
artem/zoom-cover-scale
Aug 28, 2026
Merged

iOS: add zoomCoverScale so the flying cover matches a zoomed card#6
artemlitch merged 1 commit into
readwisefrom
artem/zoom-cover-scale

Conversation

@artemlitch

Copy link
Copy Markdown
Contributor

Problem

Bookwise scales its book covers by 1.01 inside a clipping box, to hide a keyline along the image edge. The zoom flight does not know that.

zoomMakeStandInFromCardView rasterises the card into a flat stand-in, so the flight shows the cover at 1.0 while the card behind it sits at 1.01. The cover visibly changes size at the moment the flight hands over to the real card.

This is currently broken in production. readwiseio/rekindled already passes zoomCoverScale from LoggedInRootContainer.tsx, but nothing downstream accepts it, so the value is dropped and the prop is a no-op.

Fix

zoomCoverScale is a per-screen scale applied to the rasterised contents about the canvas centre, inside zoomMakeStandInFromCardView.

static inline CGFloat RNSZoomCoverScale(CGFloat override)
{
  return override > 0 ? override : 1;
}

Non-positive means no zoom, so every existing screen is unchanged: RNSZoomCoverScale maps the 0 default to 1, and the CGContextScaleCTM block is skipped entirely when the value is 1.

Plumbed exactly like the other Readwise zoom props (zoomCloseOvershoot and its siblings): native prop on RNSScreen, Fabric spec entries for both the screen and modal-screen components, ScreenProps, the InnerScreen forwarder, and NativeStackNavigationOptions.

iOS only. 45 lines added, none removed.

Base

Branched from readwise, not from #5. The stand-in machinery it hooks into is already on readwise, so this applies cleanly and can merge independently of the modal-zoom work.

Consumer side

Landing this is necessary but not sufficient. The #readwise ref has to be bumped, and patches/@react-navigation__native-stack@7.12.0.patch in rekindled needs zoomCoverScale added to its prop allow-list, or the navigator drops the prop before it reaches a screen. Being a native prop, it also needs a native build — it cannot ship over OTA.

Bookwise scales its book covers by 1.01 inside a clipping box, to hide a
keyline along the image edge. The zoom flight did not know that. It
rasterises the card into a flat stand-in, so the flight showed the cover at
1.0 while the card behind it sat at 1.01, and the cover changed size at the
moment the flight handed over.

zoomCoverScale is a per-screen scale applied to the rasterised contents about
the canvas centre, inside zoomMakeStandInFromCardView. Non-positive means no
zoom, so every existing screen is unchanged: RNSZoomCoverScale maps 0 to 1 and
the scaling block is skipped entirely when the value is 1.

Plumbed the same way as the other Readwise zoom props (zoomCloseOvershoot and
its siblings): native prop on RNSScreen, Fabric spec entries for both the
screen and modal-screen components, ScreenProps, the InnerScreen forwarder,
and NativeStackNavigationOptions.

iOS only. No behaviour change for any screen that does not set it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant