You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/mobile/ARCHITECTURE.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ Lesson learned!
65
65
### ⚠️ Trade-offs
66
66
67
67
-**Memory overhead**: Each tab has its own WebView (~50-100MB each)
68
-
-**Brief visual flash**: Sometimes visible when first loading a detail page (new WebView instance mounting); the return flash when navigating back to a tab is avoided by pre-navigating the tab's WebView to its root while the detail screen is shown
68
+
-**Brief visual flash**: Sometimes visible when first loading a detail page (new WebView instance mounting)
69
69
-**Sync complexity**: Two navigation systems must stay coordinated
70
70
-**Not "truly native"**: Won't feel as smooth as a pure native app
71
71
@@ -94,7 +94,7 @@ The "glue" that keeps mobile tabs in sync with web navigation:
94
94
95
95
- Detects which page is showing in the WebView
96
96
- Maps web URL to a tab route and calls `router.navigate()` to keep tab highlights in sync
97
-
- Detail pages (profiles, events, etc.) navigate to `[...slug]` so no tab is highlighted; named-tab WebEmbeds sync back to their root when they regain focus
97
+
- Detail pages (profiles, events, etc.) navigate to `[...slug]` so no tab is highlighted; when the tab regains focus it calls `prepareGoBack()` + `webviewRef.goBack()` — the browser's bfcache restores the exact previous page state (scroll position, pagination) rather than remounting from scratch
98
98
99
99
**Key insight**: Must strip locale prefixes before mobile navigation:
100
100
@@ -114,7 +114,7 @@ Shared refs across all WebView instances:
114
114
115
115
Each `WebEmbed` instance also has its own **per-instance**`currentWebPathRef` (inside `useWebNavigation`) that tracks that tab's current URL independently. This is intentional — a shared global ref caused cross-tab contamination where one tab's navigation would corrupt another tab's sync checks.
116
116
117
-
**Note**: You may occasionally see a brief flash when first navigating to a detail page, since `[...slug]` mounts a fresh WebView. The return flash (detail → tab) is avoided by pre-navigating the tab's WebView back to its root while the detail screen is open.
117
+
**Note**: You may occasionally see a brief flash when first navigating to a detail page, since `[...slug]` mounts a fresh WebView. On return, the tab's WebView uses native back navigation (`goBack()`) so the bfcache restores the previous page state exactly — including pagination and scroll position.
0 commit comments