Skip to content

feat(browser): SQLite browsing history, frecency omnibox, read-only import, clear-data confirm, and saved-tab hold - #289

Merged
Hona merged 1 commit into
devfrom
browser-ui/pr4-history-omnibox
Nov 20, 2026
Merged

Hona merged 1 commit into
devfrom
browser-ui/pr4-history-omnibox

Conversation

@Hona

@Hona Hona commented Nov 20, 2026

Copy link
Copy Markdown
Member

Summary

Completes remaining BROWSER-UI upstream sync work (UP-106 #65073, UP-117 #65124, UP-100 #65067) with zero new external crates and #![forbid(unsafe_code)]:

  • SQLite browsing history & frecency search (crates/browser-pane/src/history/{page,search,store}.rs):
    • Stores up to 50,000 http(s) web pages in <data>/browser/history.sqlite with PRAGMA secure_delete = ON and VACUUM on clear; strictly excludes file://, workspace://, artifact://, oc-preview://, about:, data:, credentialed URLs, and isolated/private ContextKind::IsolatedPreview tabs.
    • Ports upstream word-start quality (START > INSIDE), 5-step recency decay, log2(1 + visits + typed) frequency, single-word host-sum front-page completion, idempotent merge, one-time legacy plugin.browser/history adoption, and least-frecency pruning.
  • Read-only user-explicit browser history import (crates/browser-pane/src/history/import.rs, apps/desktop/src/plugin_host/native/browser/history.rs):
    • Discovers Chromium, Firefox, and Safari profiles ONLY when the user explicitly clicks "Import…" in Settings › Browser (never on startup).
    • Copies source SQLite (+ -wal/-shm) to a private scratch directory opened SQLITE_OPEN_READ_ONLY + PRAGMA query_only = ON, filtering hidden/non-web/credentialed rows, resolving browser/profile IDs strictly in Rust, and honoring OPENCODE_BROWSER_IMPORT_ROOT for scratch-profile proofs.
  • Chrome-style omnibox (plugins/browser/{address,history,panel,app,init}.luau):
    • Upgrades address.luau to upstream address-machine.ts (following/held/closed, Chrome row order with Google Search + address + frecency pages, inline completion suffix, Arrow/Tab cycling, layered Escape unwind, and single-item Forget via Shift+Delete or click).
  • Confirm before clearing browsing data (UP-117 #65124, plugins/browser/{settings,init}.luau):
    • Clicking "Clear browsing data" opens a DialogSize::Normal confirmation modal ("Clear browsing data?", Cancel autofocused, danger "Clear data"), clearing history.sqlite + legacy history only on confirmation while preserving saved rune.sitePermissions and preferences.
  • Saved tabs & loading hold (UP-100 #65067, plugins/browser/saved_tabs.luau):
    • Persists per-session tab URL, title, and bounded data:image/ favicon (<= 6,000 bytes, max 50 sessions) and holds saved titles/icons on the tab strip while restoring/loading.

Verification

  • pwsh scripts/guardrails.ps1 (5/5), pwsh scripts/web.ps1 -Check (wasm32 + web-clock), and cargo check --workspace --all-targets green.
  • Driven live against scratch RUNE_DIRS_ROOT + synthetic Chrome/Firefox profiles under OPENCODE_BROWSER_IMPORT_ROOT (proof/browser-ui/prove-pr4.ts):
    • Read-only user-explicit import: verified 0 rows on startup; clicking "Import…" imported 3 Chrome + 1 new Firefox web rows (filtered hidden=1, file://, user:pass@, about:); re-importing Chrome was idempotent (4 rows); SHA-256 of both source DBs stayed byte-identical.
    • Omnibox & Forget: typing "gith" opened Chrome-ordered dropdown (github.com front-page + gith — Google Search + frecency pages) with inline completion; forgetting linear.app/anomaly/issues deleted it from history.sqlite and removed its host row immediately.
    • Clear-data confirmation (UP-117): Cancel preserved all 3 rows in history.sqlite; confirming "Clear data" wiped history.sqlite to 0 rows while preserving rune.sitePermissions.
  • Visually verified light & dark 1x and 1.5x captures (12 PNGs in proof/browser-ui/pr4/).
  • Not proved: Safari History.db import on macOS (implemented against history_items/history_visits schema, not exercised on Windows) and live CEF restart title/favicon hold across a real CEF process restart.

…mport, clear-data confirm, and saved-tab hold

Complete remaining BROWSER-UI upstream sync items (`UP-106` `#65073`, `UP-117` `#65124`,
and `UP-100` `#65067`) with zero new external crates and `#![forbid(unsafe_code)]`:

- **SQLite browsing history & frecency search (`crates/browser-pane/src/history/{page,search,store}.rs`):**
  - Store up to 50,000 `http(s)` web pages in `<data>/browser/history.sqlite` with
    `PRAGMA secure_delete = ON` + `VACUUM` on clear; never record `file://`, `workspace://`,
    `artifact://`, `oc-preview://`, `about:`, `data:`, credentialed URLs, or isolated/private
    `ContextKind::IsolatedPreview` tabs.
  - Port upstream's word-start quality (`START` > `INSIDE`), 5-step recency decay,
    `log2(1 + visits + typed)` frequency, single-word host-sum front-page synthesis,
    idempotent merge, one-time legacy `plugin.browser/history` adoption, and least-frecency pruning.
- **Read-only user-explicit browser history import (`crates/browser-pane/src/history/import.rs`,
  `apps/desktop/src/plugin_host/native/browser/history.rs`):**
  - Discover Chromium, Firefox, and Safari profiles ONLY when the user explicitly clicks
    `"Import..."` in `Settings > Browser` (never on startup).
  - Snapshot source SQLite (+ `-wal`/`-shm`) into a private scratch dir opened strictly
    `SQLITE_OPEN_READ_ONLY` + `PRAGMA query_only = ON`, filtering hidden/non-web/credentialed
    rows; resolve browser/profile IDs strictly on the Rust side; support
    `OPENCODE_BROWSER_IMPORT_ROOT` for scratch-profile proof harnesses.
- **Chrome-style omnibox (`plugins/browser/{address,history,panel,app,init}.luau`):**
  - Upgrade `address.luau` to upstream `address-machine.ts` (`following`/`held`/`closed` list,
    Chrome row ordering with Google Search + address + frecency pages, inline completion suffix,
    Arrow/Tab cycling, layered Escape unwind, and single-page Forget via `Shift+Delete` or click).
- **Confirm before clearing browsing data (`UP-117` `#65124`, `plugins/browser/{settings,init}.luau`):**
  - Clicking `"Clear browsing data"` opens a `DialogSize::Normal` confirmation modal
    (`"Clear browsing data?"`, Cancel autofocused, danger `"Clear data"`), wiping `history.sqlite`
    and legacy history only after confirmation while preserving `rune.sitePermissions` & `preferences`.
- **Saved tabs & loading hold (`UP-100` `#65067`, `plugins/browser/saved_tabs.luau`):**
  - Persist per-session tab URL, title, and bounded favicon (`<= 6000` bytes, max 50 sessions)
    and hold saved titles/icons on the tab strip while restoring/loading.
@Hona
Hona merged commit e64ac67 into dev Nov 20, 2026
6 checks passed
@Hona
Hona deleted the browser-ui/pr4-history-omnibox branch November 20, 2026 12:53
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

PR test build retired — merged into dev. Install or auto-update OpenCode (Rune) from https://anoma.ly/release/opencode/desktop-rune/dev/macos-arm64-dmg.

Hona added a commit that referenced this pull request Nov 20, 2026
…18..UP-122 (#295)

- Fold verified fleet PRs #278, #285, #287, #288, #289, #290, #291, and
  #293 (Rune dc8f7f72: #1301, #1302 focus rescue verified Send+Enter -> effort)
  into docs/upstream-sync/ledger.{json,md}
- Close UP-062 packaged-default regression (#278), UP-095-UI / UP-100 /
  UP-106 / UP-109 / UP-117 (#285, #289), and PRE-08 (#287); reassign
  UP-115, UP-116, UP-075 to BROWSER-UI
- Add separate Reviewed column for browser rows tracking retrospective
  security reviews on merged PRs (#245, #268, #272, #277, #288, #275, #287,
  #285, #289) and pre-merge holds (#274, #280, #281, #283, #286, #292, #294,
  and BROWSER-TOOLS PR 3+)
- Audit upstream anomalyco/opencode bfee96a859..2002222d13 (+6 commits:
  1 skipped, 5 added: UP-118..UP-122) and refine radar routing
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