Skip to content

MOB-245: one router per iPad window scene (iPad half) - #184

Merged
GenericJam merged 13 commits into
masterfrom
feat/MOB-245-ipad-multi-window
Oct 24, 2026
Merged

GenericJam merged 13 commits into
masterfrom
feat/MOB-245-ipad-multi-window

Conversation

@GenericJam

@GenericJam GenericJam commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Multi-window on iPad: one Mob.Router per UIWindowScene in one BEAM, Mob.Scenes registry, Mob.Test.screens/1 + scene:, MultipleScenesError, per-scene native tap sets/view models, scene-routed back/size class/alerts. Decision: decisions/2026-10-02-one-router-per-window-scene.md.

Status (311301b): mix test 2155 passed (28 doctests, 2127 tests), format, credo --strict, compile --warnings-as-errors, clang-format and test/native all clean; CI green (https://github.com/GenericJam/mob/actions/runs/40074883439). Simulator-verified on the iPad Pro 11-inch (M5) (two windows, single window, the primary window closing with others open, and reopening into a reused tap set) and on the iPhone 18 Pro; details are in decisions/2026-10-02-one-router-per-window-scene.md. Review: Codex round 1 said DO NOT SHIP and those findings are fixed. Codex hit its usage limit for round 2, so a reviewer subagent did rounds 2 and 3: round 2 said DO NOT SHIP (the epoch was never recorded), fixed in 311301b; round 3 says SHIP. Not merged.

@GenericJam
GenericJam force-pushed the feat/MOB-245-ipad-multi-window branch 2 times, most recently from 459e616 to f27fd93 Compare October 24, 2026 05:57
@GenericJam
GenericJam marked this pull request as ready for review October 24, 2026 05:57
@GenericJam GenericJam mentioned this pull request Oct 24, 2026
GenericJam added a commit that referenced this pull request Oct 24, 2026
…red, shown-only WebViews; scoped window-connected; non-blocking router teardown

Codex round 1 on #184:
- set_root commits a frame's handlers only if its tap set was not released
  since clear_taps started it, and the main thread shows its tree only if
  that still holds, so a closing window's in-flight frame can't land in the
  window that takes over the set.
- MobWKWebView captures its tree's scene (mobSceneId environment) instead of
  reading webView.window in callbacks.
- The webview NIFs pick the shown slot's WebView, never the parked one.
  g_webview, the strong global, is gone.
- mob_notify_window_connected attaches the connecting scene and tells only
  its router, through Mob.Scenes; Mob.Scenes no longer sends it.
- Mob.Scenes stops a closing window's router off its own loop, drops the
  scene's Mob.Sender slot once it is down, clears the unbound slot before
  stopping the unbound primary, and drops the slot of a scene with no router
  when it disconnects.
- CHANGELOG and the decision record corrected.
GenericJam and others added 12 commits October 24, 2026 01:06
… before stop, last window by attached scenes, replaced/discarded scene messages, application-role scenes only, tap-set slot reset, over-limit windows, frame tracking in anchored panels
…ith :mob_screen; press_in/press_out/hold take scene:

Master's Mob.Link (MOB-379) took stored launch links in every render-mode
router; a further window's router would have taken the launch link. Only the
root router takes them now, and Mob.Scenes pokes the new :mob_screen holder
with :mob_link_stored alongside :mob_notification_stored. MOB-380's by-tag
press helpers address the current screen, so they take scene: like tap/3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… window

On the iPad simulator, an alert shown by the unbound root router's screen
while a second window was in front was presented in the front window, and
its result went back to the default scene's screen. With several windows
attached, a nil-scene alert or action sheet now presents in the default
scene's window whichever window is in front; one window keeps root_vc().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, launch links

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndow WebView, keyboard and primary alerts

- Native sends back, size class, alert and WebView messages with a known
  scene to Mob.Scenes whenever it runs, not only with several windows
  attached: a detached kept primary plus a new window no longer hands the
  new window's events to the primary.
- Unbound alerts present only in tap set 0's attached window; nowhere while
  it is detached and another window is attached.
- Mob.Scenes drops an event for a scene no router shows once the primary
  has registered.
- webview_* and dismiss_keyboard gain scene arities; native looks up the
  WebView / first responder in that window; the router's back, Mob.WebView
  and Mob.Keyboard pass a bound screen's scene; WebView messages carry the
  WebView's scene.
- {:mob_window, :connected} reaches the :mob_screen holder once (native),
  other routers from Mob.Scenes.
- Mob.Scenes.router(nil) / Mob.Test scene: nil address the unbound primary.
…red, shown-only WebViews; scoped window-connected; non-blocking router teardown

Codex round 1 on #184:
- set_root commits a frame's handlers only if its tap set was not released
  since clear_taps started it, and the main thread shows its tree only if
  that still holds, so a closing window's in-flight frame can't land in the
  window that takes over the set.
- MobWKWebView captures its tree's scene (mobSceneId environment) instead of
  reading webView.window in callbacks.
- The webview NIFs pick the shown slot's WebView, never the parked one.
  g_webview, the strong global, is gone.
- mob_notify_window_connected attaches the connecting scene and tells only
  its router, through Mob.Scenes; Mob.Scenes no longer sends it.
- Mob.Scenes stops a closing window's router off its own loop, drops the
  scene's Mob.Sender slot once it is down, clears the unbound slot before
  stopping the unbound primary, and drops the slot of a scene with no router
  when it disconnects.
- CHANGELOG and the decision record corrected.
… Keyboard.dismiss keeps master's injectable NIF
@GenericJam
GenericJam force-pushed the feat/MOB-245-ipad-multi-window branch from 09ffffe to b0e6369 Compare October 24, 2026 07:08
Without it tap_build_epoch stayed 0, so after a window closed every later
frame for the window that took over its tap set was dropped.
@GenericJam
GenericJam merged commit 9b9237a into master Oct 24, 2026
4 checks passed
@GenericJam
GenericJam deleted the feat/MOB-245-ipad-multi-window branch October 24, 2026 07:40
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