fix(desktop): keep the browser address visible while loading

VI
2h ago
+103-4

What & why

Entering a URL in an empty browser pane replaces the address with the empty placeholder until navigation commits. On a slow response, this makes the entered URL disappear while the page is still loading.

Keep a transient pending address for the toolbar. Committed URLs continue to drive history, persistence, and page actions. A main-frame commit displays the actual destination, including redirects; completing or aborting a load clears its pending address. An older aborted request cannot clear a newer attempt, even when both use the same URL.

Refs #8145, specifically the address loss during pending navigation. CLI pane registration succeeded in this reproduction.

How I tested it

Automated CDP mouse/keyboard input against an isolated dev desktop (renderer localhost:3185, CDP 9262), with the local test organization and workspace route verified. A browser pane starts at about:blank; a local HTTP fixture holds the requested response:

  • Before: the server has a request pending and the guest is loading, but the address control shows “Enter URL or search…”.
  • After: the requested URL stays visible while the guest's committed URL is still about:blank.
  • Releasing the response completes navigation normally. A subsequent 302 displays the actual /fast destination instead of the requested /redirect address.
  • No console errors occurred during these measured interactions.
Before: address disappears while loadingAfter: requested address remains visible
BeforeAfter

Redirect capture · Measurements, fixture, scripts and validation

Validation with Bun 1.4.3:

  • Registry: 20 tests pass. The new pending-address regression fails on main; added coverage checks abort cleanup and an older cancelled request finishing after a newer one.
  • Browser subtree: 46 tests pass.
  • bun run lint:fix, then clean bun run lint: pass.
  • bun run typecheck: 42/42 tasks pass, repeated after rebase.
  • bun run test --continue on the verified snapshot: desktop 8982 tests pass; monorepo 28/30 tasks pass. The unchanged shared BYHOUR timezone-format test and two agent-setup system-CLI fallback tests fail. The full suite is not reported as passing.

UI evidence was captured on 6c69c8a4ca23a07ad228a950905cf10e9eaebdb0; the three changed source/test files have identical blobs on final head f68c1fa8c3e468539fb3211cda411f65620c08ae. Browser tests, lint and all typechecks passed again on the fresh base. Task dev services were stopped after verification.

Codex assisted with implementation and automated verification. No human review or manual testing is claimed.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs
  • I have signed the CLA (the bot asks on your first PR)

Summary by cubic

Fixes the browser address bar showing the empty placeholder instead of the entered URL while a page is loading slowly. Adds a toolbar pendingUrl that stays visible while a navigation is in flight.

  • A main-frame commit displays the actual destination, including redirects; completing or aborting a load clears the pending address.
  • An older aborted request can't clear a newer pending navigation, even for the same URL.

Summary by CodeRabbit

  • New Features
    • The browser toolbar now shows the address being navigated to while a page is loading, before it becomes the current address.
  • Bug Fixes
    • Failed or canceled navigation no longer replaces the current page address.
    • When a newer navigation starts, an older canceled navigation no longer clears its pending address.