You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS: pinch to zoom a scroll container's one child (minimumZoomScale, maximumZoomScale, zoomScale) #666
There is no way to let a person pinch-zoom content on iOS: a photo, a diagram, a map drawn in the page, or a large board. UIScrollView has this built in (minimumZoomScale, maximumZoomScale, zoomScale, viewForZooming(in:)), but Contract's scroll does not expose it.
Request
Three attributes on a scroll container with one child, mapped to UIScrollView's own zoom on iOS:
minimumZoomScale and maximumZoomScale: the range a pinch scales the child through, about the fingers, with UIKit's bounce at both ends;
zoomScale: the scale the scroller opens at, and the one it moves to when the value changes.
The child keeps its layout. The scroller's extent grows by the child's size times the scale, and the child is centred while the whole is smaller than the port, as a photo viewer does. Other hosts could ignore the three until they have an equivalent.
How a fork built it
appandflow/exact#11 adds the three props (kernel/tables/schema.json, lowered in contract/lower/src/tags.rs, listed in the vocab card) and a new ScrollZoomIOS.swift:
UIKit zooms a proxy view of its own, inserted under the child, which viewForZooming(in:) returns. The child itself is not the zoom view, because a node's transform belongs to the host (applyTransform), and a view with two writers shows whichever wrote last.
The child is drawn from the scroller's scale through hostPlacement (zoomFactor, zoomShift), so its own transform, press feedback and animations compose with the zoom.
settleZoom() runs after a batch, in restoreScrollPositions, after a scroller's position is restored and before any authored offset lands. It applies the range and any new zoomScale, and not while the person is zooming or UIKit is bouncing.
scrollViewDidZoom re-places the child and queues a scroll event.
A scroller with no valid range (missing, non-finite, or max <= min), or with more than one child, drops the zoom and puts the child back as layout placed it.
Caveat: the fork's build was checked with codec tests and an app's web contract tests, but the pinch itself was not exercised on that branch.
Host
iOS
Smallest app that shows it
The proposed usage. A compiler without the change refuses it with lower-unknown-attr (scroll has no attribute minimumZoomScale).
component App
view
scroll width="100%" height="100%" minimumZoomScale=1 maximumZoomScale=4 zoomScale=1
column width=600 height=600 background-image="linear-gradient(45deg, #e53935, #1e88e5)"
text "Pinch me"
Exact commit
f3a4ace. Upstream's kernel/tables/schema.json has no zoom-scale prop, and no iOS file implements viewForZooming(in:) for a scroller.
Decided, after a three-model panel (unanimous): a zoomable scroller belongs in Exact, but as one vocabulary on every host, not UIKit's names on iOS alone. An RFC extending LLP 1057.001 will define an -exact- property on a scroller with one child, mapped to UIScrollView zoom on iOS and NSScrollView magnification on macOS, emulated elsewhere or refused by name. Your proxy-view technique is the likely iOS half. The RFC goes through review before it's built.
Progress under LLP 1057.001.000, "Zoomable scrollers". It went through a three-model panel check and a full review before any code.
Vocabulary (1a4f774): a scroll container takes a zoom range through -exact- rows, the scrollZoom command writes its zoom, and ScrollEvent.scrollZoom reports it.
iOS (3514b23): UIScrollView zoom. A real two-finger pinch reaches 1.78 and stops at 4 and 1. A double tap zooms to 2, and a press on content that isn't a control is held until a second tap can no longer come. A smaller child is centred, with padding and margins left unscaled.
macOS (65065d2): NSScrollView magnification. A pinch keeps the point under it still.
Web (b416d7a): an emulation loaded only by apps that use it. Touch pinch, trackpad pinch and double tap all work, and each gesture ends with exactly one scrollend.
Gallery (cb717d2): the interaction gallery's viewer has a zoomable photo with Fit and 2×.
Still to build: the painted hosts (Linux, Windows, Android) drawing the child scaled, with pinch and double tap, and Windows touch pinch. This issue stays open until those land.
Progress on the zoomable scroller (LLP 1057.001.000, steps 5 and 6): Android, Linux and Windows now zoom a scroller's one child, in 2f544b330, 77c04b454 and b90240ad5.
Android: a real two-finger pinch zooms the photo (to 207% on the emulator), and a double tap zooms to 200% about the tap. While zoomed, one finger pans and flings, and ctrl+wheel zooms from a mouse.
Linux: ctrl+wheel zooms about the pointer. Headless, the 2× screenshot matches the web's.
Windows: a second finger starts a pinch. This is tested with a unit test and a cross-compile only; it has not been run on Windows hardware.
Web: three fixes in 9111553dc. The inspector no longer reports the runtime's touch-action as authored. A prerendered page shows the zoomed child at its real height before boot instead of collapsing. That prerender was also throwing on any zoomable app, which is fixed.
I'm leaving this open until it has run on Windows hardware. Still queued: zoomed images on the painted hosts are decoded at their unzoomed size, so a photo at 4× is soft.
Activity
ccheever commentedon Nov 15, 2026
Decided, after a three-model panel (unanimous): a zoomable scroller belongs in Exact, but as one vocabulary on every host, not UIKit's names on iOS alone. An RFC extending LLP 1057.001 will define an
-exact-property on a scroller with one child, mapped to UIScrollView zoom on iOS and NSScrollView magnification on macOS, emulated elsewhere or refused by name. Your proxy-view technique is the likely iOS half. The RFC goes through review before it's built.Posted by Claude Code on the maintainers' behalf.
A scroll container takes a zoom range and reports its zoom
The shared font choice baseline plan carries the zoom schema's digest
iOS pinches, double-taps and writes a zoomable scroll container's zoom
macOS magnifies a zoomable scroll container
The web zooms a zoomable scroll container
The interaction gallery's viewer zooms its photo in a zoomable scroller
ccheever commentedon Nov 15, 2026
Progress under LLP 1057.001.000, "Zoomable scrollers". It went through a three-model panel check and a full review before any code.
-exact-rows, thescrollZoomcommand writes its zoom, andScrollEvent.scrollZoomreports it.scrollend.Still to build: the painted hosts (Linux, Windows, Android) drawing the child scaled, with pinch and double tap, and Windows touch pinch. This issue stays open until those land.
Posted by Claude Code on the maintainers' behalf.
The painted hosts draw and zoom a zoomable scroller
Android's reader pinches, double taps and pans a zoomable scroller
Two fingers on Windows pinch a zoomable scroller
The web's zoomable scroller keeps its layers out of the author's rows
Docs and the gallery's diary say where zoomable scrollers stand
ccheever commentedon Nov 15, 2026
Progress on the zoomable scroller (LLP 1057.001.000, steps 5 and 6): Android, Linux and Windows now zoom a scroller's one child, in
2f544b330,77c04b454andb90240ad5.9111553dc. The inspector no longer reports the runtime'stouch-actionas authored. A prerendered page shows the zoomed child at its real height before boot instead of collapsing. That prerender was also throwing on any zoomable app, which is fixed.I'm leaving this open until it has run on Windows hardware. Still queued: zoomed images on the painted hosts are decoded at their unzoomed size, so a photo at 4× is soft.
Posted by Claude Code on the maintainers' behalf.