Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Return impl IntoElement from Render::render trait
Nathan Sobo1b5c8b2b4a72
diff --git a/crates/activity_indicator2/src/activity_indicator.rs b/crates/activity_indicator2/src/activity_indicator.rsindex ffb11da21d4..4b990fa430c 100644--- a/crates/activity_indicator2/src/activity_indicator.rs+++ b/crates/activity_indicator2/src/activity_indicator.rs@@ -304,7 +304,7 @@ impl ActivityIndicator {impl EventEmitter<Event> for ActivityIndicator {}impl Render for ActivityIndicator {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let content = self.content_to_render(cx);let mut result = h_stack()diff --git a/crates/assistant2/src/assistant_panel.rs b/crates/assistant2/src/assistant_panel.rsindex b158facbd93..73b0afee8fc 100644--- a/crates/assistant2/src/assistant_panel.rs+++ b/crates/assistant2/src/assistant_panel.rs@@ -1101,7 +1101,7 @@ fn build_api_key_editor(cx: &mut ViewContext<AssistantPanel>) -> View<Editor> {}impl Render for AssistantPanel {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {if let Some(api_key_editor) = self.api_key_editor.clone() {v_stack().on_action(cx.listener(AssistantPanel::save_credentials))diff --git a/crates/auto_update2/src/update_notification.rs b/crates/auto_update2/src/update_notification.rsindex 009972b7ee9..f00172591ec 100644--- a/crates/auto_update2/src/update_notification.rs+++ b/crates/auto_update2/src/update_notification.rs@@ -1,5 +1,5 @@use gpui::{- div, DismissEvent, Element, EventEmitter, InteractiveElement, ParentElement, Render,+ div, DismissEvent, EventEmitter, InteractiveElement, IntoElement, ParentElement, Render,SemanticVersion, StatefulInteractiveElement, Styled, ViewContext,};use menu::Cancel;@@ -13,7 +13,7 @@ pub struct UpdateNotification {impl EventEmitter<DismissEvent> for UpdateNotification {}impl Render for UpdateNotification {- fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {let app_name = cx.global::<ReleaseChannel>().display_name();v_stack()diff --git a/crates/breadcrumbs2/src/breadcrumbs.rs b/crates/breadcrumbs2/src/breadcrumbs.rsindex fa9e330468b..2e4306f0bc2 100644--- a/crates/breadcrumbs2/src/breadcrumbs.rs+++ b/crates/breadcrumbs2/src/breadcrumbs.rs@@ -30,7 +30,7 @@ impl Breadcrumbs {impl EventEmitter<ToolbarItemEvent> for Breadcrumbs {}impl Render for Breadcrumbs {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let element = h_stack().text_ui();let Some(active_item) = self.active_item.as_ref() else {return element;diff --git a/crates/collab_ui2/src/channel_view.rs b/crates/collab_ui2/src/channel_view.rsindex 6674c2f056a..df2adbaabe9 100644--- a/crates/collab_ui2/src/channel_view.rs+++ b/crates/collab_ui2/src/channel_view.rs@@ -222,7 +222,7 @@ impl ChannelView {impl EventEmitter<EditorEvent> for ChannelView {}impl Render for ChannelView {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {self.editor.clone()}}diff --git a/crates/collab_ui2/src/chat_panel.rs b/crates/collab_ui2/src/chat_panel.rsindex 84bd855754d..30b33e54c21 100644--- a/crates/collab_ui2/src/chat_panel.rs+++ b/crates/collab_ui2/src/chat_panel.rs@@ -549,7 +549,7 @@ impl ChatPanel {impl EventEmitter<Event> for ChatPanel {}impl Render for ChatPanel {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {div().full().child(if self.client.user_id().is_some() {diff --git a/crates/collab_ui2/src/chat_panel/message_editor.rs b/crates/collab_ui2/src/chat_panel/message_editor.rsindex 1b52d6eed90..522db1042d4 100644--- a/crates/collab_ui2/src/chat_panel/message_editor.rs+++ b/crates/collab_ui2/src/chat_panel/message_editor.rs@@ -3,7 +3,7 @@ use client::UserId;use collections::HashMap;use editor::{AnchorRangeExt, Editor};use gpui::{- AsyncWindowContext, Element, FocusableView, Model, Render, SharedString, Task, View,+ AsyncWindowContext, FocusableView, IntoElement, Model, Render, SharedString, Task, View,ViewContext, WeakView,};use language::{language_settings::SoftWrap, Buffer, BufferSnapshot, LanguageRegistry};@@ -196,7 +196,7 @@ impl MessageEditor {}impl Render for MessageEditor {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {self.editor.to_any()}}diff --git a/crates/collab_ui2/src/collab_panel.rs b/crates/collab_ui2/src/collab_panel.rsindex 348dd8c4e83..a5c5755915c 100644--- a/crates/collab_ui2/src/collab_panel.rs+++ b/crates/collab_ui2/src/collab_panel.rs@@ -2265,7 +2265,7 @@ fn render_tree_branch(is_last: bool, cx: &mut WindowContext) -> impl IntoElement}impl Render for CollabPanel {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {v_stack().key_context("CollabPanel").on_action(cx.listener(CollabPanel::cancel))diff --git a/crates/collab_ui2/src/collab_panel/channel_modal.rs b/crates/collab_ui2/src/collab_panel/channel_modal.rsindex 2c659a55d0c..114e89f1c4d 100644--- a/crates/collab_ui2/src/collab_panel/channel_modal.rs+++ b/crates/collab_ui2/src/collab_panel/channel_modal.rs@@ -142,7 +142,7 @@ impl FocusableView for ChannelModal {}impl Render for ChannelModal {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let channel_store = self.channel_store.read(cx);let Some(channel) = channel_store.channel_for_id(self.channel_id) else {return div();diff --git a/crates/collab_ui2/src/collab_panel/contact_finder.rs b/crates/collab_ui2/src/collab_panel/contact_finder.rsindex cb916ba9618..dbcacef7d64 100644--- a/crates/collab_ui2/src/collab_panel/contact_finder.rs+++ b/crates/collab_ui2/src/collab_panel/contact_finder.rs@@ -35,7 +35,7 @@ impl ContactFinder {}impl Render for ContactFinder {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {v_stack().elevation_3(cx).child(diff --git a/crates/collab_ui2/src/collab_titlebar_item.rs b/crates/collab_ui2/src/collab_titlebar_item.rsindex 8d6f495ad58..60bb35a8d58 100644--- a/crates/collab_ui2/src/collab_titlebar_item.rs+++ b/crates/collab_ui2/src/collab_titlebar_item.rs@@ -56,7 +56,7 @@ pub struct CollabTitlebarItem {}impl Render for CollabTitlebarItem {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let room = ActiveCall::global(cx).read(cx).room().cloned();let current_user = self.user_store.read(cx).current_user();let client = self.client.clone();diff --git a/crates/collab_ui2/src/notification_panel.rs b/crates/collab_ui2/src/notification_panel.rsindex 68df41697fd..8ebc86b9962 100644--- a/crates/collab_ui2/src/notification_panel.rs+++ b/crates/collab_ui2/src/notification_panel.rs@@ -540,7 +540,7 @@ impl NotificationPanel {}impl Render for NotificationPanel {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {v_stack().size_full().child(@@ -704,7 +704,7 @@ impl NotificationToast {}impl Render for NotificationToast {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let user = self.actor.clone();h_stack()diff --git a/crates/collab_ui2/src/notifications/incoming_call_notification.rs b/crates/collab_ui2/src/notifications/incoming_call_notification.rsindex dab33328cd7..fa28ef9a603 100644--- a/crates/collab_ui2/src/notifications/incoming_call_notification.rs+++ b/crates/collab_ui2/src/notifications/incoming_call_notification.rs@@ -117,7 +117,7 @@ impl IncomingCallNotification {}impl Render for IncomingCallNotification {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {// TODO: Is there a better place for us to initialize the font?let (ui_font, ui_font_size) = {let theme_settings = ThemeSettings::get_global(cx);diff --git a/crates/collab_ui2/src/notifications/project_shared_notification.rs b/crates/collab_ui2/src/notifications/project_shared_notification.rsindex 3be50515e8f..982214c3e59 100644--- a/crates/collab_ui2/src/notifications/project_shared_notification.rs+++ b/crates/collab_ui2/src/notifications/project_shared_notification.rs@@ -118,7 +118,7 @@ impl ProjectSharedNotification {}impl Render for ProjectSharedNotification {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {// TODO: Is there a better place for us to initialize the font?let (ui_font, ui_font_size) = {let theme_settings = ThemeSettings::get_global(cx);diff --git a/crates/command_palette2/src/command_palette.rs b/crates/command_palette2/src/command_palette.rsindex 5d069967bab..b7a1dbfd3dd 100644--- a/crates/command_palette2/src/command_palette.rs+++ b/crates/command_palette2/src/command_palette.rs@@ -83,7 +83,7 @@ impl FocusableView for CommandPalette {}impl Render for CommandPalette {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {v_stack().w(rems(34.)).child(self.picker.clone())}}diff --git a/crates/copilot2/src/sign_in.rs b/crates/copilot2/src/sign_in.rsindex cef87d63a11..ba5dbe0e315 100644--- a/crates/copilot2/src/sign_in.rs+++ b/crates/copilot2/src/sign_in.rs@@ -181,7 +181,7 @@ impl CopilotCodeVerification {}impl Render for CopilotCodeVerification {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let prompt = match &self.status {Status::SigningIn {prompt: Some(prompt),diff --git a/crates/copilot_button2/src/copilot_button.rs b/crates/copilot_button2/src/copilot_button.rsindex 06cacb0b076..60b25fee12a 100644--- a/crates/copilot_button2/src/copilot_button.rs+++ b/crates/copilot_button2/src/copilot_button.rs@@ -3,7 +3,7 @@ use copilot::{Copilot, SignOut, Status};use editor::{scroll::autoscroll::Autoscroll, Editor};use fs::Fs;use gpui::{- div, Action, AnchorCorner, AppContext, AsyncWindowContext, Element, Entity, ParentElement,+ div, Action, AnchorCorner, AppContext, AsyncWindowContext, Entity, IntoElement, ParentElement,Render, Subscription, View, ViewContext, WeakView, WindowContext,};use language::{@@ -34,7 +34,7 @@ pub struct CopilotButton {}impl Render for CopilotButton {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let all_language_settings = all_language_settings(None, cx);if !all_language_settings.copilot.feature_enabled {return div();diff --git a/crates/diagnostics2/src/items.rs b/crates/diagnostics2/src/items.rsindex 959cf14fdbf..9f7be0c04f2 100644--- a/crates/diagnostics2/src/items.rs+++ b/crates/diagnostics2/src/items.rs@@ -21,7 +21,7 @@ pub struct DiagnosticIndicator {}impl Render for DiagnosticIndicator {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let diagnostic_indicator = match (self.summary.error_count, self.summary.warning_count) {(0, 0) => h_stack().child(IconElement::new(Icon::Check)diff --git a/crates/diagnostics2/src/toolbar_controls.rs b/crates/diagnostics2/src/toolbar_controls.rsindex 0dc17f9320c..897e2ccf40f 100644--- a/crates/diagnostics2/src/toolbar_controls.rs+++ b/crates/diagnostics2/src/toolbar_controls.rs@@ -9,7 +9,7 @@ pub struct ToolbarControls {}impl Render for ToolbarControls {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let include_warnings = self.editor.as_ref()diff --git a/crates/editor2/src/editor.rs b/crates/editor2/src/editor.rsindex dac291b468f..a84d1e50d28 100644--- a/crates/editor2/src/editor.rs+++ b/crates/editor2/src/editor.rs@@ -9291,7 +9291,7 @@ impl FocusableView for Editor {}impl Render for Editor {- fn render<'a>(&mut self, cx: &mut ViewContext<'a, Self>) -> impl 'static + Element {+ fn render<'a>(&mut self, cx: &mut ViewContext<'a, Self>) -> impl IntoElement {let settings = ThemeSettings::get_global(cx);let text_style = match self.mode {EditorMode::SingleLine | EditorMode::AutoHeight { .. } => TextStyle {diff --git a/crates/editor2/src/items.rs b/crates/editor2/src/items.rsindex f72915492f5..31c4e24659f 100644--- a/crates/editor2/src/items.rs+++ b/crates/editor2/src/items.rs@@ -1193,7 +1193,7 @@ impl CursorPosition {}impl Render for CursorPosition {- fn render(&mut self, _: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _: &mut ViewContext<Self>) -> impl IntoElement {div().when_some(self.position, |el, position| {let mut text = format!("{}{FILE_ROW_COLUMN_DELIMITER}{}",diff --git a/crates/feedback2/src/deploy_feedback_button.rs b/crates/feedback2/src/deploy_feedback_button.rsindex 0e0dae30ff4..a02540bc5b3 100644--- a/crates/feedback2/src/deploy_feedback_button.rs+++ b/crates/feedback2/src/deploy_feedback_button.rs@@ -17,7 +17,7 @@ impl DeployFeedbackButton {}impl Render for DeployFeedbackButton {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let is_open = self.workspace.upgrade()diff --git a/crates/feedback2/src/feedback_modal.rs b/crates/feedback2/src/feedback_modal.rsindex c8bb7b86673..0f5b26eae99 100644--- a/crates/feedback2/src/feedback_modal.rs+++ b/crates/feedback2/src/feedback_modal.rs@@ -396,7 +396,7 @@ impl FeedbackModal {}impl Render for FeedbackModal {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {self.update_submission_state(cx);let submit_button_text = if self.awaiting_submission() {diff --git a/crates/file_finder2/src/file_finder.rs b/crates/file_finder2/src/file_finder.rsindex 88ebd6331c7..589f634d01b 100644--- a/crates/file_finder2/src/file_finder.rs+++ b/crates/file_finder2/src/file_finder.rs@@ -118,7 +118,7 @@ impl FocusableView for FileFinder {}}impl Render for FileFinder {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {v_stack().w(rems(34.)).child(self.picker.clone())}}diff --git a/crates/go_to_line2/src/go_to_line.rs b/crates/go_to_line2/src/go_to_line.rsindex 4845c930687..ec58cbdc605 100644--- a/crates/go_to_line2/src/go_to_line.rs+++ b/crates/go_to_line2/src/go_to_line.rs@@ -152,7 +152,7 @@ impl GoToLine {}impl Render for GoToLine {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {div().elevation_2(cx).key_context("GoToLine")diff --git a/crates/gpui2/src/app/test_context.rs b/crates/gpui2/src/app/test_context.rsindex e5bb6e73e1c..44f303ac0be 100644--- a/crates/gpui2/src/app/test_context.rs+++ b/crates/gpui2/src/app/test_context.rs@@ -1,7 +1,7 @@use crate::{div, Action, AnyView, AnyWindowHandle, AppCell, AppContext, AsyncAppContext,- BackgroundExecutor, Bounds, ClipboardItem, Context, Element, Entity, EventEmitter,- ForegroundExecutor, InputEvent, KeyDownEvent, Keystroke, Model, ModelContext, Pixels, Platform,+ BackgroundExecutor, Bounds, ClipboardItem, Context, Entity, EventEmitter, ForegroundExecutor,+ InputEvent, IntoElement, KeyDownEvent, Keystroke, Model, ModelContext, Pixels, Platform,PlatformWindow, Point, Render, Result, Size, Task, TestDispatcher, TestPlatform, TestWindow,TestWindowHandlers, TextSystem, View, ViewContext, VisualContext, WindowBounds, WindowContext,WindowHandle, WindowOptions,@@ -731,7 +731,7 @@ impl AnyWindowHandle {pub struct EmptyView {}impl Render for EmptyView {- fn render(&mut self, _cx: &mut crate::ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut crate::ViewContext<Self>) -> impl IntoElement {div()}}diff --git a/crates/gpui2/src/element.rs b/crates/gpui2/src/element.rsindex 0d426ad4389..3c310e10ffa 100644--- a/crates/gpui2/src/element.rs+++ b/crates/gpui2/src/element.rs@@ -107,7 +107,7 @@ pub trait IntoElement: Sized {}pub trait Render: 'static + Sized {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element;+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement;}/// You can derive [IntoElement] on any type that implements this trait.diff --git a/crates/gpui2/src/interactive.rs b/crates/gpui2/src/interactive.rsindex 263b5658cde..a9cbaa7fcf5 100644--- a/crates/gpui2/src/interactive.rs+++ b/crates/gpui2/src/interactive.rs@@ -205,7 +205,7 @@ impl ExternalPaths {}impl Render for ExternalPaths {- fn render(&mut self, _: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _: &mut ViewContext<Self>) -> impl IntoElement {div() // Intentionally left empty because the platform will render icons for the dragged files}}diff --git a/crates/language_selector2/src/active_buffer_language.rs b/crates/language_selector2/src/active_buffer_language.rsindex 434a6c44206..d5f177f7d61 100644--- a/crates/language_selector2/src/active_buffer_language.rs+++ b/crates/language_selector2/src/active_buffer_language.rs@@ -1,7 +1,5 @@use editor::Editor;-use gpui::{- div, Element, IntoElement, ParentElement, Render, Subscription, View, ViewContext, WeakView,-};+use gpui::{div, IntoElement, ParentElement, Render, Subscription, View, ViewContext, WeakView};use std::sync::Arc;use ui::{Button, ButtonCommon, Clickable, LabelSize, Tooltip};use workspace::{item::ItemHandle, StatusItemView, Workspace};@@ -38,7 +36,7 @@ impl ActiveBufferLanguage {}impl Render for ActiveBufferLanguage {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {div().when_some(self.active_language.as_ref(), |el, active_language| {let active_language_text = if let Some(active_language_text) = active_language {active_language_text.to_string()diff --git a/crates/language_selector2/src/language_selector.rs b/crates/language_selector2/src/language_selector.rsindex 8343cef03f5..33b2e481263 100644--- a/crates/language_selector2/src/language_selector.rs+++ b/crates/language_selector2/src/language_selector.rs@@ -67,7 +67,7 @@ impl LanguageSelector {}impl Render for LanguageSelector {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {v_stack().w(rems(34.)).child(self.picker.clone())}}diff --git a/crates/language_tools2/src/lsp_log.rs b/crates/language_tools2/src/lsp_log.rsindex 13a2eab30c9..e38de7d3734 100644--- a/crates/language_tools2/src/lsp_log.rs+++ b/crates/language_tools2/src/lsp_log.rs@@ -2,9 +2,9 @@ use collections::{HashMap, VecDeque};use editor::{Editor, EditorEvent, MoveToEnd};use futures::{channel::mpsc, StreamExt};use gpui::{- actions, div, AnchorCorner, AnyElement, AppContext, Context, Element, EventEmitter,- FocusHandle, FocusableView, IntoElement, Model, ModelContext, ParentElement, Render, Styled,- Subscription, View, ViewContext, VisualContext, WeakModel, WindowContext,+ actions, div, AnchorCorner, AnyElement, AppContext, Context, EventEmitter, FocusHandle,+ FocusableView, IntoElement, Model, ModelContext, ParentElement, Render, Styled, Subscription,+ View, ViewContext, VisualContext, WeakModel, WindowContext,};use language::{LanguageServerId, LanguageServerName};use lsp::IoKind;@@ -595,9 +595,9 @@ fn log_contents(lines: &VecDeque<String>) -> String {}impl Render for LspLogView {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {self.editor- .update(cx, |editor, cx| editor.render(cx).into_any())+ .update(cx, |editor, cx| editor.render(cx).into_any_element())}}@@ -708,7 +708,7 @@ impl ToolbarItemView for LspLogToolbarItemView {}impl Render for LspLogToolbarItemView {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let Some(log_view) = self.log_view.clone() else {return div();};diff --git a/crates/language_tools2/src/syntax_tree_view.rs b/crates/language_tools2/src/syntax_tree_view.rsindex 20d6b6c82ab..a36264261e8 100644--- a/crates/language_tools2/src/syntax_tree_view.rs+++ b/crates/language_tools2/src/syntax_tree_view.rs@@ -1,6 +1,6 @@use editor::{scroll::autoscroll::Autoscroll, Anchor, Editor, ExcerptId};use gpui::{- actions, canvas, div, rems, uniform_list, AnyElement, AppContext, AvailableSpace, Div, Element,+ actions, canvas, div, rems, uniform_list, AnyElement, AppContext, AvailableSpace, Div,EventEmitter, FocusHandle, FocusableView, Hsla, InteractiveElement, IntoElement, Model,MouseButton, MouseDownEvent, MouseMoveEvent, ParentElement, Pixels, Render, Styled,UniformListScrollHandle, View, ViewContext, VisualContext, WeakView, WindowContext,@@ -305,7 +305,7 @@ impl SyntaxTreeView {}impl Render for SyntaxTreeView {- fn render(&mut self, cx: &mut gpui::ViewContext<'_, Self>) -> impl Element {+ fn render(&mut self, cx: &mut gpui::ViewContext<'_, Self>) -> impl IntoElement {let settings = ThemeSettings::get_global(cx);let line_height = cx.text_style()@@ -505,7 +505,7 @@ fn format_node_range(node: Node) -> String {}impl Render for SyntaxTreeToolbarItemView {- fn render(&mut self, cx: &mut ViewContext<'_, Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<'_, Self>) -> impl IntoElement {self.render_menu(cx).unwrap_or_else(|| popover_menu("Empty Syntax Tree"))}diff --git a/crates/outline2/src/outline.rs b/crates/outline2/src/outline.rsindex e33d22c9edf..75d1a093573 100644--- a/crates/outline2/src/outline.rs+++ b/crates/outline2/src/outline.rs@@ -57,7 +57,7 @@ impl EventEmitter<DismissEvent> for OutlineView {}impl ModalView for OutlineView {}impl Render for OutlineView {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {v_stack().w(rems(34.)).child(self.picker.clone())}}diff --git a/crates/picker2/src/picker2.rs b/crates/picker2/src/picker2.rsindex cee8fb74ff9..ad755205205 100644--- a/crates/picker2/src/picker2.rs+++ b/crates/picker2/src/picker2.rs@@ -235,7 +235,7 @@ impl<D: PickerDelegate> EventEmitter<DismissEvent> for Picker<D> {}impl<D: PickerDelegate> ModalView for Picker<D> {}impl<D: PickerDelegate> Render for Picker<D> {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let picker_editor = h_stack().overflow_hidden().flex_none()diff --git a/crates/project_panel2/src/project_panel.rs b/crates/project_panel2/src/project_panel.rsindex 7f743015f1a..7ac9006c873 100644--- a/crates/project_panel2/src/project_panel.rs+++ b/crates/project_panel2/src/project_panel.rs@@ -1480,7 +1480,7 @@ impl ProjectPanel {}impl Render for ProjectPanel {- fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {let has_worktree = self.visible_entries.len() != 0;if has_worktree {diff --git a/crates/quick_action_bar2/src/quick_action_bar.rs b/crates/quick_action_bar2/src/quick_action_bar.rsindex 44ca0150e85..85c0b58556d 100644--- a/crates/quick_action_bar2/src/quick_action_bar.rs+++ b/crates/quick_action_bar2/src/quick_action_bar.rs@@ -36,7 +36,7 @@ impl QuickActionBar {}impl Render for QuickActionBar {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let Some(editor) = self.active_editor() else {return div().id("empty quick action bar");};diff --git a/crates/recent_projects2/src/recent_projects.rs b/crates/recent_projects2/src/recent_projects.rsindex 4aded62ddf9..c3b2c21d522 100644--- a/crates/recent_projects2/src/recent_projects.rs+++ b/crates/recent_projects2/src/recent_projects.rs@@ -103,7 +103,7 @@ impl FocusableView for RecentProjects {}impl Render for RecentProjects {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {v_stack().w(rems(self.rem_width)).child(self.picker.clone())diff --git a/crates/search2/src/buffer_search.rs b/crates/search2/src/buffer_search.rsindex 96b40aa2bfc..f17fdb02171 100644--- a/crates/search2/src/buffer_search.rs+++ b/crates/search2/src/buffer_search.rs@@ -101,7 +101,7 @@ impl BufferSearchBar {impl EventEmitter<Event> for BufferSearchBar {}impl EventEmitter<workspace::ToolbarItemEvent> for BufferSearchBar {}impl Render for BufferSearchBar {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {if self.dismissed {return div();}diff --git a/crates/search2/src/project_search.rs b/crates/search2/src/project_search.rsindex da0c9a4ca56..9a91d619a43 100644--- a/crates/search2/src/project_search.rs+++ b/crates/search2/src/project_search.rs@@ -279,7 +279,7 @@ pub enum ViewEvent {impl EventEmitter<ViewEvent> for ProjectSearchView {}impl Render for ProjectSearchView {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {if self.has_matches() {div().flex_1()@@ -1548,7 +1548,7 @@ impl ProjectSearchBar {}impl Render for ProjectSearchBar {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let Some(search) = self.active_project_search.clone() else {return div();};diff --git a/crates/storybook2/src/stories/auto_height_editor.rs b/crates/storybook2/src/stories/auto_height_editor.rsindex a98050230b7..6d835155621 100644--- a/crates/storybook2/src/stories/auto_height_editor.rs+++ b/crates/storybook2/src/stories/auto_height_editor.rs@@ -1,6 +1,6 @@use editor::Editor;use gpui::{- div, white, Element, KeyBinding, ParentElement, Render, Styled, View, ViewContext,+ div, white, IntoElement, KeyBinding, ParentElement, Render, Styled, View, ViewContext,VisualContext, WindowContext,};@@ -22,7 +22,7 @@ impl AutoHeightEditorStory {}impl Render for AutoHeightEditorStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {div().size_full().bg(white())diff --git a/crates/storybook2/src/stories/cursor.rs b/crates/storybook2/src/stories/cursor.rsindex ebd4d2d8e96..834371bd87a 100644--- a/crates/storybook2/src/stories/cursor.rs+++ b/crates/storybook2/src/stories/cursor.rs@@ -5,7 +5,7 @@ use ui::prelude::*;pub struct CursorStory;impl Render for CursorStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {let all_cursors: [(&str, Box<dyn Fn(Stateful<Div>) -> Stateful<Div>>); 19] = [("cursor_default",diff --git a/crates/storybook2/src/stories/focus.rs b/crates/storybook2/src/stories/focus.rsindex ead6f701f95..4240aa6fd19 100644--- a/crates/storybook2/src/stories/focus.rs+++ b/crates/storybook2/src/stories/focus.rs@@ -56,7 +56,7 @@ impl FocusStory {}impl Render for FocusStory {- fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {let theme = cx.theme();let color_1 = theme.status().created;let color_2 = theme.status().modified;diff --git a/crates/storybook2/src/stories/kitchen_sink.rs b/crates/storybook2/src/stories/kitchen_sink.rsindex 97d46a2a748..1966b9ffa83 100644--- a/crates/storybook2/src/stories/kitchen_sink.rs+++ b/crates/storybook2/src/stories/kitchen_sink.rs@@ -14,7 +14,7 @@ impl KitchenSinkStory {}impl Render for KitchenSinkStory {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let component_stories = ComponentStory::iter().map(|selector| selector.story(cx)).collect::<Vec<_>>();diff --git a/crates/storybook2/src/stories/overflow_scroll.rs b/crates/storybook2/src/stories/overflow_scroll.rsindex bdd405eccf5..32ab940be5d 100644--- a/crates/storybook2/src/stories/overflow_scroll.rs+++ b/crates/storybook2/src/stories/overflow_scroll.rs@@ -6,7 +6,7 @@ use ui::prelude::*;pub struct OverflowScrollStory;impl Render for OverflowScrollStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {Story::container().child(Story::title("Overflow Scroll")).child(Story::label("`overflow_x_scroll`"))diff --git a/crates/storybook2/src/stories/picker.rs b/crates/storybook2/src/stories/picker.rsindex 3ad04002b84..515c967ae5a 100644--- a/crates/storybook2/src/stories/picker.rs+++ b/crates/storybook2/src/stories/picker.rs@@ -200,7 +200,7 @@ impl PickerStory {}impl Render for PickerStory {- fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {div().bg(cx.theme().styles.colors.background).size_full()diff --git a/crates/storybook2/src/stories/scroll.rs b/crates/storybook2/src/stories/scroll.rsindex a5f6c484c91..a0318dc30ea 100644--- a/crates/storybook2/src/stories/scroll.rs+++ b/crates/storybook2/src/stories/scroll.rs@@ -11,7 +11,7 @@ impl ScrollStory {}impl Render for ScrollStory {- fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {let theme = cx.theme();let color_1 = theme.status().created;let color_2 = theme.status().modified;diff --git a/crates/storybook2/src/stories/text.rs b/crates/storybook2/src/stories/text.rsindex 49c10d6729d..8bf35b04f29 100644--- a/crates/storybook2/src/stories/text.rs+++ b/crates/storybook2/src/stories/text.rs@@ -1,6 +1,6 @@use gpui::{- div, green, red, Element, HighlightStyle, InteractiveText, IntoElement, ParentElement, Render,- Styled, StyledText, View, VisualContext, WindowContext,+ div, green, red, HighlightStyle, InteractiveText, IntoElement, ParentElement, Render, Styled,+ StyledText, View, VisualContext, WindowContext,};use indoc::indoc;use story::*;@@ -14,7 +14,7 @@ impl TextStory {}impl Render for TextStory {- fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {StoryContainer::new("Text Story", "crates/storybook2/src/stories/text.rs").children(vec![diff --git a/crates/storybook2/src/stories/viewport_units.rs b/crates/storybook2/src/stories/viewport_units.rsindex edd0a730605..30782a1a161 100644--- a/crates/storybook2/src/stories/viewport_units.rs+++ b/crates/storybook2/src/stories/viewport_units.rs@@ -6,7 +6,7 @@ use ui::prelude::*;pub struct ViewportUnitsStory;impl Render for ViewportUnitsStory {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {Story::container().child(div().flex()diff --git a/crates/storybook2/src/stories/z_index.rs b/crates/storybook2/src/stories/z_index.rsindex 4ae6279d75e..b18cc4cb57a 100644--- a/crates/storybook2/src/stories/z_index.rs+++ b/crates/storybook2/src/stories/z_index.rs@@ -7,7 +7,7 @@ use ui::prelude::*;pub struct ZIndexStory;impl Render for ZIndexStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {Story::container().child(Story::title("z-index")).child(div().flex()diff --git a/crates/storybook2/src/storybook2.rs b/crates/storybook2/src/storybook2.rsindex 1b9ddd4b960..cbbe97f57fb 100644--- a/crates/storybook2/src/storybook2.rs+++ b/crates/storybook2/src/storybook2.rs@@ -113,7 +113,7 @@ impl StoryWrapper {}impl Render for StoryWrapper {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {div().flex().flex_col()diff --git a/crates/terminal_view2/src/terminal_panel.rs b/crates/terminal_view2/src/terminal_panel.rsindex d228e9e48d4..0b1f19126ed 100644--- a/crates/terminal_view2/src/terminal_panel.rs+++ b/crates/terminal_view2/src/terminal_panel.rs@@ -3,9 +3,9 @@ use std::{path::PathBuf, sync::Arc};use crate::TerminalView;use db::kvp::KEY_VALUE_STORE;use gpui::{- actions, div, serde_json, AppContext, AsyncWindowContext, Element, Entity, EventEmitter,- ExternalPaths, FocusHandle, FocusableView, IntoElement, ParentElement, Pixels, Render, Styled,- Subscription, Task, View, ViewContext, VisualContext, WeakView, WindowContext,+ actions, div, serde_json, AppContext, AsyncWindowContext, Entity, EventEmitter, ExternalPaths,+ FocusHandle, FocusableView, IntoElement, ParentElement, Pixels, Render, Styled, Subscription,+ Task, View, ViewContext, VisualContext, WeakView, WindowContext,};use project::Fs;use serde::{Deserialize, Serialize};@@ -329,7 +329,7 @@ impl TerminalPanel {impl EventEmitter<PanelEvent> for TerminalPanel {}impl Render for TerminalPanel {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {div().size_full().child(self.pane.clone())}}diff --git a/crates/terminal_view2/src/terminal_view.rs b/crates/terminal_view2/src/terminal_view.rsindex 46409d1102d..d4dea29b49e 100644--- a/crates/terminal_view2/src/terminal_view.rs+++ b/crates/terminal_view2/src/terminal_view.rs@@ -617,7 +617,7 @@ impl TerminalView {}impl Render for TerminalView {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let terminal_handle = self.terminal.clone();let focused = self.focus_handle.is_focused(cx);diff --git a/crates/theme_selector2/src/theme_selector.rs b/crates/theme_selector2/src/theme_selector.rsindex 075b12fc187..030c240e02c 100644--- a/crates/theme_selector2/src/theme_selector.rs+++ b/crates/theme_selector2/src/theme_selector.rs@@ -67,7 +67,7 @@ impl FocusableView for ThemeSelector {}impl Render for ThemeSelector {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {v_stack().w(rems(34.)).child(self.picker.clone())}}diff --git a/crates/ui2/src/components/context_menu.rs b/crates/ui2/src/components/context_menu.rsindex a529dd1995a..63d01d7e069 100644--- a/crates/ui2/src/components/context_menu.rs+++ b/crates/ui2/src/components/context_menu.rs@@ -232,7 +232,7 @@ impl ContextMenuItem {}impl Render for ContextMenu {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {div().elevation_2(cx).flex().flex_row().child(v_stack().min_w(px(200.))diff --git a/crates/ui2/src/components/stories/avatar.rs b/crates/ui2/src/components/stories/avatar.rsindex 99e370993a9..e447486d69c 100644--- a/crates/ui2/src/components/stories/avatar.rs+++ b/crates/ui2/src/components/stories/avatar.rs@@ -7,7 +7,7 @@ use crate::Avatar;pub struct AvatarStory;impl Render for AvatarStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {Story::container().child(Story::title_for::<Avatar>()).child(Story::label("Default"))diff --git a/crates/ui2/src/components/stories/button.rs b/crates/ui2/src/components/stories/button.rsindex 4ab8c33c8e9..7240812fa5a 100644--- a/crates/ui2/src/components/stories/button.rs+++ b/crates/ui2/src/components/stories/button.rs@@ -7,7 +7,7 @@ use crate::{Button, ButtonStyle};pub struct ButtonStory;impl Render for ButtonStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {Story::container().child(Story::title_for::<Button>()).child(Story::label("Default"))diff --git a/crates/ui2/src/components/stories/checkbox.rs b/crates/ui2/src/components/stories/checkbox.rsindex b94005f8246..a064c673935 100644--- a/crates/ui2/src/components/stories/checkbox.rs+++ b/crates/ui2/src/components/stories/checkbox.rs@@ -7,7 +7,7 @@ use crate::{h_stack, Checkbox};pub struct CheckboxStory;impl Render for CheckboxStory {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {Story::container().child(Story::title_for::<Checkbox>()).child(Story::label("Default"))diff --git a/crates/ui2/src/components/stories/context_menu.rs b/crates/ui2/src/components/stories/context_menu.rsindex b316714a515..e7218a68672 100644--- a/crates/ui2/src/components/stories/context_menu.rs+++ b/crates/ui2/src/components/stories/context_menu.rs@@ -20,7 +20,7 @@ fn build_menu(cx: &mut WindowContext, header: impl Into<SharedString>) -> View<Cpub struct ContextMenuStory;impl Render for ContextMenuStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {Story::container().on_action(|_: &PrintCurrentDate, _| {println!("printing unix time!");diff --git a/crates/ui2/src/components/stories/disclosure.rs b/crates/ui2/src/components/stories/disclosure.rsindex c8a6ced64be..aa605cabfa4 100644--- a/crates/ui2/src/components/stories/disclosure.rs+++ b/crates/ui2/src/components/stories/disclosure.rs@@ -7,7 +7,7 @@ use crate::Disclosure;pub struct DisclosureStory;impl Render for DisclosureStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {Story::container().child(Story::title_for::<Disclosure>()).child(Story::label("Toggled"))diff --git a/crates/ui2/src/components/stories/icon.rs b/crates/ui2/src/components/stories/icon.rsindex 35e5b223389..83fc5980dd7 100644--- a/crates/ui2/src/components/stories/icon.rs+++ b/crates/ui2/src/components/stories/icon.rs@@ -8,7 +8,7 @@ use crate::{Icon, IconElement};pub struct IconStory;impl Render for IconStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {let icons = Icon::iter();Story::container()diff --git a/crates/ui2/src/components/stories/icon_button.rs b/crates/ui2/src/components/stories/icon_button.rsindex bac3a3e0834..66fc4affb3b 100644--- a/crates/ui2/src/components/stories/icon_button.rs+++ b/crates/ui2/src/components/stories/icon_button.rs@@ -7,7 +7,7 @@ use crate::{Icon, IconButton};pub struct IconButtonStory;impl Render for IconButtonStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {let default_button = StoryItem::new("Default",IconButton::new("default_icon_button", Icon::Hash),diff --git a/crates/ui2/src/components/stories/keybinding.rs b/crates/ui2/src/components/stories/keybinding.rsindex 791d0eb122b..980a57d7daf 100644--- a/crates/ui2/src/components/stories/keybinding.rs+++ b/crates/ui2/src/components/stories/keybinding.rs@@ -13,7 +13,7 @@ pub fn binding(key: &str) -> gpui::KeyBinding {}impl Render for KeybindingStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {let all_modifier_permutations = ["ctrl", "alt", "cmd", "shift"].into_iter().permutations(2);Story::container()diff --git a/crates/ui2/src/components/stories/label.rs b/crates/ui2/src/components/stories/label.rsindex 9e0fce2839e..967512d8985 100644--- a/crates/ui2/src/components/stories/label.rs+++ b/crates/ui2/src/components/stories/label.rs@@ -5,7 +5,7 @@ use story::Story;pub struct LabelStory;impl Render for LabelStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {Story::container().child(Story::title_for::<Label>()).child(Story::label("Default"))diff --git a/crates/ui2/src/components/stories/list.rs b/crates/ui2/src/components/stories/list.rsindex b6b255dfce3..4ff0224f229 100644--- a/crates/ui2/src/components/stories/list.rs+++ b/crates/ui2/src/components/stories/list.rs@@ -7,7 +7,7 @@ use crate::{List, ListItem};pub struct ListStory;impl Render for ListStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {Story::container().child(Story::title_for::<List>()).child(Story::label("Default"))diff --git a/crates/ui2/src/components/stories/list_header.rs b/crates/ui2/src/components/stories/list_header.rsindex 154407be9bc..ffbf7157f5b 100644--- a/crates/ui2/src/components/stories/list_header.rs+++ b/crates/ui2/src/components/stories/list_header.rs@@ -7,7 +7,7 @@ use crate::{Icon, ListHeader};pub struct ListHeaderStory;impl Render for ListHeaderStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {Story::container().child(Story::title_for::<ListHeader>()).child(Story::label("Default"))diff --git a/crates/ui2/src/components/stories/list_item.rs b/crates/ui2/src/components/stories/list_item.rsindex e867e154001..b3ff096d9df 100644--- a/crates/ui2/src/components/stories/list_item.rs+++ b/crates/ui2/src/components/stories/list_item.rs@@ -7,7 +7,7 @@ use crate::{Icon, ListItem};pub struct ListItemStory;impl Render for ListItemStory {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {Story::container().bg(cx.theme().colors().background).child(Story::title_for::<ListItem>())diff --git a/crates/ui2/src/components/stories/tab.rs b/crates/ui2/src/components/stories/tab.rsindex 6ba06015eaa..4c63e593aaa 100644--- a/crates/ui2/src/components/stories/tab.rs+++ b/crates/ui2/src/components/stories/tab.rs@@ -9,7 +9,7 @@ use crate::{Indicator, Tab};pub struct TabStory;impl Render for TabStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {Story::container().child(Story::title_for::<Tab>()).child(Story::label("Default"))diff --git a/crates/ui2/src/components/stories/tab_bar.rs b/crates/ui2/src/components/stories/tab_bar.rsindex 75f5bef2e25..805725315c6 100644--- a/crates/ui2/src/components/stories/tab_bar.rs+++ b/crates/ui2/src/components/stories/tab_bar.rs@@ -6,7 +6,7 @@ use crate::{prelude::*, Tab, TabBar, TabPosition};pub struct TabBarStory;impl Render for TabBarStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {let tab_count = 20;let selected_tab_index = 3;diff --git a/crates/ui2/src/components/stories/toggle_button.rs b/crates/ui2/src/components/stories/toggle_button.rsindex 441f91e380d..518165345ca 100644--- a/crates/ui2/src/components/stories/toggle_button.rs+++ b/crates/ui2/src/components/stories/toggle_button.rs@@ -6,7 +6,7 @@ use crate::{prelude::*, ToggleButton};pub struct ToggleButtonStory;impl Render for ToggleButtonStory {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {StoryContainer::new("Toggle Button","crates/ui2/src/components/stories/toggle_button.rs",diff --git a/crates/ui2/src/components/tooltip.rs b/crates/ui2/src/components/tooltip.rsindex 56098718d82..77fd8d6c0b1 100644--- a/crates/ui2/src/components/tooltip.rs+++ b/crates/ui2/src/components/tooltip.rs@@ -68,7 +68,7 @@ impl Tooltip {}impl Render for Tooltip {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let ui_font = ThemeSettings::get_global(cx).ui_font.family.clone();overlay().child(// padding to avoid mouse cursordiff --git a/crates/vcs_menu2/src/lib.rs b/crates/vcs_menu2/src/lib.rsindex 3ef82ee4135..2735f81677c 100644--- a/crates/vcs_menu2/src/lib.rs+++ b/crates/vcs_menu2/src/lib.rs@@ -65,7 +65,7 @@ impl FocusableView for BranchList {}impl Render for BranchList {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {v_stack().w(rems(self.rem_width)).child(self.picker.clone())diff --git a/crates/vim2/src/mode_indicator.rs b/crates/vim2/src/mode_indicator.rsindex bc55296d61c..4cd8e669009 100644--- a/crates/vim2/src/mode_indicator.rs+++ b/crates/vim2/src/mode_indicator.rs@@ -47,7 +47,7 @@ impl ModeIndicator {}impl Render for ModeIndicator {- fn render(&mut self, _: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _: &mut ViewContext<Self>) -> impl IntoElement {let Some(mode) = self.mode.as_ref() else {return div().into_any();};diff --git a/crates/welcome2/src/base_keymap_picker.rs b/crates/welcome2/src/base_keymap_picker.rsindex 82b997547c0..9a8edf0eb33 100644--- a/crates/welcome2/src/base_keymap_picker.rs+++ b/crates/welcome2/src/base_keymap_picker.rs@@ -64,7 +64,7 @@ impl BaseKeymapSelector {}impl Render for BaseKeymapSelector {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {self.picker.clone()}}diff --git a/crates/welcome2/src/welcome.rs b/crates/welcome2/src/welcome.rsindex 5abb807f429..4839f9791a7 100644--- a/crates/welcome2/src/welcome.rs+++ b/crates/welcome2/src/welcome.rs@@ -58,7 +58,7 @@ pub struct WelcomePage {}impl Render for WelcomePage {- fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {h_stack().full().track_focus(&self.focus_handle).child(v_stack().w_96()diff --git a/crates/workspace2/src/dock.rs b/crates/workspace2/src/dock.rsindex 3d853cdee18..22e5ee36422 100644--- a/crates/workspace2/src/dock.rs+++ b/crates/workspace2/src/dock.rs@@ -505,7 +505,7 @@ impl Dock {}impl Render for Dock {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {if let Some(entry) = self.visible_entry() {let size = entry.panel.size(cx);@@ -592,7 +592,7 @@ impl PanelButtons {}impl Render for PanelButtons {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {// todo!()let dock = self.dock.read(cx);let active_index = dock.active_panel_index;@@ -713,7 +713,7 @@ pub mod test {}impl Render for TestPanel {- fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {div()}}diff --git a/crates/workspace2/src/item.rs b/crates/workspace2/src/item.rsindex 1b6582d5155..38b76630307 100644--- a/crates/workspace2/src/item.rs+++ b/crates/workspace2/src/item.rs@@ -760,7 +760,7 @@ pub mod test {use super::{Item, ItemEvent};use crate::{ItemId, ItemNavHistory, Pane, Workspace, WorkspaceId};use gpui::{- AnyElement, AppContext, Context as _, Element, EntityId, EventEmitter, FocusableView,+ AnyElement, AppContext, Context as _, EntityId, EventEmitter, FocusableView,InteractiveElement, IntoElement, Model, Render, SharedString, Task, View, ViewContext,VisualContext, WeakView,};@@ -910,7 +910,7 @@ pub mod test {}impl Render for TestItem {- fn render(&mut self, _: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _: &mut ViewContext<Self>) -> impl IntoElement {gpui::div().track_focus(&self.focus_handle)}}diff --git a/crates/workspace2/src/modal_layer.rs b/crates/workspace2/src/modal_layer.rsindex 01c17b9ed19..ae105345cd3 100644--- a/crates/workspace2/src/modal_layer.rs+++ b/crates/workspace2/src/modal_layer.rs@@ -104,7 +104,7 @@ impl ModalLayer {}impl Render for ModalLayer {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let Some(active_modal) = &self.active_modal else {return div();};diff --git a/crates/workspace2/src/notifications.rs b/crates/workspace2/src/notifications.rsindex 44fc9c29ced..85ecf52a846 100644--- a/crates/workspace2/src/notifications.rs+++ b/crates/workspace2/src/notifications.rs@@ -219,7 +219,7 @@ pub mod simple_message_notification {}impl Render for MessageNotification {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {v_stack().elevation_3(cx).p_4()diff --git a/crates/workspace2/src/pane.rs b/crates/workspace2/src/pane.rsindex 9e620d993a3..0f06a5cc329 100644--- a/crates/workspace2/src/pane.rs+++ b/crates/workspace2/src/pane.rs@@ -1867,7 +1867,7 @@ impl FocusableView for Pane {}impl Render for Pane {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {v_stack().key_context("Pane").track_focus(&self.focus_handle)@@ -2746,7 +2746,7 @@ mod tests {}impl Render for DraggedTab {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let ui_font = ThemeSettings::get_global(cx).ui_font.family.clone();let item = &self.pane.read(cx).items[self.ix];let label = item.tab_content(Some(self.detail), false, cx);diff --git a/crates/workspace2/src/shared_screen.rs b/crates/workspace2/src/shared_screen.rsindex af38d48892e..dbbe7de6a18 100644--- a/crates/workspace2/src/shared_screen.rs+++ b/crates/workspace2/src/shared_screen.rs@@ -66,7 +66,7 @@ impl FocusableView for SharedScreen {}}impl Render for SharedScreen {- fn render(&mut self, _: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, _: &mut ViewContext<Self>) -> impl IntoElement {div().track_focus(&self.focus).size_full().children(self.frame.as_ref()diff --git a/crates/workspace2/src/status_bar.rs b/crates/workspace2/src/status_bar.rsindex fe6090f774e..bfa1a8f8ba0 100644--- a/crates/workspace2/src/status_bar.rs+++ b/crates/workspace2/src/status_bar.rs@@ -33,7 +33,7 @@ pub struct StatusBar {}impl Render for StatusBar {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {div().py_0p5().px_1()diff --git a/crates/workspace2/src/toolbar.rs b/crates/workspace2/src/toolbar.rsindex 2f5222686b2..dc17cd3c195 100644--- a/crates/workspace2/src/toolbar.rs+++ b/crates/workspace2/src/toolbar.rs@@ -93,7 +93,7 @@ impl Toolbar {}impl Render for Toolbar {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {if !self.has_any_visible_items() {return div();}diff --git a/crates/workspace2/src/workspace2.rs b/crates/workspace2/src/workspace2.rsindex b5a7a3230ee..f5da419c6b4 100644--- a/crates/workspace2/src/workspace2.rs+++ b/crates/workspace2/src/workspace2.rs@@ -3487,7 +3487,7 @@ impl FocusableView for Workspace {struct DraggedDock(DockPosition);impl Render for Workspace {- fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {let mut context = KeyContext::default();context.add("Workspace");diff --git a/crates/workspace2_ui/src/titlebar.rs b/crates/workspace2_ui/src/titlebar.rsnew file mode 100644index 00000000000..2e45e9b5e2e--- /dev/null+++ b/crates/workspace2_ui/src/titlebar.rs@@ -0,0 +1,442 @@+use gpui::{+ div, img, prelude::*, px, rems, DismissEvent, Div, EventEmitter, FocusHandle, FocusableView,+ SharedString, Stateful, View, ViewContext, WindowContext,+};+use theme::ActiveFabricTheme;+use ui::{+ popover_menu, Button, ButtonCommon, ButtonStyle, Clickable, Color, LabelSize, PopoverMenu,+ Tooltip,+};++#[derive(Clone, Copy, Debug)]+pub struct PeerId(pub u32);++#[derive(Clone, Copy, Debug)]+pub struct ProjectId(u64);++pub trait TitlebarDelegate: 'static + Sized {+ fn toggle_following(&mut self, peer_index: PeerId, cx: &mut ViewContext<Self>);+}++impl TitlebarDelegate for () {+ fn toggle_following(&mut self, peer: PeerId, _cx: &mut ViewContext<Self>) {+ log::info!("toggle following {:?}", peer);+ }+}++#[derive(IntoElement)]+pub struct Titlebar<D: TitlebarDelegate = ()> {+ pub delegate: View<D>,+ pub full_screen: bool,+ pub project_host: Option<ProjectHost<D>>,+ pub projects: Projects<D>,+ pub branches: Option<Branches>,+ pub collaborators: Vec<FacePile>,+}++#[derive(IntoElement)]+pub struct ProjectHost<D: TitlebarDelegate> {+ pub delegate: View<D>,+ pub id: PeerId,+ pub login: SharedString,+ pub peer_index: u32,+}++#[derive(IntoElement)]+pub struct Projects<D: TitlebarDelegate> {+ pub delegate: View<D>,+ pub current: SharedString,+ pub recent: Vec<Project>,+}++#[derive(Clone)]+pub struct Project {+ pub name: SharedString,+ pub id: ProjectId,+}++pub struct ProjectsMenu<D> {+ delegate: View<D>,+ focus: FocusHandle,+ recent: Vec<Project>,+}++pub struct Branches {+ pub current: SharedString,+}++#[derive(IntoElement, Default)]+pub struct FacePile {+ pub faces: Vec<Avatar>,+}++#[derive(IntoElement)]+pub struct Avatar {+ pub image_uri: SharedString,+ pub audio_status: AudioStatus,+ pub available: Option<bool>,+ pub shape: AvatarShape,+}++pub enum AvatarShape {+ Square,+ Circle,+}++impl<D: TitlebarDelegate> RenderOnce for Titlebar<D> {+ type Output = Stateful<Div>;++ fn render(self, cx: &mut ui::prelude::WindowContext) -> Self::Output {+ div()+ .flex()+ .flex_col()+ .id("titlebar")+ .justify_between()+ .w_full()+ .h(rems(1.75))+ // Set a non-scaling min-height here to ensure the titlebar is+ // always at least the height of the traffic lights.+ .min_h(px(32.))+ .pl_2()+ .when(self.full_screen, |this| {+ // Use pixels here instead of a rem-based size because the macOS traffic+ // lights are a static size, and don't scale with the rest of the UI.+ this.pl(px(80.))+ })+ .bg(cx.theme().denim.default.background)+ .on_click(|event, cx| {+ if event.up.click_count == 2 {+ cx.zoom_window();+ }+ })+ // left side+ .child(+ div()+ .flex()+ .flex_row()+ .gap_1()+ .children(self.project_host)+ .child(self.projects), // .children(self.render_project_branch(cx))+ // .children(self.render_collaborators(cx)),+ )+ // right side+ // .child(+ // div()+ // .flex()+ // .flex_row()+ // .gap_1()+ // .pr_1()+ // .when_some(room, |this, room| {+ // let room = room.read(cx);+ // let project = self.project.read(cx);+ // let is_local = project.is_local();+ // let is_shared = is_local && project.is_shared();+ // let is_muted = room.is_muted(cx);+ // let is_deafened = room.is_deafened().unwrap_or(false);+ // let is_screen_sharing = room.is_screen_sharing();++ // this.when(is_local, |this| {+ // this.child(+ // Button::new(+ // "toggle_sharing",+ // if is_shared { "Unshare" } else { "Share" },+ // )+ // .style(ButtonStyle::Subtle)+ // .label_size(LabelSize::Small)+ // .on_click(cx.listener(+ // move |this, _, cx| {+ // if is_shared {+ // this.unshare_project(&Default::default(), cx);+ // } else {+ // this.share_project(&Default::default(), cx);+ // }+ // },+ // )),+ // )+ // })+ // .child(+ // IconButton::new("leave-call", ui::Icon::Exit)+ // .style(ButtonStyle::Subtle)+ // .icon_size(IconSize::Small)+ // .on_click(move |_, cx| {+ // ActiveCall::global(cx)+ // .update(cx, |call, cx| call.hang_up(cx))+ // .detach_and_log_err(cx);+ // }),+ // )+ // .child(+ // IconButton::new(+ // "mute-microphone",+ // if is_muted {+ // ui::Icon::MicMute+ // } else {+ // ui::Icon::Mic+ // },+ // )+ // .style(ButtonStyle::Subtle)+ // .icon_size(IconSize::Small)+ // .selected(is_muted)+ // .on_click(move |_, cx| crate::toggle_mute(&Default::default(), cx)),+ // )+ // .child(+ // IconButton::new(+ // "mute-sound",+ // if is_deafened {+ // ui::Icon::AudioOff+ // } else {+ // ui::Icon::AudioOn+ // },+ // )+ // .style(ButtonStyle::Subtle)+ // .icon_size(IconSize::Small)+ // .selected(is_deafened)+ // .tooltip(move |cx| {+ // Tooltip::with_meta("Deafen Audio", None, "Mic will be muted", cx)+ // })+ // .on_click(move |_, cx| crate::toggle_mute(&Default::default(), cx)),+ // )+ // .child(+ // IconButton::new("screen-share", ui::Icon::Screen)+ // .style(ButtonStyle::Subtle)+ // .icon_size(IconSize::Small)+ // .selected(is_screen_sharing)+ // .on_click(move |_, cx| {+ // crate::toggle_screen_sharing(&Default::default(), cx)+ // }),+ // )+ // })+ // .map(|el| {+ // let status = self.client.status();+ // let status = &*status.borrow();+ // if matches!(status, client::Status::Connected { .. }) {+ // el.child(self.render_user_menu_button(cx))+ // } else {+ // el.children(self.render_connection_status(status, cx))+ // .child(self.render_sign_in_button(cx))+ // .child(self.render_user_menu_button(cx))+ // }+ // }),+ // )+ }+}++impl<D: TitlebarDelegate> RenderOnce for ProjectHost<D> {+ type Output = Button;++ fn render(self, _: &mut WindowContext) -> Self::Output {+ let delegate = self.delegate;+ Button::new("project-host", self.login)+ .color(Color::Player(self.peer_index))+ .style(ButtonStyle::Subtle)+ .label_size(LabelSize::Small)+ .tooltip(move |cx| Tooltip::text("Toggle following", cx))+ .on_click(move |_, cx| {+ let host_id = self.id;+ delegate.update(cx, |this, cx| this.toggle_following(host_id, cx))+ })+ }+}++impl<D: 'static> EventEmitter<DismissEvent> for ProjectsMenu<D> {}++impl<D: TitlebarDelegate> Render for ProjectsMenu<D> {+ fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element {+ todo!()+ }+}++impl<D: TitlebarDelegate> FocusableView for ProjectsMenu<D> {+ fn focus_handle(&self, _cx: &gpui::AppContext) -> gpui::FocusHandle {+ self.focus.clone()+ }+}++impl<D: TitlebarDelegate> RenderOnce for Projects<D> {+ type Output = PopoverMenu<ProjectsMenu<D>>;++ fn render(self, _cx: &mut WindowContext) -> Self::Output {+ let delegate = self.delegate;+ let recent_projects = self.recent;++ popover_menu("recent-projects")+ .trigger(+ Button::new("trigger", self.current)+ .style(ButtonStyle::Subtle)+ .label_size(LabelSize::Small)+ .tooltip(move |cx| Tooltip::text("Recent Projects", cx)),+ )+ .menu(move |cx| {+ if recent_projects.is_empty() {+ None+ } else {+ Some(cx.new_view(|cx| ProjectsMenu {+ delegate: delegate.clone(),+ focus: cx.focus_handle(),+ recent: recent_projects.clone(),+ }))+ }+ })+ }+}++impl RenderOnce for FacePile {+ type Output = Div;++ fn render(self, _: &mut WindowContext) -> Self::Output {+ let face_count = self.faces.len();+ div()+ .p_1()+ .flex()+ .items_center()+ .children(self.faces.into_iter().enumerate().map(|(ix, avatar)| {+ let last_child = ix == face_count - 1;+ div()+ .z_index((face_count - ix) as u8)+ .when(!last_child, |div| div.neg_mr_1())+ .child(avatar)+ }))+ }+}++impl RenderOnce for Avatar {+ type Output = Div;++ fn render(self, cx: &mut WindowContext) -> Self::Output {+ div()+ .map(|this| match self.shape {+ AvatarShape::Square => this.rounded_md(),+ AvatarShape::Circle => this.rounded_full(),+ })+ .map(|this| match self.audio_status {+ AudioStatus::None => this,+ AudioStatus::Muted => this.border_color(cx.theme().muted),+ AudioStatus::Speaking => this.border_color(cx.theme().speaking),+ })+ .size(cx.rem_size() + px(2.))+ .child(+ img(self.image_uri)+ .size(cx.rem_size())+ .bg(cx.theme().cotton.disabled.background),+ )+ .children(self.available.map(|is_free| {+ // Non-integer sizes result in non-round indicators.+ let indicator_size = (cx.rem_size() * 0.4).round();++ div()+ .absolute()+ .z_index(1)+ .bg(if is_free {+ cx.theme().positive.default.background+ } else {+ cx.theme().negative.default.background+ })+ .size(indicator_size)+ .rounded(indicator_size)+ .bottom_0()+ .right_0()+ }))+ }+}++pub enum AudioStatus {+ None,+ Muted,+ Speaking,+}++// impl Titlebar {+// pub fn render_project_host(&self, cx: &mut ViewContext<Self>) -> Option<impl Element> {+// let host = self.project.read(cx).host()?;+// let host = self.user_store.read(cx).get_cached_user(host.user_id)?;+// let participant_index = self+// .user_store+// .read(cx)+// .participant_indices()+// .get(&host.id)?;+// Some(+// div().border().border_color(gpui::red()).child(+// Button::new("project_owner_trigger", host.github_login.clone())+// .color(Color::Player(participant_index.0))+// .style(ButtonStyle::Subtle)+// .label_size(LabelSize::Small)+// .tooltip(move |cx| Tooltip::text("Toggle following", cx)),+// ),+// )+// }++// pub fn render_project_branch(&self, cx: &mut ViewContext<Self>) -> Option<impl Element> {+// let entry = {+// let mut names_and_branches =+// self.project.read(cx).visible_worktrees(cx).map(|worktree| {+// let worktree = worktree.read(cx);+// worktree.root_git_entry()+// });++// names_and_branches.next().flatten()+// };+// let workspace = self.workspace.upgrade()?;+// let branch_name = entry+// .as_ref()+// .and_then(RepositoryEntry::branch)+// .map(|branch| util::truncate_and_trailoff(&branch, MAX_BRANCH_NAME_LENGTH))?;+// Some(+// popover_menu("project_branch_trigger")+// .trigger(+// Button::new("project_branch_trigger", branch_name)+// .color(Color::Muted)+// .style(ButtonStyle::Subtle)+// .label_size(LabelSize::Small)+// .tooltip(move |cx| {+// Tooltip::with_meta(+// "Recent Branches",+// Some(&ToggleVcsMenu),+// "Local branches only",+// cx,+// )+// }),+// )+// .menu(move |cx| Self::render_vcs_popover(workspace.clone(), cx)),+// )+// }++// fn render_collaborator(+// &self,+// user: &Arc<User>,+// peer_id: PeerId,+// is_present: bool,+// is_speaking: bool,+// is_muted: bool,+// room: &Room,+// project_id: Option<u64>,+// current_user: &Arc<User>,+// ) -> Option<FacePile> {+// let followers = project_id.map_or(&[] as &[_], |id| room.followers_for(peer_id, id));++// let pile = FacePile::default()+// .child(+// Avatar::new(user.avatar_uri.clone())+// .grayscale(!is_present)+// .border_color(if is_speaking {+// gpui::blue()+// } else if is_muted {+// gpui::red()+// } else {+// Hsla::default()+// }),+// )+// .children(followers.iter().filter_map(|follower_peer_id| {+// let follower = room+// .remote_participants()+// .values()+// .find_map(|p| (p.peer_id == *follower_peer_id).then_some(&p.user))+// .or_else(|| {+// (self.client.peer_id() == Some(*follower_peer_id)).then_some(current_user)+// })?+// .clone();++// Some(Avatar::new(follower.avatar_uri.clone()))+// }));++// Some(pile)+// }+// }