Repository navigation
feat(browser): WebKit browser in Rex panes, with point-and-ask for agents - #58
Merged
Merged
Conversation
Leaf: Open Browser (or `leaf browser [url]`) splits a pane and keeps a native WebKit window exactly over it. Nothing is installed in Applications: build.rs compiles src/browser.swift on macOS, leaf embeds it and unpacks it once per version into ~/Library/Caches/leaf. - Follows the pane through splits, resizes, zoom and tab switches, using session.view fractions, Rex's chrome settings and the Rex window frame; refreshes on session events, ignoring client connect noise - Stays just above the Rex window at normal level, not over other apps - Exits when its pane closes or leaf goes away - Minimal toolbar, progress bar, error page, find, zoom, downloads, uploads, JS dialogs, Safari user agent, page title as pane label - Edit menu so copy and paste work; Rex key bindings are forwarded - Builds for the target arch; without swiftc, leaf builds without the browser (CI fails instead) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Click the pointer button (or shift+cmd+c), pick elements with React Grab, type a question and press enter: leaf sends the elements' HTML and, on React development builds, their components and source files to the agent picked with Leaf: Choose Agent…, in its pane or a new one. - React Grab 0.2.0 vendored (MIT) and loaded into a page only when pointing starts, telemetry off; reuses a page's own React Grab - The question is typed in a native composer, so a page can't send anything to the agent by itself; picks only count right after a real click or key in the browser - The helper and `leaf browser` talk in JSON lines; leaf builds the prompt (tested) and delivers it with agent::deliver - The composer names the agent a question would go to, asked live: the picked one, else the one open in a pane (agent::current) - Failed sends keep the composer and copy the prompt to the clipboard Browser fixes: - Hidden during Mission Control instead of shown as its own window - Steps aside while Rex animates panes, then fades back in place - Gives way to Rex's palette and other Rex windows over the pane - Close button in the toolbar; macOS 13 check before launching Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Version 0.18.0 in Cargo.toml and Cargo.lock - CHANGELOG: Unreleased becomes 0.18.0, adding the reader's saved HTML pages and sharp SVGs, and the GitHub posting dialog fix, which were on main without notes - Site version pill reads v0.18 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Review completed against the latest diff
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 15 files
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
View guided diff | Turn on auto-fix | Re-trigger cubic
- Quote the page's title and address with the elements between markers page text can't forge, so a hostile title stays page data - Cap a prompt's elements at 24k characters and say how many were left out - Turn off React Grab's own key so cmd+c stays copy; shift+cmd+c points - Stop the rex events watcher on every exit path - Also look for the pane in the layout tree before treating it as closed - Without a Swift toolchain, rerun the build script once one appears - Drop find's unused fromStart parameter - Docs: leaf browser opens in the current pane, the send button, which agents leaf can start with a question, macOS 13 requirement Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
- The browser, and pages' prefers-color-scheme, follow Rex's light or dark choice (Workspace.appearance), or macOS when Rex does - `leaf browser --check` unpacks the helper and prints its path; the release smoke test uses it to check the shipped helper's architecture and that it starts - Review: cap a page's title and address before reading them, and the changelog says how the CLI opens and which agents leaf can start Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opened without an address, the browser shows a quiet start page: leaf's mark, a hint for the address bar and pointing, and the web servers running on this Mac (listening ports that answer with a page, named by their <title>), each one click away. It's light or dark like Rex, keeps the address bar empty, and reloads with fresh servers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A WebKit browser that lives in a Rex pane, built into leaf. Nothing is installed in Applications. Point at anything on a page and ask your coding agent about it.
leaf browser [url]) splits a pane and keeps a native WebKit window exactly over it. It follows the pane through splits, resizes, zoom and tab switches. It hides during Mission Control and while Rex animates panes, and gives way to Rex's palette.shift+cmd+c, then pick elements with React Grab. Type a question and pressenter. It goes to the agent picked with Leaf: Choose Agent…, either in that agent's pane or in a new pane beside the browser. The composer names the agent live.How
build.rscompilessrc/browser.swiftfor the target arch (macOS 13+), and leaf embeds it. On first use, leaf unpacks it to~/Library/Caches/leaf/webkit-<hash>, replacing older copies. Withoutswiftc, leaf builds without the browser; in CI that's a build failure.session.viewfractions, Rex's chrome settings from its preferences, and the window-server frame of the Rex window. Refreshes are driven by session events, ignoring client connect events, which used to cause a feedback loop.leaf browserexchange JSON lines over stdin and stdout. Rust builds the prompt (unit tested) and sends it withagent::deliver.vendor/react-grab(MIT). It's loaded only when pointing starts, with telemetry off.Safety
Any page can call into injected JS. So a pick only adds context to a native composer, and only
enterin that composer sends anything to the agent. Picks are accepted only right after a real click or key in the browser window.Testing
cargo test: 679 pass. Clippy shows no new warnings.🤖 Generated with Claude Code
Summary by cubic
Adds a WebKit browser that opens in a Rex pane, embedded in leaf. Point at page elements and ask your agent about them; includes
leaf storageand saved HTML pages read as markdown. Also tightens up the browser's security and edge cases and bumps the release to 0.18.0.New Features
leaf storageshows what fills a drive, with junk to clear.Fixes
shift+cmd+cpoints whilecmd+cstays copy.leaf browser --checkprints the helper's path so the release can verify it's built for the right architecture.Written for commit f6330a1. Summary will update on new commits.