Skip to content

feat(browser): complete OOPIF pointer/upload/drop coords, HTML5 drag interception, request postData fallback, and trace/cpu auto-stop timers - #446

Merged
Hona merged 6 commits into
devfrom
browser-tools/pr4-complete-typed-tools
Nov 21, 2026
Merged

Hona merged 6 commits into
devfrom
browser-tools/pr4-complete-typed-tools

Conversation

@Hona

@Hona Hona commented Nov 21, 2026

Copy link
Copy Markdown
Member

Summary

Closes every remaining partly row among official's 43 non-Lighthouse experimental.browser v4 typed operations (db2d889c0e24daf7b34c8dede641fb01fcd02c00), and marks UP-095-TOOLS as "have it" in docs/upstream-sync/ledger.json.

What changed (official db2d889c)

  • Cross-origin OOPIF pointer coordinates (exec/point.rs, exec/input.rs, rpc/frames.rs): PointResolver measures getBoundingClientRect() in the element's own frame/session and walks DOM.getFrameOwner + owner getBoundingClientRect() (clientLeft/clientTop + CSS scale) through TabFrameState::ancestor_owners (session_for), matching official rect + sessionFor (packages/gui-plugins/src/browser/chromium.ts). Shared by click, hover, drag, check, and files.drop.
  • HTML5 draggable drag interception (exec/input.rs, exec/mod.rs, rpc/mod.rs): checks this.draggable, enables Input.setInterceptDrags, runs 10 intermediate mouseMoved steps (buttons: 1), waits up to 2 s for Input.dragIntercepted, dispatches dragEnter / dragOver / drop with the captured DragData, and always disables drag interception and releases the mouse on completion or cancel (chromium.ts case "drag").
  • OOPIF files.upload & files.drop (exec/files.rs, apps/browser-engine/src/{wire.rs,engine.rs,agent.rs,frame_authority.rs}, crates/browser-pane/src/{protocol.rs,find.rs}): HostMsg::UploadFiles carries optional session_id / frame_id, verified against #350's EngineCdpLedger::check_upload_target before DOM.setFileInputFiles; files.drop uses PointResolver.
  • network.get Network.getRequestPostData fallback (exec/capture.rs, crates/browser-pane/src/tools/diagnostics.rs): when includeBody is true and hasPostData was set without inline postData, fetches via Network.getRequestPostData before Network.getResponseBody.
  • Auto-stop timers for trace.start and cpu.start (exec/profile.rs, exec/profile_analyze.rs, rpc/session.rs, rpc/mod.rs): trace.start honors durationMs (1_000..=30_000 ms, default 30 s) and cpu.start caps at CPU_MAX_DURATION_MS = 30_000 ms (packages/gui-plugins/src/browser/profiling-machine.ts:8-11, 200-270). poll_auto_stops auto-stops, caches the capture, and returns exact deadlines (zero idle wakeups when not recording); a later trace.stop / cpu.stop returns the cached capture immediately. Retained analyzers moved verbatim to profile_analyze.rs to stay under the 800-line ceiling.

Recorded differences (notes/upstream-sync/ours.md)

  • Profiling (heap.snapshot, cpu.*, trace.*) stays refused by #350's engine ledger while browser extensions are active.
  • lighthouse returns truthful unsupported without bundling Node.js (official runs Node.js lighthouse inside Electron's desktop process via a live CDP session, packages/gui-plugins/src/browser/lighthouse.ts:1-85).

Engine revision

  • Touches apps/browser-engine/ and HostMsg::UploadFiles (optional #[serde(default)] fields).
  • ENGINE_REVISION stays at 4 on dev (published stable.json is at 156.0.26-3, so dev is already ahead of published).

Checks

  • cargo check -p opencode-desktop --locked: pass (0 warnings).
  • cargo build --manifest-path apps/browser-engine/Cargo.toml --bin opencode-browser-engine: pass (0 warnings).
  • scripts/guardrails.ps1: 5/5 passed.

Hona added 6 commits November 21, 2026 15:14
…ception, request postData fallback, and trace/cpu auto-stop timers
…lete-typed-tools

# Conflicts:
#	docs/upstream-sync/ledger.json
…lete-typed-tools

# Conflicts:
#	docs/upstream-sync/ledger.json
…lete-typed-tools

# Conflicts:
#	apps/desktop/src/surfaces/browser/rpc/exec/profile.rs
#	apps/desktop/src/surfaces/browser/rpc/session.rs
@Hona
Hona merged commit 87fc4c2 into dev Nov 21, 2026
@Hona
Hona deleted the browser-tools/pr4-complete-typed-tools branch November 21, 2026 07:59
@github-actions

github-actions Bot commented Nov 21, 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.

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