STX integration blocker
Follow-up to https://github.com/stacksjs/stx/issues/2091. Shared Image is covered through explicit imports on web/native, but its default-resolution migration remains gated on a faithful native contract for CSS object-position and object-fit: scale-down. STX currently diagnoses these rather than silently approximating them. Legacy native source callers and the web Image builtin must stay compatible.
Read-only audit of clean Craft b49aa1e894198d1b8b5fe7b07a6fa43d2d6d34f6:
packages/ios/templates/CraftNativeScreen.swift:imageContentModesupports cover/stretch/center and defaults to aspect-fit; Image/ImageBackground readresizeMode. There is no object-position or explicit scale-down input.packages/android/templates/MainActivityNative.kt.template: the image branches support cover/stretch/center and otherwise useCENTER_INSIDE. That default does not have the same upscaling behavior as iOS aspect-fit, so please define the new CSS-facing contract explicitly while preserving existing callers.- STX's
native/image-fit.test.tsandnative/shared-image-fit.test.tsdeliberately report unsupported scale-down/object-position. Replacing those diagnostics with contain or center would change the requested rendering.
Requested host contract
Provide host-owned image positioning and an explicit scale-down mode usable by STX on iOS/Android. The exact protocol spelling can be coordinated, but the behavior should be:
- Position the image within its box, including percentage/keyword alignment and crop alignment for cover.
- Scale-down uses intrinsic size when it fits, otherwise contain; it never upscales a smaller image.
- Recompute after image load, source replacement, frame changes and live prop updates without replacing the image/player view or restarting an unchanged request.
- Preserve legacy
source/resizeModebehavior and define clear/reset defaults. - Cover small/large intrinsic images, cover crops, live updates, clear/default restoration and remounts with maintained host tests.
This issue records the host prerequisite for the assigned Craft agent. No Craft code was edited by the STX session. STX implementation/version status: current published baseline 0.2.745; shared Image migration remains open in #2091 until the capability is available and integrated.