Checkpoint

This commit is contained in:
Nathan Sobo 2023-11-14 01:15:48 -07:00
parent ce30a689a0
commit 27fb381cca
82 changed files with 661 additions and 1907 deletions

View file

@ -1,6 +1,6 @@
use crate::prelude::*;
use crate::{Icon, IconButton, Label, Panel, PanelSide};
use gpui::{rems, AbsoluteLength};
use gpui::{prelude::*, rems, AbsoluteLength};
#[derive(Component)]
pub struct AssistantPanel {
@ -77,11 +77,11 @@ pub use stories::*;
mod stories {
use super::*;
use crate::Story;
use gpui::{Div, Render};
use gpui::{Node, Render};
pub struct AssistantPanelStory;
impl Render for AssistantPanelStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -1,9 +1,7 @@
use crate::{h_stack, prelude::*, HighlightedText};
use gpui::{prelude::*, Node};
use std::path::PathBuf;
use crate::prelude::*;
use crate::{h_stack, HighlightedText};
use gpui::Div;
#[derive(Clone)]
pub struct Symbol(pub Vec<HighlightedText>);
@ -18,7 +16,7 @@ impl Breadcrumb {
Self { path, symbols }
}
fn render_separator<V: 'static>(&self, cx: &WindowContext) -> Div<V> {
fn render_separator<V: 'static>(&self, cx: &WindowContext) -> Node<V> {
div()
.child(" ")
.text_color(cx.theme().colors().text_muted)
@ -79,7 +77,7 @@ mod stories {
pub struct BreadcrumbStory;
impl Render for BreadcrumbStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -235,12 +235,12 @@ mod stories {
empty_buffer_example, hello_world_rust_buffer_example,
hello_world_rust_buffer_with_status_example, Story,
};
use gpui::{rems, Div, Render};
use gpui::{rems, Node, Render};
pub struct BufferStory;
impl Render for BufferStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -1,4 +1,4 @@
use gpui::{Div, Render, View, VisualContext};
use gpui::{Node, Render, View, VisualContext};
use crate::prelude::*;
use crate::{h_stack, Icon, IconButton, IconColor, Input};
@ -27,9 +27,9 @@ impl BufferSearch {
}
impl Render for BufferSearch {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Div<Self> {
fn render(&mut self, cx: &mut ViewContext<Self>) -> Node<Self> {
h_stack()
.bg(cx.theme().colors().toolbar_background)
.p_2()

View file

@ -1,7 +1,6 @@
use crate::{prelude::*, Icon, IconButton, Input, Label, LabelColor};
use chrono::NaiveDateTime;
use crate::prelude::*;
use crate::{Icon, IconButton, Input, Label, LabelColor};
use gpui::prelude::*;
#[derive(Component)]
pub struct ChatPanel {
@ -108,7 +107,7 @@ pub use stories::*;
#[cfg(feature = "stories")]
mod stories {
use chrono::DateTime;
use gpui::{Div, Render};
use gpui::{Node, Render};
use crate::{Panel, Story};
@ -117,7 +116,7 @@ mod stories {
pub struct ChatPanelStory;
impl Render for ChatPanelStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -1,7 +1,8 @@
use crate::{prelude::*, Toggle};
use crate::{
static_collab_panel_channels, static_collab_panel_current_call, v_stack, Icon, List, ListHeader,
prelude::*, static_collab_panel_channels, static_collab_panel_current_call, v_stack, Icon,
List, ListHeader, Toggle,
};
use gpui::prelude::*;
#[derive(Component)]
pub struct CollabPanel {
@ -92,12 +93,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::Story;
use gpui::{Div, Render};
use gpui::{Node, Render};
pub struct CollabPanelStory;
impl Render for CollabPanelStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -27,7 +27,7 @@ pub use stories::*;
#[cfg(feature = "stories")]
mod stories {
use gpui::{Div, Render};
use gpui::{Node, Render};
use crate::Story;
@ -36,7 +36,7 @@ mod stories {
pub struct CommandPaletteStory;
impl Render for CommandPaletteStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -25,7 +25,7 @@ pub use stories::*;
#[cfg(feature = "stories")]
mod stories {
use gpui::{Div, Render};
use gpui::{Node, Render};
use crate::Story;
@ -34,7 +34,7 @@ mod stories {
pub struct CopilotModalStory;
impl Render for CopilotModalStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -1,6 +1,6 @@
use std::path::PathBuf;
use gpui::{Div, Render, View, VisualContext};
use gpui::{Node, Render, View, VisualContext};
use crate::prelude::*;
use crate::{
@ -48,9 +48,9 @@ impl EditorPane {
}
impl Render for EditorPane {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Div<Self> {
fn render(&mut self, cx: &mut ViewContext<Self>) -> Node<Self> {
v_stack()
.w_full()
.h_full()

View file

@ -40,12 +40,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::Story;
use gpui::{Div, Render};
use gpui::{Node, Render};
pub struct LanguageSelectorStory;
impl Render for LanguageSelectorStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -40,12 +40,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::{hello_world_rust_buffer_example, Story};
use gpui::{Div, Render};
use gpui::{Node, Render};
pub struct MultiBufferStory;
impl Render for MultiBufferStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -1,10 +1,9 @@
use crate::utils::naive_format_distance_from_now;
use crate::{
h_stack, prelude::*, static_new_notification_items_2, v_stack, Avatar, ButtonOrIconButton,
Icon, IconElement, Label, LabelColor, LineHeightStyle, ListHeaderMeta, ListSeparator,
PublicPlayer, UnreadIndicator,
h_stack, prelude::*, static_new_notification_items_2, utils::naive_format_distance_from_now,
v_stack, Avatar, ButtonOrIconButton, ClickHandler, Icon, IconElement, Label, LabelColor,
LineHeightStyle, ListHeader, ListHeaderMeta, ListSeparator, PublicPlayer, UnreadIndicator,
};
use crate::{ClickHandler, ListHeader};
use gpui::prelude::*;
#[derive(Component)]
pub struct NotificationsPanel {
@ -353,12 +352,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::{Panel, Story};
use gpui::{Div, Render};
use gpui::{Node, Render};
pub struct NotificationsPanelStory;
impl Render for NotificationsPanelStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -59,7 +59,7 @@ impl<V: 'static> Pane<V> {
}
}
impl<V: 'static> ParentElement<V> for Pane<V> {
impl<V: 'static> ParentComponent<V> for Pane<V> {
fn children_mut(&mut self) -> &mut SmallVec<[AnyElement<V>; 2]> {
&mut self.children
}

View file

@ -1,7 +1,8 @@
use crate::prelude::*;
use crate::{
static_project_panel_project_items, static_project_panel_single_items, Input, List, ListHeader,
prelude::*, static_project_panel_project_items, static_project_panel_single_items, Input, List,
ListHeader,
};
use gpui::prelude::*;
#[derive(Component)]
pub struct ProjectPanel {
@ -54,12 +55,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::{Panel, Story};
use gpui::{Div, Render};
use gpui::{Node, Render};
pub struct ProjectPanelStory;
impl Render for ProjectPanelStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -36,12 +36,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::Story;
use gpui::{Div, Render};
use gpui::{Node, Render};
pub struct RecentProjectsStory;
impl Render for RecentProjectsStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -1,5 +1,5 @@
use crate::prelude::*;
use crate::{Icon, IconButton, Tab};
use crate::{prelude::*, Icon, IconButton, Tab};
use gpui::prelude::*;
#[derive(Component)]
pub struct TabBar {
@ -100,12 +100,12 @@ pub use stories::*;
mod stories {
use super::*;
use crate::Story;
use gpui::{Div, Render};
use gpui::{Node, Render};
pub struct TabBarStory;
impl Render for TabBarStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -83,11 +83,11 @@ pub use stories::*;
mod stories {
use super::*;
use crate::Story;
use gpui::{Div, Render};
use gpui::{Node, Render};
pub struct TerminalStory;
impl Render for TerminalStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -39,7 +39,7 @@ pub use stories::*;
#[cfg(feature = "stories")]
mod stories {
use gpui::{Div, Render};
use gpui::{Node, Render};
use crate::Story;
@ -48,7 +48,7 @@ mod stories {
pub struct ThemeSelectorStory;
impl Render for ThemeSelectorStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -1,7 +1,7 @@
use std::sync::atomic::AtomicBool;
use std::sync::Arc;
use gpui::{Div, Render, View, VisualContext};
use gpui::{Node, Render, View, VisualContext};
use crate::prelude::*;
use crate::settings::user_settings;
@ -86,9 +86,9 @@ impl TitleBar {
}
impl Render for TitleBar {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Div<Self> {
fn render(&mut self, cx: &mut ViewContext<Self>) -> Node<Self> {
let settings = user_settings(cx);
// let has_focus = cx.window_is_active();
@ -202,9 +202,9 @@ mod stories {
}
impl Render for TitleBarStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Div<Self> {
fn render(&mut self, cx: &mut ViewContext<Self>) -> Node<Self> {
Story::container(cx)
.child(Story::title_for::<_, TitleBar>(cx))
.child(Story::label(cx, "Default"))

View file

@ -73,7 +73,7 @@ mod stories {
use std::path::PathBuf;
use std::str::FromStr;
use gpui::{Div, Render};
use gpui::{Node, Render};
use crate::{Breadcrumb, HighlightedText, Icon, IconButton, Story, Symbol};
@ -82,7 +82,7 @@ mod stories {
pub struct ToolbarStory;
impl Render for ToolbarStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -77,7 +77,7 @@ pub use stories::*;
#[cfg(feature = "stories")]
mod stories {
use gpui::{Div, Render};
use gpui::{Node, Render};
use crate::Story;
@ -86,7 +86,7 @@ mod stories {
pub struct TrafficLightsStory;
impl Render for TrafficLightsStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
Story::container(cx)

View file

@ -1,7 +1,7 @@
use std::sync::Arc;
use chrono::DateTime;
use gpui::{px, relative, Div, Render, Size, View, VisualContext};
use gpui::{px, relative, Node, Render, Size, View, VisualContext};
use settings2::Settings;
use theme2::ThemeSettings;
@ -192,9 +192,9 @@ impl Workspace {
}
impl Render for Workspace {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Div<Self> {
fn render(&mut self, cx: &mut ViewContext<Self>) -> Node<Self> {
let root_group = PaneGroup::new_panes(
vec![Pane::new(
"pane-0",
@ -388,7 +388,7 @@ mod stories {
}
impl Render for WorkspaceStory {
type Element = Div<Self>;
type Element = Node<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
div().child(self.workspace.clone())