Repository navigation
fix(browser): settle loading after history restoration - #3470
Merged
Merged
Conversation
Reconcile native page-load events with document readiness after commit, including cached and same-document history restores. Ignore stale view and navigation reports and release both event subscriptions together. Co-authored-by: OpenBitFun <318544290+bitfun-ai@users.noreply.github.com>
Keep the new lifecycle reconciliation independent of existing page helpers so duplicate and same-URL load events do not add redundant auxiliary listeners. Co-authored-by: OpenBitFun <318544290+bitfun-ai@users.noreply.github.com>
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.
Summary
Fix the embedded browser's loading spinner remaining active after Back restores a usable page. Reconcile native navigation notifications with document readiness after commit, and observe cached-page and same-document history events.
Type and Areas
Type: Bug fix
Areas: Web UI embedded browser lifecycle and regression tests
Motivation / Impact
The loading indicator previously depended on native completion notifications, which may be absent or late during history restoration. Both browser surfaces now settle loading when the current document reports readiness. View labels and navigation sequences reject stale reports, and readiness is never probed before commit while the old document may still be visible.
Verification
pnpm --dir src/web-ui run test:run src/app/scenes/browser src/infrastructure/runtime/windowVisibility.test.ts src/infrastructure/api/adapters/peer-device-adapter.test.ts— 11 files, 135 tests.pnpm run check:web.useEmbeddedBrowserWebview.tsandbrowserPageLifecycleScript.ts.Reviewer Notes
Uses the existing browser evaluation command and event permission; no Rust, persisted-data, or remote-protocol changes. Peer routing is covered by local adapter tests. Remote workspace, remote control, Peer Device Mode, and Detached Dispatch were not exercised against live remote hosts.
Checklist