Skip to content

feat(browser): history controls: Chrome-style Escape, removable suggestions, history view - #31846

Merged
AmoabaKelvin merged 9 commits into
mainfrom
browser-history-controls
Oct 24, 2026
Merged

AmoabaKelvin merged 9 commits into
mainfrom
browser-history-controls

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​302 $\color{#cf222e}{\Huge{\mathbf{−}}}$​26 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​276
Prod 27 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​926 $\color{#cf222e}{\Huge{\mathbf{−}}}$​101 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​825

ELI5

The built-in browser now handles history the way Chrome does:

  • Escape in the address bar backs out one step at a time.
  • You can delete a suggestion you don't want.
  • Cmd+Y (Ctrl+H on Linux and Windows) opens your browsing history. You can search it, open pages from it, delete rows and clear a time range.

What Changed

Escape in the address bar. Each press does the first of these that applies, in the order Chromium's OmniboxEditModel::OnEscapeKeyPressed uses:

  • If you arrowed onto a suggestion, the bar goes back to what you typed. The list stays open.
  • If the list is open, it closes. An inline completion is dropped at the same time.
  • If you edited the address, it reverts to the page's address with all the text selected. Focus stays in the bar.
  • Otherwise focus goes to the page.

Before, Escape only closed the list. The edit stayed, and so did focus.

This works the same on local, client-hosted and streamed pages. In the document preview's address edit, the last step leaves edit mode.

Removing a suggestion. History rows in the dropdown show an X when you hover over them or arrow onto them. Shift+Delete (Shift+Fn+Delete on a Mac laptop) removes the highlighted row. The entry leaves history, so it is no longer suggested in the dropdown, on the new tab page or in the history view. If that row had filled the bar, the bar goes back to what you typed. Rows that aren't history, like "Search Google", leave Shift+Delete to the text field (on Windows that's Cut). Workspace documents previewed in the browser can be removed too.

History view. It opens from the new "History" item in the "..." page menu, or from the shortcut, whether the page or Orca's own UI has focus.

  • Look. It's a dialog with search, built on the same primitive and styling as the Cmd+J palette.
  • Grouped by day. Pages are grouped Today, Yesterday, then by date. Each row has the favicon, title, address and time.
  • Opening a row. Click or Enter opens the page in the tab you opened history from, and the page gets the keyboard.
  • Removing a row. Use the X or Shift+Delete.
  • Search. Like Chrome's, every word must appear in the title or the address.
  • Clearing. "Clear browsing history" offers Last hour, Today and All time, followed by Undo in the dialog's footer.
  • Closing. The dialog closes if you switch away from that tab.

The shortcut is browser.showHistory in the keybinding registry, so it can be changed in Settings → Shortcuts.

Why

Design

  • Escape follows Chromium's code, not a summary of it. Whether "the user has edited" is decided from the last text you typed, with a comparison against the page address as a fallback. This handles three cases that a plain comparison gets wrong:
    • You retype the exact address and press Escape. Chrome keeps focus in the bar, and so does Orca.
    • An old edit was overwritten by a navigation. Escape goes straight to the page.
    • The pane remounted mid-edit and handed over a draft. Escape still reverts it.
  • The address bar owns Escape on its own. The window-level Escape listener (from fix: dismiss stuck browser address bar autocomplete on webview click #5769) is gone, along with the doc preview's wrapper handler. Blur, webview focus and Radix's outside-click dismissal already close a list left open. Focus goes to the page through the existing requestBrowserFocus, which local, client-hosted and streamed panes all answer, so no pane needed new wiring.
  • The history view is a dialog, not a page in a tab. Chrome, Safari and Arc show history as a page. Orca has no internal URL scheme (normalizeBrowserNavigationUrl only allows http, https, file and the blank page). A page would mean a new page kind with persistence and session plumbing across three pane types, plus Back/Forward rules. The address bar is the one component every pane already shares, and it already has the pane's own "open this URL" and "open this document" actions. So the dialog is rendered there, and opening a row works the same for local, client-hosted and streamed pages.
  • The shortcut is Cmd+Y on macOS and Ctrl+H on Linux and Windows, as in Chrome. The brief said Cmd/Ctrl+Y. On Linux and Windows, Ctrl+Y is redo (and readline yank) inside web pages. Main swallows any browser shortcut before the page sees it, so Ctrl+Y would break redo in Google Docs and other web editors.
  • History stays global per Orca profile, and the cap stays at 200. History lives in the workspace session row and is shared across workspaces and browser profiles. It's stripped from host partitions and never sent to a remote runtime, so mixed client/server versions aren't affected. Raising the cap is cheap for matching. The cost is that every page title change rewrites the whole session row (about 400 bytes per entry, with no size limit on data: favicons), and every mounted address bar rebuilds its suggestions. A real raise should move history into its own storage domain first. That's a separate change.
  • Clear uses Undo instead of a confirm step. It's in the dialog's footer rather than a toast, because the dialog's overlay covers the app's toaster.

Ruled out:

Known differences from Chrome

  • History keeps one entry per page with its last visit time, not one per visit. A page shows once, under the day you last visited it. "Last hour" removes the whole entry, including earlier visits. Chrome removes only the visits in the range. Matching Chrome needs per-visit storage.
  • With a Korean IME on macOS, Escape skips IME-owned keydowns (the same helper Orca uses for Enter). I haven't tried it with a real IME.

Open questions for Kelvin

  • Ctrl+H instead of Ctrl+Y on Linux and Windows, as described above. Do you agree?
  • Scope: history is shared across workspaces and browser profiles today. Chrome keeps history per profile. Should a "Work" profile get its own history? That would need new fields on each entry. Entries already saved have no profile, so they'd need a home.
  • The 200 cap: is a separate PR that moves history out of the session row, then raises the cap (to a 90-day window, say), worth doing?
  • Should clearing history also offer cookies and cache, like Chrome's dialog? Left out here because it's separate work.
  • Community PRs feat(browser): match Chrome's omnibox Escape in the address bar #23763 (Escape) and feat(browser): add clear history and entry removal to address bar and toolbar menu #19419 (row removal and clear) are covered by this one. Close them once this lands?

Mobile

The mobile app has no address-bar suggestions or history UI; it drives desktop pages. Parity would need runtime RPCs to list, remove and clear history, served from the desktop store (history isn't in any RPC today), plus a history screen. Not part of this PR.

Sibling work

  • BrowserAddressBar.tsx, the keybinding definitions and browser-guest-shortcut-dispatch.ts are also being edited in the sibling browser branches. My changes there are small.
  • The bar was at its 400-line limit, so the arrow-key preview logic moved out unchanged into use-browser-address-bar-suggestion-preview.ts.

Linked Issue

Fixes #23762

Visual Proof

Escape: type "wiki", arrow to a suggestion, press Escape four times

Before: the first Escape closes the list. The second and third do nothing, and focus stays in the bar.

(screenshot removed: contained real product data)

After: back to "wiki", close the list, revert to the page address with all of it selected, then focus the page. The caption shows the bar text and where focus is after each press.

(screenshot removed: contained real product data)

Removing a suggestion

Before: no X on hover. Shift+Delete does nothing.

(screenshot removed: contained real product data)

After: arrowing onto a row shows its X. Shift+Delete removes it and the bar goes back to "o". Hovering another row and clicking its X removes that one too.

(screenshot removed: contained real product data)

Dark theme:

(screenshot removed: contained real product data)

History view

Before: the "..." menu has no History item, and Cmd+Y does nothing.

(screenshot removed: contained real product data)

After: open History from the menu, search, remove a row with Shift+Delete, clear the last hour, Undo, then Cmd+Y and open a row.

(screenshot removed: contained real product data)

Dark theme:

(screenshot removed: contained real product data)

Light Dark
(screenshot removed: contained real product data) (screenshot removed: contained real product data)

Testing

  • Recorded and checked on macOS in a hidden dev build over CDP, on main (before) and this branch (after). Also checked live:

    • Keyboard-only clear and Undo, with the dialog staying open.
    • Opening a row leaves focus on the page.
    • Switching to another tab closes the dialog.
    • The row X is hidden until a row is hovered or selected.
  • Not tested by hand: Linux, Windows, SSH, client-hosted and streamed panes. Those share the same bar, focus request and shortcut hook, and their pane tests pass.

  • New tests:

    • BrowserAddressBar.test.tsx: the Escape order, a retyped address keeping focus in the bar, Shift+Delete removing a history row and restoring the typed text, and Shift+Delete passing through on a non-history row.
    • browser.test.ts: clearing since a time removes pages and documents, and Undo puts back exactly those.
    • browser-history-view-rows.test.ts: all-words search, grouping by local day, and the start of each time range.
    • browser-manager-guest-shortcuts.test.ts: the shortcut is forwarded from a focused page.
  • I checked that the retyped-address test fails without the typed-text check.

  • Locally: pnpm run check:code-quality:changed, pnpm run check:react-doctor:changed, the localization verifiers, and the focused suites (479 tests in 43 files).

  • Not run yet: the full lint, typecheck and test suite. pr.yml skips every job on a draft PR, so they will run once this is marked ready.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Codex review, three rounds. Each finding was checked against the code, and those that held were fixed:

  • Enter on the footer's Undo opened a row instead.
  • Focus wasn't handed to streamed pages after opening a row.
  • Shift+Delete removed rows during IME composition.
  • A test caller missed the new prop.
  • Focus was requested before the dialog's focus trap let go.
  • The row X stole focus from the search field.
  • The dialog stayed open over a tab you'd switched away from.
  • Tab couldn't wrap within the dialog.

I first pushed back on one finding, about floating browser panels, and a later review proved it. With History open from a floating browser, pressing the shortcut again moved the view to the main browser: the search was lost and the next pick opened there. Now, while History is open, the shortcut keeps it on its own page. A two-pane test covers it. Cmd/Ctrl+W from inside any portaled dialog is still a wider, existing issue.

Agent skill upstream boundary

  • Not applicable, or this change 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

  • Cross-platform: Escape and Shift+Delete need no platform branches. The history shortcut has per-platform defaults, and the footer key labels come from the keybinding formatter.
  • Remote and SSH: renderer and main only. History never crosses to the runtime, and there are no RPC changes.
  • Backwards compatibility: no saved-data format changes. Clear and remove only filter the existing arrays.
  • Performance:
    • A closed history view subscribes only to a boolean per bar.
    • The open view lets cmdk track the selection itself, so hovering doesn't re-render every row.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@AmoabaKelvin
AmoabaKelvin marked this pull request as ready for review October 22, 2026 21:41
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9825d6fc-eb81-49fd-b7b9-58db9d2c01da
📥 Commits

Reviewing files that changed from the base of the PR and between b838a52 and 27680b2.

📒 Files selected for processing: 6
  • src/main/browser/browser-guest-shortcut-dispatch.ts
  • src/main/browser/browser-manager-guest-shortcuts.test.ts
  • src/preload/api/ui-command-event-api.ts
  • src/renderer/src/components/browser-pane/assemble-chrome/use-browser-page-chrome-focus.ts
  • src/renderer/src/components/browser-pane/history/use-browser-history-shortcut.test.tsx
  • src/renderer/src/components/browser-pane/history/use-browser-history-shortcut.ts

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

📝 Walkthrough

The change adds browser history access through a platform-specific shortcut and a toolbar item. A history dialog combines URL and workspace-document entries, supports search, removal, clearing by time range, and undo. Store actions now return cleared entries and restore both history types. The address bar handles Escape in ordered steps, supports removing selected history suggestions, and passes committed values and leave actions from its callers.

Fixed issue severity: Low

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 27680

History and shortcut behavior appears mergeable with a narrow Escape limitation: with an IME that emits only a composition-owned Escape, suggestions remain open. The two-event Escape path closes them while preserving typed text.

Pre-merge checks: Passed 2 · Failed 3

Failed Failed checks: 3 warnings

Check name Status Explanation Resolution
Linked Issues check Warning Issue #23762 requires four ordered Escape steps in the address bar. The reviewed head implements them in use-browser-address-bar-escape.ts: restore typed text when previewing, close the list, revert… Handle an IME-owned Escape so it closes an open suggestion list and keeps the composed value in the bar. Do not revert the edit or move focus for that event. Add an automated test that dispatches an IME-owned Escape with an open list and as…
Out of Scope Changes check Warning The only directly linked issue is #23762, which covers Escape behavior in the browser address bar. The PR also adds: a browser.showHistory keybinding and shortcut forwarding (`browser-guest-shortcut… Move the history view, history shortcut, row removal, clear and Undo, and the related store, preload, and i18n changes to a separate PR linked to its own issue. Alternatively, link the issue that requires these features. Keep this PR limite…
Docstring Coverage Warning Docstring coverage is 43.90% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 41 functions across 37 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 2 passed
Check name Status Explanation
Title check Passed The title is specific and matches the changeset. It names the three main pieces: Chrome-style Escape handling in the address bar, removable history suggestions, and the history view dialog. The title …
Description check Passed The description follows the repository template closely. It has the ELI5, What Changed, Why, Linked Issue (Fixes #23762), Visual Proof with before/after videos, Testing with the manual-test box checke…
Full details: Title check

Explanation

The title is specific and matches the changeset. It names the three main pieces: Chrome-style Escape handling in the address bar, removable history suggestions, and the history view dialog. The title is long (89 characters), but it still describes the primary change.

Full details: Description check

Explanation

The description follows the repository template closely. It has the ELI5, What Changed, Why, Linked Issue (Fixes #23762), Visual Proof with before/after videos, Testing with the manual-test box checked, Review, Agent skill upstream boundary, Notes, and Checklist sections. Some template items are not completed. The AI Disclosure section is empty. The Linked Issue is filled in. The Checklist leaves 'This PR is small and focused' and the lint/typecheck/test/build item unchecked. The author states that the full lint, typecheck, and test suite has not been run yet. The description is extensive, and the author admits the PR covers several areas.

Full details: Linked Issues check

Explanation

Issue #23762 requires four ordered Escape steps in the address bar. The reviewed head implements them in use-browser-address-bar-escape.ts: restore typed text when previewing, close the list, revert the edit to the committed address with all text selected, or leave to the page. The document-preview path uses onLeave. The issue also requires that Escape during IME composition closes the suggestion list and keeps the composed text. In handleEscapeKeyDown, the guard event.key !== 'Escape' || isImeOwnedKeyboardEvent(event) returns false before preventDefault, closeSuggestions, or onChange run. An IME-owned Escape therefore does nothing. The PR description confirms this: Escape skips IME-owned keydowns and was not tested with a real IME. The IME requirement is unmet.

Resolution

Handle an IME-owned Escape so it closes an open suggestion list and keeps the composed value in the bar. Do not revert the edit or move focus for that event. Add an automated test that dispatches an IME-owned Escape with an open list and asserts that the list closes and the value is unchanged.

Full details: Out of Scope Changes check

Explanation

The only directly linked issue is #23762, which covers Escape behavior in the browser address bar. The PR also adds: a browser.showHistory keybinding and shortcut forwarding (browser-guest-shortcut-dispatch.ts, definitions-core-2.ts, types.ts); a History menu item (browser-toolbar-menu-dropdown.tsx); a searchable history dialog (BrowserHistoryDialog.tsx, browser-history-view-rows.ts); row removal with Shift+Delete and an X button (browser-history-row-removal.ts, BrowserHistoryRowRemoveButton.tsx); time-range clearing with Undo (browser-history-actions.ts, browser-slice-contract.ts); and new store and preload APIs (onShowBrowserHistory, browserHistoryPageId, restoreBrowserHistory). None of these changes has a requirement in #23762. The PR description also cites #19419 and #23763, which are not linked here. Those references do not add requirements to this PR. Files that only support the Escape change, such as the BrowserAddressBar split and the dismissal change, are in scope.

Resolution

Move the history view, history shortcut, row removal, clear and Undo, and the related store, preload, and i18n changes to a separate PR linked to its own issue. Alternatively, link the issue that requires these features. Keep this PR limited to the Escape behavior in #23762 and its tests.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • 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

Comment @coderabbitai help to get the list of available commands.

@AmoabaKelvin
AmoabaKelvin force-pushed the browser-history-controls branch from 3c52d1d to e749e4c Compare October 23, 2026 15:14

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d4064a96-f529-4c86-b634-c6f7b92fba38
📥 Commits

Reviewing files that changed from the base of the PR and between db46593 and e749e4c.

📒 Files selected for processing: 37
  • src/main/browser/browser-guest-shortcut-dispatch.ts
  • src/main/browser/browser-manager-guest-shortcuts.test.ts
  • src/preload/api/ui-bridge-tab-and-browser-commands.ts
  • src/preload/api/ui-command-event-api.ts
  • src/renderer/src/components/browser-cookie-import-google-disclosure.test.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/BrowserAddressBar.test.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/BrowserAddressBar.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/BrowserAddressBarSuggestionList.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/browser-address-bar-suggestions.ts
  • src/renderer/src/components/browser-pane/assemble-chrome/browser-navigation-control-row.test.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/browser-toolbar-menu-dropdown.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/browser-workspace-pane.adoption-chrome.test.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/use-browser-address-bar-dismissal.ts
  • src/renderer/src/components/browser-pane/assemble-chrome/use-browser-address-bar-escape.ts
  • src/renderer/src/components/browser-pane/assemble-chrome/use-browser-address-bar-row-removal.ts
  • src/renderer/src/components/browser-pane/assemble-chrome/use-browser-address-bar-suggestion-preview.ts
  • src/renderer/src/components/browser-pane/assemble-chrome/use-browser-page-chrome-focus.test.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/use-browser-page-chrome-focus.ts
  • src/renderer/src/components/browser-pane/client-hosted-browser-pane-test-rig.ts
  • src/renderer/src/components/browser-pane/history/BrowserHistoryDialog.tsx
  • src/renderer/src/components/browser-pane/history/BrowserHistoryRowRemoveButton.tsx
  • src/renderer/src/components/browser-pane/history/browser-history-row-removal.ts
  • src/renderer/src/components/browser-pane/history/browser-history-view-rows.test.ts
  • src/renderer/src/components/browser-pane/history/browser-history-view-rows.ts
  • src/renderer/src/components/browser-pane/history/use-browser-history-shortcut.ts
  • src/renderer/src/components/browser-pane/new-tab/BrowserNewTabPage.tsx
  • src/renderer/src/components/browser-pane/stream-remote/remote-browser-page-pane.address-bar.test.tsx
  • src/renderer/src/components/browser-pane/stream-remote/remote-browser-page-pane.chrome-chords.test.tsx
  • src/renderer/src/components/browser-pane/workspace-doc/doc-preview-address-edit.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/browser.test.ts
  • src/renderer/src/store/slices/browser/browser-history-actions.ts
  • src/renderer/src/store/slices/browser/browser-slice-contract.ts
  • src/renderer/src/store/slices/browser/create-browser-slice.ts
  • src/renderer/src/web/preload-api/web-ui-api.ts
  • src/shared/keybindings/definitions-core-2.ts
  • src/shared/keybindings/types.ts

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

@AmoabaKelvin
AmoabaKelvin force-pushed the browser-history-controls branch from e749e4c to b838a52 Compare October 23, 2026 17:05
@AmoabaKelvin
AmoabaKelvin force-pushed the browser-history-controls branch from b838a52 to 27680b2 Compare October 23, 2026 22:24
@AmoabaKelvin
AmoabaKelvin merged commit 5dc197e into main Oct 24, 2026
47 checks passed
@AmoabaKelvin
AmoabaKelvin deleted the browser-history-controls branch October 24, 2026 04:46
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.

[Feature]: Escape in the browser address bar should back out one step at a time, like Chrome

1 participant