Skip to content

Fix desktop browser address bar focus transitions - #4978

Merged
ymichael merged 2 commits into
mainfrom
bb/fix-url-bar-focus-and-typing-issues-thr_9ju73aqhs9
Oct 6, 2026
Merged

ymichael merged 2 commits into
mainfrom
bb/fix-url-bar-focus-and-typing-issues-thr_9ju73aqhs9

Conversation

@ymichael

@ymichael ymichael commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Opening Browser from a regular thread's New tab initially focused the URL bar, but saving the new tab's desktop ownership triggered a window-identity check that unmounted and recreated the toolbar after consuming its focus request. This lost focus and any text already typed. Plugin panels had a separate gap: they never requested address focus. Submitting a URL also cleared the editing state without moving keyboard focus out of the input.

What changed

Resolve the desktop window identity before mounting a new browser toolbar, so saving ownership preserves the focused input and its draft. Plugin panels now send and consume address-focus requests for empty browser tabs. Submitting a valid address blurs the input and focuses the native page once its view is visible, with guards for hidden or inactive panes, load errors, and open dialogs.

How you verified

  • Reproduced and verified both regular-thread and plugin-panel flows in isolated Electron desktop builds. In the regular thread, confirmed the persisted desktop owner no longer drops focus or partially typed google.co; completed the URL and navigated. Native page evaluation confirmed focus after submission.
  • Regression coverage fails before each fix and passes afterward: ownership persistence preserves focus and draft text; plugin panels request address focus; submission from blank and existing pages releases the input and requests native focus.
  • Final focused run: pnpm exec turbo run test --filter=@bb/app -- src/components/secondary-panel/BrowserTabDeck.browser-view-ordering.test.tsx src/components/secondary-panel/BrowserTabContent.chrome.test.tsx src/components/plugin/PluginPanelRightPanelHost.test.tsx — 48 tests passed.
  • Final pnpm exec turbo run lint typecheck --filter=@bb/app and git diff --check passed. The full app suite passed before the ownership follow-up: 5,366 tests passed, 5 skipped.

AGENT GENERATED

@ymichael
ymichael merged commit 8dca844 into main Oct 6, 2026
34 checks passed
@ymichael
ymichael deleted the bb/fix-url-bar-focus-and-typing-issues-thr_9ju73aqhs9 branch October 6, 2026 17:09
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