Repository navigation
Open notification taps and deep links in the live mobile page - #8247
Merged
Merged
Conversation
Tapping a push notification while the mobile shell's page was alive pushed a second /webview screen. Each tap loaded a fresh copy of the web app in a new WebView and kept the old one alive underneath, so every tap cost a full page load and another WebContent process. Deep links and shares remounted the WebView, and `bb thread open` stacked a WebView even though the page already handles that signal itself. The /webview screen is now single, and the shell hands an open request to the live page with a new `navigate` bridge event once the page reports it can take one. Pages from older servers, pages still loading and server switches keep the reload path, in the same WebView. Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexburlis
added a commit
to alexburlis/omnyo
that referenced
this pull request
Nov 26, 2026
Record the upstream PRs, revisions, contributors, and Omnyo integration commits for merge d2a24ac in docs/upstream-credits.md. Original-PR: get-bb/bb#7663 Original-Commit: get-bb/bb@1737a03 Original-Author: rufi Original-PR: get-bb/bb#8055 Original-Commit: get-bb/bb@651ae20 Original-Author: Jake Lancaster Original-PR: get-bb/bb#8075 Original-Commit: get-bb/bb@511e1ed Original-Author: Jake Lancaster Original-Co-Author: Michael Yong Original-Co-Author: Claude Opus 5.5 Original-PR: get-bb/bb#8096 Original-Commit: get-bb/bb@775090b Original-Author: Michael Yong Original-Co-Author: Claude Opus 5.5 Original-PR: get-bb/bb#8145 Original-Commit: get-bb/bb@8de6711 Original-Commit: get-bb/bb@0d3db49 Original-Commit: get-bb/bb@92d3a76 Original-Commit: get-bb/bb@6705422 Original-Author: Michael Yong Original-Co-Author: Claude Opus 5.5 Original-PR: get-bb/bb#8171 Original-Commit: get-bb/bb@b56ed04 Original-Author: Jake Lancaster Original-PR: get-bb/bb#8238 Original-Commit: get-bb/bb@2a9a142 Original-Author: SawyerHood Original-PR: get-bb/bb#8247 Original-Commit: get-bb/bb@ba4ae22 Original-Author: Salem Original-Co-Author: Claude Opus 5.5 Original-PR: get-bb/bb#8259 Original-Commit: get-bb/bb@96f40a9 Original-Author: SawyerHood Original-PR: get-bb/bb#8263 Original-Commit: get-bb/bb@141e40a Original-Author: mk Original-PR: get-bb/bb#8266 Original-Commit: get-bb/bb@84e20e9 Original-Author: ILIA GOLUBEV
scowalt
pushed a commit
to scowalt/bb
that referenced
this pull request
Dec 1, 2026
…#8247) ## Human comments ## What was wrong The mobile shell opened every external "open this thread" request by routing to `/webview` with new params. A push notification tap used `router.push`, and the `webview` screen had no singular id, so each tap mounted another `ProfileWebViewScreen` with its own WebView on top of the live one. The new WebView loaded the whole web app again (white page, skeleton, then the thread) and the old one stayed mounted underneath with its own WebContent process and WebSocket. `ThreadOpenSignalHandler` did the same for `bb thread open`, although the page already handles that signal itself. Deep links and shares changed `requestedPath`, which was part of the WebView key, so they remounted the WebView. Issue: get-bb#8246. ## What changed - `packages/mobile-bridge`: a shell-to-page `navigate` event (app-relative paths only) and a page-to-shell `capabilities` message. Unknown capabilities are dropped, and older shells already drop the unknown message type. - `apps/app`: `NativeShellNavigator` takes `navigate` events through the app's router and reports the `navigate` capability once per page load. It does nothing outside the shell. - `apps/mobile`: - The `webview` stack screen is singular (`dangerouslySingular`), so a push to `/webview` reuses the mounted screen instead of stacking another WebView. - `ProfileWebViewScreen` consumes `profileId`/`path` params as one open request and clears them, so the same notification tapped again still opens. `requestedPath` is no longer part of the WebView key. When the page is loaded and has reported `navigate`, the shell sends the event and keeps the WebView. Otherwise (a page from an older server, a page still loading or failed, or a server switch) it loads the path in the same WebView, as before. - `ThreadOpenSignalHandler` is removed; the page's own `thread-open` handler opens the thread. - No change to `MOBILE_BRIDGE_VERSION`: the additions are optional on both sides. ## How you verified iOS Simulator (iPhone 17 Pro, iOS 26.5), Release simulator build of `apps/mobile`, JS bundles from `expo export:embed --bytecode` of `main` and of this branch, against a source build of bb with a seeded data dir, Direct URL server, push notifications on. A logging proxy recorded document loads, and screenshots were taken every ~150 ms after each tap. | Notification tap with the page alive | `main` | this branch | |---|---|---| | Document load of the thread | yes | no | | WebContent processes after 2 taps | 3 (~0.5 GB RSS each) | 1 | | Thread on screen after the tap | 1.5 to 1.8 s, white page from ~0.5 s | 0.5 to 0.6 s (one run 1.1 s), no white page | Also on this branch: - `bb thread open` and a `bb://projects/<p>/threads/<t>` deep link open the thread in place: no document load, still one WebView. - Tapping a notification for the same thread again after moving to another thread opens it again in place. - Older page (served `apps/app/dist` from `main`) with this shell: the tap loads the thread in the same WebView, one WebContent process. - Cold start from a notification: one WebView, the notified thread loads directly. - WebContent process killed in the background (`kill -9`, as iOS does under memory pressure): the shell still reloads on resume, at the thread last opened in place. Unit tests: `shell-state.test.ts` (`resolveShellOpen`, `resolveShellLoadPath`), `messages.test.ts` (capabilities parsing), `native-shell.test.ts` (`NativeShellNavigator` navigates on the event, reports the capability, ignores `//host` and absolute URLs, stays silent outside the shell). `pnpm exec turbo run lint typecheck test --filter=@bb/mobile --filter=@bb/mobile-bridge --filter=@bb/app`: lint and typecheck pass in all three packages; `@bb/mobile` and `@bb/mobile-bridge` tests pass; `@bb/app` has 7,485 passing and 2 failing tests, both in `ThreadDetailPromptArea.test.tsx` ("keeps a delayed bottom upload owned by the bottom draft", "dismisses a missing queued message but keeps a stale edit recoverable"). The same two fail on `main` at `a8c32288c` with this change reverted. Not tested: Android, and switching servers from a notification (no second server in this setup; that path keeps the existing reload behaviour). Fixes get-bb#8246 > AGENT GENERATED Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Human comments
What was wrong
The mobile shell opened every external "open this thread" request by routing to
/webviewwith new params. A push notification tap usedrouter.push, and thewebviewscreen had no singular id, so each tap mounted anotherProfileWebViewScreenwith its own WebView on top of the live one. The new WebView loaded the whole web app again (white page, skeleton, then the thread) and the old one stayed mounted underneath with its own WebContent process and WebSocket.ThreadOpenSignalHandlerdid the same forbb thread open, although the page already handles that signal itself. Deep links and shares changedrequestedPath, which was part of the WebView key, so they remounted the WebView. Issue: #8246.What changed
packages/mobile-bridge: a shell-to-pagenavigateevent (app-relative paths only) and a page-to-shellcapabilitiesmessage. Unknown capabilities are dropped, and older shells already drop the unknown message type.apps/app:NativeShellNavigatortakesnavigateevents through the app's router and reports thenavigatecapability once per page load. It does nothing outside the shell.apps/mobile:webviewstack screen is singular (dangerouslySingular), so a push to/webviewreuses the mounted screen instead of stacking another WebView.ProfileWebViewScreenconsumesprofileId/pathparams as one open request and clears them, so the same notification tapped again still opens.requestedPathis no longer part of the WebView key. When the page is loaded and has reportednavigate, the shell sends the event and keeps the WebView. Otherwise (a page from an older server, a page still loading or failed, or a server switch) it loads the path in the same WebView, as before.ThreadOpenSignalHandleris removed; the page's ownthread-openhandler opens the thread.MOBILE_BRIDGE_VERSION: the additions are optional on both sides.How you verified
iOS Simulator (iPhone 17 Pro, iOS 26.5), Release simulator build of
apps/mobile, JS bundles fromexpo export:embed --bytecodeofmainand of this branch, against a source build of bb with a seeded data dir, Direct URL server, push notifications on. A logging proxy recorded document loads, and screenshots were taken every ~150 ms after each tap.mainAlso on this branch:
bb thread openand abb://projects/<p>/threads/<t>deep link open the thread in place: no document load, still one WebView.apps/app/distfrommain) with this shell: the tap loads the thread in the same WebView, one WebContent process.kill -9, as iOS does under memory pressure): the shell still reloads on resume, at the thread last opened in place.Unit tests:
shell-state.test.ts(resolveShellOpen,resolveShellLoadPath),messages.test.ts(capabilities parsing),native-shell.test.ts(NativeShellNavigatornavigates on the event, reports the capability, ignores//hostand absolute URLs, stays silent outside the shell).pnpm exec turbo run lint typecheck test --filter=@bb/mobile --filter=@bb/mobile-bridge --filter=@bb/app: lint and typecheck pass in all three packages;@bb/mobileand@bb/mobile-bridgetests pass;@bb/apphas 7,485 passing and 2 failing tests, both inThreadDetailPromptArea.test.tsx("keeps a delayed bottom upload owned by the bottom draft", "dismisses a missing queued message but keeps a stale edit recoverable"). The same two fail onmainatb0ddaad73with this change reverted.Not tested: Android, and switching servers from a notification (no second server in this setup; that path keeps the existing reload behaviour).
Fixes #8246