feat(portal): WebView clean-arch slice + two-finger map gestures#35
Merged
Conversation
New org.iiab.controller.portal slice (no behavior change until wired): - domain: NavigationPolicy (internal vs external host) + PortalUrlResolver (target URL with local fallback). Pure JVM, unit-tested. - data: WebViewProxyConfigurator (SOCKS proxy override adapter). - presentation: PortalUiState + PortalViewModel (load state survives rotation), and GestureWebView — a WebView that guarantees multi-finger delivery (requestDisallowInterceptTouchEvent on 2+ pointers) for map tilt, with optional gesture logging for diagnostics.
…re support - layout uses GestureWebView; PortalActivity slims down onto the slice (NavigationPolicy, PortalUrlResolver, WebViewProxyConfigurator, PortalViewModel). - two-finger gestures (map tilt) now reach the map; debug gesture logging on. - inject a touch probe on page load: logs touch-point counts via onConsoleMessage (-> logcat) to diagnose lost gestures, and best-effort enables MapLibre pitch.
2a5c21b to
5370d81
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Strangler-fig refactor of the portal WebView (the only WebView; opened from Usage), plus two-finger gesture support so map tilt works.
New slice
org.iiab.controller.portalNavigationPolicy(internalbox/localhost/127.0.0.1stays in the WebView vs. external → system browser) andPortalUrlResolver(target URL with local fallback).WebViewProxyConfigurator— SOCKS proxy override extracted out of the activity.PortalUiState+PortalViewModel(load state survives rotation) andGestureWebView.Two-finger gestures (map tilt)
GestureWebViewcallsrequestDisallowInterceptTouchEvent(true)while 2+ pointers are down, so a multi-finger drag (MapLibre pitch/rotate) is never stolen by an ancestor. The map itself is served by the IIAB server (/maps/, MapLibre GL), so the fix lives on the Android side.Built-in diagnostics
Because the map is external, the exact gesture path is verified on-device via logcat:
GestureWebView.onTouchEventlogsaction+ pointer count (debug builds) — shows whether the WebView receives two fingers.touches.lengthontouchstart/touchmove, surfaced throughonConsoleMessage→ logcat — shows whether the map receives two fingers. It also best-effort enables MapLibretouchPitchif a map instance is exposed.Filter with:
adb logcat -s IIAB-Portal IIAB-GestureWV chromium. If Android sees 2 pointers but the page sees 1 → propagation; if the page sees 2 but no tilt → MapLibre config.Refactor impact
PortalActivityslims onto the slice; navigation, URL fallback and proxy logic move out. Behavior preserved (nav bar, file chooser, error page, proxy lifecycle).Verified locally: brace/paren balance, layout parses,
BuildConfigavailable (buildConfig enabled), andNavigationPolicyTest/PortalUrlResolverTestcover the domain.