RFC: Visual Extension API - Allow Extensions to Render GUI #53403
Replies: 8 comments
-
|
this is something that actually caused me to move away from zed some time ago i loved everything about this editor... but it definitely needs much more support for extensions id even say it should definitely be even more capable than what other ide alternatives have in place. this is something that seems to get relatively overlooked and i enjoyed using zed so much that i would definitely love to contribute and build this feature out. |
Beta Was this translation helpful? Give feedback.
-
|
I'd be interested in assisting with the development of this feature as well as I've been dying for a DB viewer in Zed to fully replace my workflow in VSCode. Some feedback on the RFC: impl Extension for MyExtension {
fn new() -> Self { ... }
fn build_ui(&self) -> UiDefinition {
UiDefinition {
panels: vec![
PanelInfo {
id: "my-panel",
name: "My Extension",
position: PanelPosition::RightSidebar,
...
}
],
status_items: vec![...],
}
}
fn render_panel(&self, panel_id: &str) -> ElementTree {
// Return component tree
}
}This makes the assumption that all extensions need to implement a UiDefinition. As of now, none do which means it would break every existing extension unless every developer updates theirs. The semantics from a Ui are very different from that of a debugger or lsp, so an entirely new Trait that inherits Extension's methods would make sense here rather than adding it as another method in the existing trait. E.g. pub trait UIExtension: Extension {
fn render (&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement;
}
struct HelloWorld {
text: SharedString,
}
impl Render for HelloWorld {
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
div()
.flex()
.flex_col()
.gap_3()
.bg(rgb(0x505050))
.size(px(500.0))
.justify_center()
.items_center()
.shadow_lg()
.border_1()
.border_color(rgb(0x0000ff))
.text_xl()
.text_color(rgb(0xffffff))
.child(format!("Hello, {}!", &self.text))
.child(
div()
.flex()
.gap_2()
.child(div().size_8().bg(gpui::red()))
.child(div().size_8().bg(gpui::green()))
.child(div().size_8().bg(gpui::blue()))
.child(div().size_8().bg(gpui::yellow()))
.child(div().size_8().bg(gpui::black()))
.child(div().size_8().bg(gpui::white())),
)
}
}
impl UIExtension for MyExtension {
fn new() -> Self { ... }
fn render (&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
cx.create_pane(PaneOptions {
position: PanePosition::Left,
width: px(500)
},
|_, cx| {
cx.new(|_| HelloWorld {
text: "World".into(),
})
}).unwrap()
}
}I believe there's no better abstraction for Zed UI extensions than GPUI. It already uses a bunch of web semantics (divs, trees, etc.), is well understood by the Zed team, has documentation, and already has a components library. Writing an entirely new DSL would be a big ask for the team since they've mentioned their focus on AI features right now. The most difficult aspect of this though is security. Simply punching in GPUI code directly into the main process eliminates Zed's entire security model and allows any UI extension developer to run native code on your machine. My two-cents is the best way to implement this would be to extend GPUI to have a serde implementation that lets subprocesses make GPUI calls over the wire via IPC. The main Zed process can sanitize any incoming calls and validate the caller's permissions. Addendum: |
Beta Was this translation helpful? Give feedback.
-
|
This RFC addresses exactly the kind of use case I've been wanting to build: a native sidebar panel that displays real-time data from external services, Linear tickets, Jira issues, AWS resources, database views, etc. Right now the only viable path for this kind of integration is MCP, which works for AI-assisted workflows but doesn't give you a persistent, always-visible panel. A proper Visual Extension API with GPUI-rendered panels would unlock an entirely different category of extensions ones that keep external context visible alongside your code without switching apps or opening a browser. Some concrete use cases this would enable:
Personally, I'm tired of the resource overhead of tools like JetBrains IDEs and I want to switch fully to Zed but that requires feature parity on the integration side. This API would be a major step toward making that switch viable for teams that rely heavily on external tooling. I'd be happy to contribute to the implementation if the team moves forward with this. Happy to help with prototyping the WIT interface design, building a reference extension, or whatever is most useful. |
Beta Was this translation helpful? Give feedback.
-
|
This type of feature really needs high priority. I would say the extension piece is the one feature that's keeping myself and other developers tethered to other IDEs like Cursor or VS Code. Developers need the ability to add custom user interfaces where it makes sense to their own workflows. I think this is a solid opportunity for Zed. One short coming with VS Code is that user interfaces really make the IDE look like a mash up of different tools. If Zed offered an opinionated UI API to be able to expose views that appear native to Zed that would be the best of both worlds. |
Beta Was this translation helpful? Give feedback.
-
|
if we wanted to get a small group together to work on this, what would it look like? |
Beta Was this translation helpful? Give feedback.
-
|
After reading several discussions and issues in this repository, unfortunately it seems that a robust extensions API is still not a clear priority for the Zed team. I currently rely heavily on JetBrains IDEs in my workflow, especially IntelliJ as my main IDE. However, I would seriously consider changing my workflow to Zed if there were better feature parity and, more importantly, a more powerful extension ecosystem. One of JetBrains’ biggest strengths is its SDK. It allows developers to build extensions that integrate deeply with the IDE, customize important parts of the UI, add tools, panels, actions, inspections, integrations, and support very specific workflows. In my opinion, the Zed team should reconsider its priorities in this area. Features focused on organizations, teams, or AI may be important, but they lose impact if the user base still cannot adapt the editor to real-world workflows. Before investing heavily in more advanced product layers, it may be more strategic to broaden adoption by building a strong extensibility foundation. A more complete extensions API would not just be another feature. It could be a decisive factor in attracting users who currently depend on IDEs like IntelliJ, VS Code, or other more mature tools. The more the community can extend Zed, the more likely the editor is to grow organically and support use cases that the core team will never be able to cover entirely on its own. |
Beta Was this translation helpful? Give feedback.
-
|
I’d love to build a JSONL preview extension and a SQLite viewer extension for Zed, so having a way to create custom UI feels like the essential first step. This feature would unlock a lot of practical extensions that currently require jumping back to VS Code or external tools. Really looking forward to this. I’ll keep following the discussions, and I’d be happy to help if there’s anything I can contribute. |
Beta Was this translation helpful? Give feedback.
-
|
Hey everyone, thanks for the enthusiasm and willingness to work on this — we really appreciate it! This is closely tied to our extensions roadmap, and something that needs to be driven by our team to make sure it's done in a coherent way. It's a significant undertaking and not something we're likely to get to in the near future, but it's very much on our radar as part of the bigger extensions story. We'll update this thread as things progress! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Body
RFC: Visual Extension API - Allow Extensions to Render GUI
Status: Draft
Author: Trong Nguyen
Related: #21400 (closed - unactionable), #48947 (discussion - open)
Willing to implement: Yes, I am willing to create a PR for this feature
1. Summary
Proposal to extend the Extension API to allow extensions to create and manage user interface components (GUI) within Zed, including sidebar panels, status bar items, and custom views.
Goals
Non-Goals (MVP)
2. Motivation
Problem
Currently, Zed's Extension API only supports "headless" features:
Consequences:
Use Cases
3. Design Principles
3.1 Constraints (Learning from VS Code)
VS Code allows extensions nearly full control, leading to:
Zed will take a different approach:
3.2 Architecture Overview
4. Proposed API (WIT Interface)
4.1 Panel Interface
4.2 Component System
4.3 Status Bar API
4.4 Extension Trait Update
5. Implementation Strategy
5.1 Phased Approach
Phase 1: Status Bar Items (MVP)
Phase 2: Simple Panels
Phase 3: Interactive Panels
Phase 4: Advanced Components
5.2 Technical Challenges
6. Security Considerations
6.1 Sandboxing
6.2 UI Safety
6.3 Performance Protection
7. Migration Path
For Extensions
8. Alternatives Considered
A. WebView-based (VS Code approach)
B. GPUI-based (this proposal)
C. React-like DSL
9. Impact Analysis
On Ecosystem
On Core Codebase
extension-ui(~2000-3000 lines)extension_host,workspace10. Implementation Commitment
I am willing to implement this feature. I have experience with:
I can start with a proof-of-concept PR for Phase 1 (Status Bar API) to demonstrate feasibility before committing to the full implementation.
11. References
Beta Was this translation helpful? Give feedback.
All reactions