## Summary Adds `NativeView` to GPUI: an element that places a platform view (an `NSView` on macOS) in a window and composites it with the rest of the scene, so that GPUI content can be drawn both under and over it. Delta uses this to show a `WKWebView` in a pane tab with GPUI dialogs and toolbars drawn over the page. What it covers on macOS: - **Compositing.** The native view sits behind the window's Metal layer, and the renderer cuts a hole in the scene where the view shows, so GPUI elements painted after it appear above it. The window's layer is non-opaque only while a scene shows a native view. - **Keyboard input.** Keys go to a focused native view first. An embedder can reserve actions that must keep working whatever the view does with keys, including the first key of a multi-key binding. AppKit controls beside a native view keep their own input. - **Pointer.** GPUI elements over a native view block clicks to it, and the native view chooses the cursor while the pointer is over an unobscured part of it. - **Accessibility.** VoiceOver can reach a native view that is shown. Other platforms get the element and a no-op implementation: `NativeView::new` reports that the window cannot show native views. Also included is a small `div` fix that the embedder needed: an item a scroll handle is asked to scroll to before the handle's first frame is now scrolled to once it has been laid out. ## Testing - Two examples: `cargo run -p gpui --example native_view` and `--example native_view_appkit_field`, which show native views with GPUI drawn over them. - The test platform's window records native view placement, with unit tests for the placement, input-routing policy and reserved-action logic. - Exercised through Delta's browser tabs on macOS 26: typing, shortcuts, splits, zoom, dialogs drawn over the page, and hiding and showing tabs. - Not exercised by hand: the black-flash, stale-cursor and VoiceOver fixes in the last two commits. ## Self-review - [x] I've reviewed my diff for quality, security, reliability, and performance. - [ ] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). - [x] Tests cover the new or changed behavior. Release Notes: - N/A - [GPUI] Added `NativeView`, an element that composites an `NSView` into a window's scene with GPUI content drawn over it. Only macOS supports it for now; `NativeView::new` returns an error on other platforms. - [GPUI] Fixed `ScrollHandle::scroll_to_item` being ignored when called before the handle's first frame. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).
Other platforms are not yet available:
- Web (tracking discussion)
Developing Zed
Contributing
See CONTRIBUTING.md for ways you can contribute to Zed.
Also... we're hiring! Check out our jobs page for open roles.
Licensing
Zed source code is licensed primarily under GPL-3.0-or-later, with Apache-2.0 components where marked.
License information for third party dependencies must be correctly provided for CI to pass.
We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:
- Is it showing a
no license specifiederror for a crate you've created? If so, addpublish = falseunder[package]in your crate's Cargo.toml. - Is the error
failed to satisfy license requirementsfor a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to theacceptedarray inscript/licenses/zed-licenses.toml. - Is
cargo-aboutunable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml, as specified in the cargo-about book.
Sponsorship
Zed is developed by Zed Industries, Inc., a for-profit company.
If you’d like to financially support the project, you can do so via GitHub Sponsors. Sponsorships go directly to Zed Industries and are used as general company revenue. There are no perks or entitlements associated with sponsorship.