Skip to content

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

Open
ViktorBystrov72 wants to merge 1 commit into
ParadevAI:mainfrom
ViktorBystrov72:fix/browser-pending-url
Open

ViktorBystrov72 wants to merge 1 commit into
ParadevAI:mainfrom
ViktorBystrov72:fix/browser-pending-url

Conversation

@ViktorBystrov72

@ViktorBystrov72 ViktorBystrov72 commented Nov 17, 2026 •

Copy link
Copy Markdown

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 loading After: requested address remains visible
Before After

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.

Written for commit cc878bc. Summary will update on new commits.

View guided diff

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.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The browser runtime now tracks pending navigation URLs separately from committed URLs. The toolbar displays the pending URL when one is available. Navigation commit and load settlement clear pending state under defined conditions.

Changes: Browser navigation state

Layer / File(s) Summary
Pending URL lifecycle and display
apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/BrowserPane/browserRuntimeRegistry.ts, apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/BrowserPane/components/BrowserPaneToolbar/BrowserPaneToolbar.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/BrowserPane/browserRuntimeRegistry.test.ts
The registry stores the sanitized target as pendingUrl and tracks its loadURL promise. It clears pending state when navigation commits or when the current load settles. The toolbar displays pendingUrl when available. Tests cover committed, aborted, and overlapping navigation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant BrowserPaneToolbar
  participant BrowserRuntimeRegistry
  participant BrowserView
  BrowserRuntimeRegistry->>BrowserView: Start loadURL for sanitized target
  BrowserRuntimeRegistry-->>BrowserPaneToolbar: Publish pendingUrl
  BrowserView-->>BrowserRuntimeRegistry: Emit did-navigate
  BrowserRuntimeRegistry-->>BrowserPaneToolbar: Clear pendingUrl and update currentUrl
Loading

Suggested reviewers: kitenite, saddlepaddle

Merge Risk: Minimal · up to cc878

The change keeps the entered address visible in the browser toolbar while a page loads. It is a small renderer-only change with passing tests reported. At worst, the address display may briefly flicker in a rare overlapping-navigation case.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(desktop): keep the browser address visible while loading" follows conventional commit format and names the main change. The changeset adds a transient pendingUrl to BrowserRuntimeState,…
Description check Passed The description follows the template. It has the 'What & why' section, which explains the problem (the URL disappears while loading) and the fix (a transient pendingUrl), and it links the related issu…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(desktop): keep the browser address visible while loading" follows conventional commit format and names the main change. The changeset adds a transient pendingUrl to BrowserRuntimeState, passes it to the toolbar while a navigation is in flight, and clears it on commit, completion, or abort. The title matches this behavior. It does not cover the abort and stale-request handling, which is expected for a title.

Full details: Description check

Explanation

The description follows the template. It has the 'What & why' section, which explains the problem (the URL disappears while loading) and the fix (a transient pendingUrl), and it links the related issue (Refs #8145). The 'How I tested it' section gives detailed manual CDP testing, before/after screenshots, and test and lint results. The checklist is present and marked. The description is thorough, though it is long and includes some details that are not required by the template.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b943e79a-ee4f-46f6-af77-5afc8c9d9d9a
Commits

Reviewing files that changed from the base of the PR and between f68c1fa and cc878bc.

Files selected for processing: 3

  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/BrowserPane/browserRuntimeRegistry.test.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/BrowserPane/browserRuntimeRegistry.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/BrowserPane/components/BrowserPaneToolbar/BrowserPaneToolbar.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant