Skip to content

feat(browser): add clear history and entry removal to address bar and toolbar menu - #19419

Open
eojonathan wants to merge 1 commit into
stablyai:mainfrom
eojonathan:feat/clear-browser-address-bar-history
Open

eojonathan wants to merge 1 commit into
stablyai:mainfrom
eojonathan:feat/clear-browser-address-bar-history

Conversation

@eojonathan

Copy link
Copy Markdown
Contributor

ELI5

Adds the ability to delete individual entries from the browser address bar dropdown (via hover 'X' button or Shift+Delete / Shift+Backspace keyboard shortcut) and to clear the entire browsing history from both the address bar dropdown and the browser toolbar menu.

What Changed

  • Store & State (browser-slice-contract.ts, browser-history-actions.ts):
    • Added removeBrowserHistoryEntry(urlOrPath: string) action to remove an entry from both browserUrlHistory (by matching exact URL or normalized URL) and workspaceDocHistory (by matching document file path).
    • Existing clearBrowserHistory() now cleanly resets both history collections.
    • Added unit test suite browser-history-actions.test.ts covering entry removal for URLs and documents, and full history clearing.
  • Address Bar UI (BrowserAddressBarSuggestionList.tsx, BrowserAddressBar.tsx):
    • Added a remove button (X) on suggestion items with hover/selection styling, stopping pointer/click event propagation to prevent triggering navigation.
    • Added a "Clear history" action at the bottom of the suggestions list with a Trash2 icon and separator.
    • Added keyboard shortcut support: pressing Shift+Delete or Shift+Backspace removes the currently highlighted history suggestion and retains input focus.
    • Modularized address bar helpers (browser-address-bar-expansion.ts, use-browser-address-bar-edit-session-sync.ts) maintaining strict adherence to max-lines limits.
  • Browser Toolbar Menu (browser-toolbar-menu-dropdown.tsx):
    • Added "Clear History" option with Trash2 icon and success feedback toast.
  • Localization:
    • Added localization keys for clearHistory, clearHistorySuccess, removeSuggestion, and history in src/renderer/src/i18n/locales/en.json.

Why

Users previously had no way to remove stale, mistyped, or sensitive URLs and local files from the address bar suggestion history, nor any way to clear browsing history from the UI. This brings standard browser ergonomics to the embedded browser pane.

Linked Issue

Fixes #

Visual Proof

Before

Address bar autocomplete popup shows history entries without any option to remove individual entries or clear history:
Browser Address Bar Before

After

  • Each history suggestion row includes a dedicated remove ('X') action on hover/selection.
  • History dropdown features a footer action to "Clear history".
  • Browser toolbar dropdown includes "Clear History" with confirmation toast.
  • Supports Shift+Delete / Shift+Backspace shortcut on selected history items.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated:
    • src/renderer/src/store/slices/browser/browser-history-actions.test.ts (3 tests passed)
    • src/renderer/src/components/browser-pane/assemble-chrome/BrowserAddressBar.test.tsx (tests for Shift+Delete, click remove, clear history)
  • Code quality checks:
    • check-changed-code-quality.mjs: 0 findings across code quality, type-aware code quality, and React Doctor.
    • oxlint: 0 warnings, 0 errors.
    • verify-localization-catalog.mjs: 14,369 keys verified.
    • generate-runtime-required-english-catalog.mjs: verified.

AI Disclosure

Assisted by Antigravity (Advanced Agentic Coding).

Review

Ready for review.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • 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)

@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Walkthrough

The change adds browser history removal by URL or workspace document path and clears both history collections. The address bar now uses hooks for expansion measurement and edit-session restoration and persistence. History suggestions support individual removal, keyboard removal, and clearing all history. The browser toolbar also exposes a clear-history action. English localization and component and store tests cover the new behavior.

Merge Risk: Low · previous review e58d2

Two narrow history-management issues remain: deleting a document entry may remove same-path entries from other worktrees, and toolbar clearing may briefly show a stale URL. The change is otherwise mergeable with these fixes.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the user-facing changes, implementation, rationale, testing, and AI usage. However, the required linked issue is blank, and the required visual proof does not include a clear … Add the issue number after Fixes #. Attach a clear after screenshot or video alongside the before proof. List the platforms tested, such as macOS, Linux, Windows, or SSH, or state why each platform is not applicable.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 9 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)

Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding browser history clearing and individual entry removal to the address bar and toolbar menu.
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: Description check

Explanation

The description explains the user-facing changes, implementation, rationale, testing, and AI usage. However, the required linked issue is blank, and the required visual proof does not include a clear after attachment. The testing section also does not identify the platforms tested.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 9 files. (1 skipped: 1 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@pullfrog pullfrog 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.

ℹ️ No critical issues — one minor UX nit inline.

Reviewed changes

  • Store action removeBrowserHistoryEntry — removes a URL (exact or normalized) from browserUrlHistory and a document path from workspaceDocHistory, with a focused unit-test suite.
  • Address bar suggestions — per-row remove button plus a "Clear history" footer, and Shift+Delete/Shift+Backspace removal of the highlighted history row.
  • Toolbar menu — adds a "Clear History" item with a success toast.
  • Refactor — extracts useBrowserAddressBarExpansion and useBrowserAddressBarEditSessionSync hooks out of BrowserAddressBar (faithful, no behavior change) to stay under max-lines.
  • Localization — new intent-named message IDs, matching the current message-ID policy.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@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: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 60e48b7d-99e8-4ce0-bd00-2e3c6729f236

📥 Commits

Reviewing files that changed from the base of the PR and between cbc7bb4 and a3794d057d0e6e88a0cf4322992d76c20d83cb12.

📒 Files selected for processing (10)
  • 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-expansion.ts
  • src/renderer/src/components/browser-pane/assemble-chrome/browser-toolbar-menu-dropdown.tsx
  • src/renderer/src/components/browser-pane/assemble-chrome/use-browser-address-bar-edit-session-sync.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/browser/browser-history-actions.test.ts
  • src/renderer/src/store/slices/browser/browser-history-actions.ts
  • src/renderer/src/store/slices/browser/browser-slice-contract.ts

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

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Fixed the clear-history ordering — handleClearHistory now calls restoreTypedQuery() before clearBrowserHistory(), so clearing history while previewing a suggestion correctly reverts the input to the typed query instead of leaving the previewed URL behind. The now-redundant clearSuggestionPreview() call is removed.
  • Destructive menu styling — the toolbar dropdown "Clear History" item is marked variant="destructive", which DropdownMenuItem already supports.

Both changes since the prior review are correct, and the previously reported UX nit is fully addressed.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@eojonathan
eojonathan force-pushed the feat/clear-browser-address-bar-history branch 2 times, most recently from 7810015 to e58d24b Compare September 17, 2026 05:18

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (2)

🟡 Minor · Preserve the worktree in document-history removal. · browser-history-actions.ts:116-126

src/renderer/src/store/slices/browser/browser-history-actions.ts:116-126
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Preserve the worktree in document-history removal. Workspace-document suggestions use filePath as url, and BrowserAddressBarSuggestionList forwards only that value. removeBrowserHistoryEntry then removes every history entry with that path, although document identity includes both worktreeId and filePath. Extend the suggestion callback and BrowserSlice.removeBrowserHistoryEntry contract to carry BrowserPageDocLocation for document rows, including Shift+Delete, and filter those rows with browserPageDocLocationsEqual. Keep string matching for URL suggestions.

🟡 Minor · Restore the address bar before clearing history. · browser-toolbar-menu-dropdown.tsx:227-237

src/renderer/src/components/browser-pane/assemble-chrome/browser-toolbar-menu-dropdown.tsx:227-237
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Restore the address bar before clearing history. Clicking the toolbar trigger blurs the input, but BrowserAddressBar delays restoreTypedQuery() for 200 ms. DropdownMenuItem.onSelect also handles keyboard selection, so the toolbar can clear history before that timer runs. The controlled input can then display the removed preview URL temporarily. Pass the existing dismissal callback to the toolbar menu, or use a shared clear-history handler, and invoke it before clearBrowserHistory().


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 586ae4db-2483-41a1-8f58-93c865a512cf

📥 Commits

Reviewing files that changed from the base of the PR and between 78100153effb990226dc8c1e204f617d58d282a4 and e58d24bb522265e3e4c0adc6c9689fe2dd125224.

📒 Files selected for processing (2)
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/browser/browser-slice-contract.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/i18n/locales/en.json

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

@eojonathan
eojonathan force-pushed the feat/clear-browser-address-bar-history branch from e58d24b to 1eae0ab Compare September 19, 2026 08:11
@eojonathan
eojonathan force-pushed the feat/clear-browser-address-bar-history branch from 1eae0ab to cc8bfc7 Compare October 11, 2026 09:15
@eojonathan
eojonathan force-pushed the feat/clear-browser-address-bar-history branch 2 times, most recently from eec9e9d to 340b37c Compare November 1, 2026 05:50
@eojonathan
eojonathan force-pushed the feat/clear-browser-address-bar-history branch 3 times, most recently from b142dcf to 631fc41 Compare November 14, 2026 18:16
@eojonathan
eojonathan force-pushed the feat/clear-browser-address-bar-history branch from 631fc41 to 0b73689 Compare November 22, 2026 15:30

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