Skip to content

Webview, Number Switcher and Counter demos on mobile-ui ^0.2 - #6

Merged
simonhamp merged 2 commits into
mainfrom
feat/webview-demo
Jul 23, 2026
Merged

Webview, Number Switcher and Counter demos on mobile-ui ^0.2#6
simonhamp merged 2 commits into
mainfrom
feat/webview-demo

Conversation

@simonhamp

@simonhamp simonhamp commented Jul 22, 2026

Copy link
Copy Markdown
Member

Demo coverage for the webview + content-transition release train, now fully resolvable against released versions: nativephp/mobile-ui ^0.2 (locked to 0.2.0) and nativephp/mobile dev-main as 4.0.x-dev.

Webview demo

The <webview> element screen with four modes:

  • Remote — sandboxed https embed with opt-in javascript
  • Inline — slot HTML delivered verbatim into an opaque origin
  • PHP — the app's own Laravel runtime in an embedded webview (dedicated per-webview PHP context): new /webview-embedded route + page demonstrating the shared session, runtime identity, and window.Native (polled — Android injects at page finish, iOS at document start)
  • Full — v3-style takeover behind the safe areas

Number Switcher demo

content-transition showcase: a rolling numeric hero (numeric, 400ms) with step/jump/random controls, plus a side-by-side row rendering the same value through numeric / opacity / none.

Counter upgrades

  • The count rolls in place via content-transition="numeric" (SwiftUI numericText on iOS, directional slide on Android)
  • Press-and-hold repeat on the steppers: @pressDown steps once (a tap still counts exactly one) and arms a #[Poll(110)] repeat that accelerates (±1 → ±2 → ±5); @pressUp (release or cancel) disarms; idle poll ticks are wire-free via the shadow compare, and a tick cap auto-releases stuck holds

Also

  • Launcher entries for all three, nativephp/mobile-ui package-rename adaptations, APP_KEY for the test env, and 22 new/updated tests (element mapping, precompiler contract, demo trees, hold/acceleration semantics, embedded route)

Verified: full suite green (101 passed / 697 assertions) against the locked released versions; both new demos exercised live on the Android emulator (hold-to-repeat acceleration confirmed frame-accurate), iOS builds clean.

🤖 Generated with Claude Code

Adds the <webview> element demo screen with four modes:
- Remote: sandboxed https URL with opt-in JavaScript
- Inline: slot HTML delivered verbatim (opaque origin)
- PHP: the app's own runtime in an embedded webview — new
  /webview-embedded route + page proving the shared session (visit
  counter), runtime identity, and window.Native availability (polled,
  since Android injects at page finish vs iOS document start)
- Full: v3-style takeover — webview as sole screen content behind the
  safe areas

Plus: launcher menu entry, package-rename adaptations for
nativephp/mobile-ui (providers, layouts, config), APP_KEY for the test
env (session cookies), and tests covering the element attribute
mapping, precompiler contract, demo modes, and the embedded route.

Composer targets nativephp/mobile-ui ^0.2 and nativephp/mobile
dev-main (as 4.0.x-dev). The lock is intentionally untouched: 0.2.0
isn't tagged yet — regenerate with
`composer update nativephp/mobile nativephp/mobile-ui` once minted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Number Switcher: content-transition showcase — rolling numeric hero
  with step/jump/random controls and a side-by-side row rendering the
  same value through numeric / opacity / no transition.
- Counter: the count now rolls via content-transition="numeric", and
  the pressables gained press-and-hold repeat — @pressdown steps once
  (taps still count one) and arms a #[Poll(110)] tick that repeats
  with acceleration (±1 → ±2 → ±5) until @pressup disarms it; idle
  ticks publish identical trees the shadow compare drops, and a tick
  cap auto-releases a hold whose pressUp never arrived.
- Lock finalized now that the train has merged: nativephp/mobile
  dev-main + nativephp/mobile-ui 0.2.0 (native-ui removed).

Full suite against the released versions: 101 passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@simonhamp simonhamp changed the title Webview demo: embedded, php and fullscreen modes Webview, Number Switcher and Counter demos on mobile-ui ^0.2 Jul 23, 2026
@simonhamp
simonhamp merged commit ebe75d2 into main Jul 23, 2026
3 checks passed
@simonhamp
simonhamp deleted the feat/webview-demo branch July 23, 2026 02:06
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