Title: feat(android): prototype Frame-owned interactive back previews by rafaelaugustos · Pull Request #11558 · NativeScript/NativeScript · GitHub
Open Graph Title: feat(android): prototype Frame-owned interactive back previews by rafaelaugustos · Pull Request #11558 · NativeScript/NativeScript
X Title: feat(android): prototype Frame-owned interactive back previews by rafaelaugustos · Pull Request #11558 · NativeScript/NativeScript
Description: PR Checklist Conventional PR title. Proposal tracked in #11557; public API is experimental and offered for review. CLA signed. Core unit tests pass: 540 passed, one existing skip; Core build passes. Tests included: unit session lifetime tests, native Frame ownership/recreation tests and a standalone toolbox example. What is the current behavior? Frame exposes final Back but no presentation-only interactive preview. External routers currently reparent a retained Page during Android back progress. Frame's logical history is separate from FragmentManager's back stack, so enabling FragmentManager predictive pop is not a compatible one-line change. Native acceptance also exposed a pre-existing recreation failure: the new root view can attach while its owning Activity is INITIALIZED. Frame ignores that attach, never marks itself attached after CREATED, and subsequent navigation remains queued. A plain NativeScript reproduction fails with published Core 9.1.3 on API 35. What is the new behavior? Experimental Frame.beginBackPreview() creates a version-1 snapshot session on Android 14+. Progress/cancel/finish only change presentation; the caller retains gesture dispatch, guards and the final navigation decision. Frame automatically disposes the session when navigation, unload, detach or native disposal takes over. iOS returns undefined. The previous Page is software-drawn into a bounded, accessibility-hidden Android ImageView and stays detached/unloaded. Secure windows, SurfaceView/TextureView content, custom/shared transitions, unavailable geometry and failed capture decline the session. This is intentionally opt-in: capture costs time and memory, previews are static, and no performance improvement or universal content compatibility is claimed. The first commit independently fixes early attachment by using the owning Activity and rechecking an already-attached native view when the Frame loads. It is separable from the prototype. Implements the prototype proposed in #11557. Related consumer investigation: rafaelaugustos/vue-router-ns#62. Native validation Candidate built from upstream main 3224f1b, with stock Android runtime 9.1.1 / native Core resources; the demo aliases this compiled Core rather than modifying installed packages. API 34/35/36 ARM64 emulators passed: Real Android system gestures for cancellation and completion; previous Page remains detached in the candidate, and FragmentManager back-stack count remains zero. Global guard refusal, active leave-guard suppression, custom-transition fallback, modal inner Back/results, replace/clearHistory, and interruption by a new navigation. Eight repeated snapshot cycles; all tracked Android Bitmaps collected through native WeakReference/ReferenceQueue after three fixed JS/native GC rounds. Actual same-process Activity.recreate() with both legacy and candidate previews: old session disposed, Page identities/draft retained, and Back works after recreation. The unmodified published Core negative control reproduces the queued-Back failure on API 35. The router fixture records lifecycle traces, capture allocation/time, screenshots during native input, and process/Activity identities. The full automated Core device app was not run as a whole; the standalone native reproduction exercised the added regression behavior directly. Physical-device performance, arbitrary vendor SDK rendering, and TalkBack speech are not claimed. See tools/notes/FrameBackPreview.md for the API, native example and limitations. The consumer continues shipping its existing preview by default.
Open Graph Description: PR Checklist Conventional PR title. Proposal tracked in #11557; public API is experimental and offered for review. CLA signed. Core unit tests pass: 540 passed, one existing skip; Core build p...
X Description: PR Checklist Conventional PR title. Proposal tracked in #11557; public API is experimental and offered for review. CLA signed. Core unit tests pass: 540 passed, one existing skip; Core build p...
Opengraph URL: https://github.com/NativeScript/NativeScript/pull/11558
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:fb6d6958-f63f-fb2f-0332-debc25f406b5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E856:1148D3:14CFCC5:1A98B7F:6B01303F |
| html-safe-nonce | 0f3d5dd78c4235de3741b13077564310bde4004ebd4fc55bfb1f47df65e55aed |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODU2OjExNDhEMzoxNENGQ0M1OjFBOThCN0Y6NkIwMTMwM0YiLCJ2aXNpdG9yX2lkIjoiMTQ0NzA2MDQ0MjI3MDM5Mjk1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 22f9b8af462db0f52a11f58c17d2e9d214afdeebf7bb5322f8742674bc8b2695 |
| hovercard-subject-tag | pull_request:4942390666 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/NativeScript/NativeScript/pull/11558/files |
| twitter:image | https://avatars.githubusercontent.com/u/5261655?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/5261655?s=400&v=4 |
| og:image:alt | PR Checklist Conventional PR title. Proposal tracked in #11557; public API is experimental and offered for review. CLA signed. Core unit tests pass: 540 passed, one existing skip; Core build p... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 31492490 |
| octolytics-dimension-repository_nwo | NativeScript/NativeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31492490 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/NativeScript |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width