Repository navigation
Conversation
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.
ELI5
In Chrome, pressing Escape in the address bar undoes what you typed, one step at a time, and then gives the keyboard back to the page. Orca's in-app browser only closed the suggestion list. Your half-typed text stayed, and the cursor stayed in the bar. Now Escape in Orca works the way it does in Chrome.
What Changed
Each Escape press in the address bar does the first of these steps that applies:
Before, every press restored the typed text and closed the list, so steps 3 and 4 never happened.
With the macOS Korean IME, an Escape pressed mid-syllable closes the list and keeps the syllable. The next press continues with step 3, which matches Chrome (checked by hand). That IME sends two keydowns for one Escape: a marked
Escape/229, then an unmarkedEscape/27. The bar ignores the second keydown, the same way Orca already ignores the second Enter of a composition.The same steps apply everywhere the bar appears: local pages, client-hosted pages, remote streamed pages, and the document preview's address edit. In the document preview, step 4 leaves edit mode.
Where to start reviewing
browser-address-bar-escape.ts:resolveAddressBarEscapeis a pure function that picks the step.useBrowserAddressBarEscapeapplies it and is now the only Escape handler for the bar.use-browser-address-bar-text.ts:useBrowserAddressBarTextnow owns both the bar text andcommittedAddress, the text that step 3 reverts to. Page-driven writes updatecommittedAddresseven while you type, the same way Chrome updates its permanent URL text. Before, the local pane and the edit-session hook each had their own copy of this sync logic.BrowserAddressBartakes two new required props:committedAddressandonLeaveAddressBar, which says where focus goes for that pane.The rest follows from those three:
useBrowserPageChromeFocusreturnsleaveAddressBarForPage, which cancels any retrying address-bar focus grab before it focuses the page. Without the cancel, a new tab's grab pulls focus back one frame later.use-browser-address-bar-dismissal.tsis removed, and so is the document preview's own Escape handler. Blur and webview-focus dismissal do not change.useImeEnterGestureOwnershipbecomesuseImeKeyGestureOwnership(key), so Escape reuses the Enter IME handling.use-address-bar-selection-after-commit.tsreplaces two copies of the code that sets the selection after React commits the value.use-browser-address-bar-overlay.tsanduseBrowserAddressBarDismissal.Why
The step order comes from Chromium's
OmniboxEditModel::OnEscapeKeyPressed. It lives in one pure function, so the unit tests read like Chrome's case table.Alternatives I rejected:
onEscape(step)callback. Four panes would each re-implement the order, and per-pane drift is the bug this PR fixes.committedAddressneeds no extra state.Two known differences from Chrome:
Linked Issue
Fixes #23762
Visual Proof
Type
ladderin the address bar of a loaded page, then press Escape three times. Each state below was recorded from the rendered app, built once at the base commit and once at this branch:ladderladder, dropdown openladder, dropdown openIn the before build, the screenshots after Escape 1, 2, and 3 are byte-identical.
Testing
pnpm tcandpnpm lintpass.pnpm buildpasses every desktop step and stops atbuild:mobile-web, because this machine has nomobile/dependencies. This PR changes no file undermobile/.pnpm test src/renderer/src/components/browser-pane: 116 files, 934 tests pass. A fullpnpm testrun fails 15 files, none underbrowser-pane. Each failure also appears on the base commit or comes from the local environment: a missingpgpackage, a stale.cross-version-checkoutsdirectory, and a timing test that passes alone.New e2e
tests/e2e/browser-address-bar-escape.spec.tsdrives the real Electron app withORCA_BACKGROUND_LAUNCH=1. It covers an arrowed suggestion, an edit with the list open, an edit with no list rows, and an unedited bar. It passed on every macOS run except one, which timed out at app launch before any Escape step. The next 12 runs passed.paired-client-hosted-browser-host-strip.spec.tsfails at its "Close hosted page" click with and without this change.I checked each new unit test by breaking the behavior it guards and confirming that the test fails.
The e2e found one bug during development, now covered by a test: reverting with an open but empty list made the page's own row reopen the list.
No test of its own: the local pane writing the committed address through
setAddressBarValueFromPage. The local pane shares the hook that the client-hosted pane's failed-load Escape test covers.Manually tested on macOS in a dev build: Korean composition, an edited address, and an arrowed suggestion.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Written with Claude Code (Claude Opus 5.5 as the lead, with Claude Fable 5.1 and Claude Sonnet 5 for design candidates and adversarial review).
Review
An adversarial review by three models (Claude Opus 5.5, Claude Fable 5.1, and Claude Sonnet 5) found five actionable issues, all fixed here: a second source for the committed address, a focus grab that leaving did not cancel, duplicated selection code, a comment that overclaimed what
stopPropagationblocks, and an Escape handler rebuilt on every render.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred). Lint and typecheck pass.pnpm testandpnpm buildhave local failures that are not from this change, listed under Testing.