Repository navigation
PAM Native 1.42.0
·
625 commits
to main
since this release
PAM Native 1.42.0 adds media-library thumbnails, file existence checks, raw drag drivers, accessibility selection, keyboard tap persistence on scroll views and lists, per-route error boundaries, a native "new contact" form, multi-button alerts with permission rationale, and failure callbacks in place of exceptions across several system modules. Protocol: properties 537 (accessibilitySelected) and 538 (keyboardShouldPersistTaps), append-only. The other additions are new module methods and need no protocol change. Existing calls behave as before.
Media library
- Every
MediaAssetnow has athumbnailUri, the source to use for a grid cell.- Android: the typed images/video MediaStore URI.
Imagedecodes it at the view size from the platform thumbnail cache, and videos show a frame. - iOS: the
phasset://source, drawn at the view size. Videos show their poster frame.
- Android: the typed images/video MediaStore URI.
MediaLibrary::thumbnail($assetId, $maxPx, $done, $failure)writes a JPEG and returns itsfile://URI.- The longer edge is at most
$maxPx(clamped to 32-1024), and video frames are supported. - The image is decoded at that size: Android 10+ uses
loadThumbnail, older versions use a sampled decode orgetScaledFrameAtTime, and iOS uses PhotoKit. - Thumbnails go into a bounded disk cache: 24 MiB or 600 files, least recently used first, trimmed to 75%. The cache key includes the asset's modification date.
- The longer edge is at most
assets(..., failure:)andalbums(..., $failure)pass native failures, such as a missing permission, to the closure instead of throwing.refreshLimitedSelection(fn (bool $limited) => ...)reopens the system selection when photo access is limited: iOS 14+ presents the limited library picker, and Android 14+ requests the visual media permissions again.
Files
- New
Files::exists($path, fn (bool $exists) => ...). - New
Files::find(), which returns?FileReference. Files::stat()no longer throws when the file is missing. It calls the optionalmissingclosure instead; other failures go tofailure.
Gestures
Drag::driveRaw()drives a property from the raw finger translation, before bounds and rubber band are applied, and extrapolates past its points.driveUnbounded()makes everydrive()behave the same way.
Accessibility
accessibilitySelected/Element::accessibilitySelected()reports selection to TalkBack (AccessibilityNodeInfo.isSelected) and VoiceOver (.selectedtrait) without changing the visualselectedstate.
Keyboard
keyboardShouldPersistTapsworks onScrollView,FlatList,SectionListandVirtualizedList, as in React Native, through the newKeyboardPersistTapsenum:never: a tap dismisses the keyboard and is consumed.handled: the keyboard is dismissed only when no child handles the tap.always: taps never dismiss the keyboard.- React Native's boolean values are also accepted.
- Without the attribute, the current behaviour stays: a tap never closes the keyboard, and nothing extra is installed.
Navigation
- Error boundaries per route through
PendingRoute::errorBoundary()andRouter::errorBoundary(), plus a global default withRoute::errorBoundary(). - When a stack route throws while being created, mounted or rendered, the boundary renders a fallback in its place, and the other routes keep working.
$retry()renders the route again, and the error is reported once as non-fatal.
System
Contacts::openNewContactForm(fn (bool $created), $failure)opens the system editor: AndroidACTION_INSERT, iOSCNContactViewController. It needs no contacts permission.Share::text()gains$failure, and$openednow fires only after the sheet has actually been presented.Alert::choose()shows 1-3AlertButtons with the styles Default, Cancel and Destructive, and returns the index of the pressed button.- Permission rationale:
- New
Permissions::shouldShowRationale(). requestKind(..., rationale: new PermissionRationale(...))first explains a repeated request in a native alert.
- New
Permissions::status()/requestKind()andCaches::usage()/clear()accept a$failureclosure.
Validation of candidate
- PHP SDK: the full suite passes with the new tests, and PHPStan level 9 reports nothing on the new sources.
tests/mbstring_polyfill.phpstill differs from the local PHP 8.4.24 ext-mbstring; this host difference was already present in 1.40 and 1.41. - Rust: 235 tests pass (80 CLI, 142 engine, 13 protocol), and fmt and clippy are clean.
- Android: JVM unit tests and
lintDebugpass. - Instrumented tests on the API 36 emulator: 75/75 passed (media thumbnail/thumbnailUri, renderer accessibility with
accessibilitySelected, contacts, native capabilities). - Exact-candidate
nativeandnative-uicommunity first-run gates passed on the API 36 emulator (isolated dev port 39142). - The Linux CLI, the Android renderer, the PHP SDK archives and the plugin AAR pass deterministic rebuilds and package budgets.
Known limits
- The iOS sources were written on Linux and were neither compiled nor tested; the Mac checklist is in
docs/ios-parity.md(1.42.0 sections). - These were not exercised by hand on Android: the actual contact editor,
Alert::choose, the rationale dialog,keyboardShouldPersistTapstaps and the Android 14 selection picker. They are covered by JVM and PHP tests only. - The embedded camera changes (
pinchZoom,maxZoom,zoomResetRevision,readywith min/max zoom,doubleTap/doubleTapFlip) belong to thepushinbr/pam-native-mediaplugin and ship as its own 0.6.0, not in this release.