Skip to content

test(browser): smoke the annotation page hooks on macOS - #1702

Merged
i098 merged 1 commit into
mainfrom
fm/cgx-n196-832-hooks-proof
Dec 5, 2026
Merged

i098 merged 1 commit into
mainfrom
fm/cgx-n196-832-hooks-proof

Conversation

@i098

@i098 i098 commented Dec 5, 2026

Copy link
Copy Markdown
Owner

Refs #832

Summary

Adds a macOS smoke example that drives the four browser page hooks from #832 on a real BrowserTab: evaluate, add_user_script, BrowserEvent::ScriptMessage, and snapshot(region). No runtime code changes.

What changed and why

  • crates/ui/examples/browser_hooks_smoke.rs: new example. Serves a fixture page, registers a user script, evaluates JS, reads page messages, rejects an out-of-bounds snapshot, and writes the 120x72 PNG.

Test evidence

  • macOS: cargo build --locked -p ui --example browser_hooks_smoke at 79a718a. No warnings.
  • Ran the example in a hidden, unfocused window. Frontmost app was wezterm-gui before and after.
  • Output: messages=["userscript:/", "page:loaded", "eval:42"], out_of_bounds_rejected=true, png=120x72 bytes=423.
  • Not run: Linux cargo check (blocked by the sandboxed blaze wrapper; the example is macOS-only). Workspace fmt, clippy, and test not run for this PR.
  • Screenshot: no visual change. The 120x72 snapshot output is local only at data/cgx-n196-832-hooks-proof/after-snapshot.png, not hosted.

Checklist

  • One concern in this pull request.
  • The title and commit follow Conventional Commits.
  • rustfmt --edition 2024 clean on the new file.
  • cargo fmt --check for the workspace: not run.
  • cargo clippy --workspace --all-targets -- -D warnings: not run.
  • cargo test --workspace: not run.
  • Visual change: not applicable, no visual change.
  • CHANGELOG.md line: not applicable, no user-visible change.

Drives evaluate, add_user_script, ScriptMessage and snapshot(region) in a
hidden, unfocused BrowserTab against a local fixture page.

Refs #832
@i098
i098 merged commit f503512 into main Dec 5, 2026
4 checks passed
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