Checkpoint
This commit is contained in:
parent
2044ccdc0b
commit
ce8533f83b
11 changed files with 161 additions and 181 deletions
|
@ -102,10 +102,10 @@ impl<T> core::ops::DerefMut for Lease<T> {
|
||||||
|
|
||||||
impl<T> Drop for Lease<T> {
|
impl<T> Drop for Lease<T> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
assert!(
|
if self.entity.is_some() {
|
||||||
self.entity.is_none(),
|
// We don't panic here, because other panics can cause us to drop the lease without ending it cleanly.
|
||||||
"Leases must be ended with EntityMap::end_lease"
|
log::error!("Leases must be ended with EntityMap::end_lease")
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,8 @@ pub fn view<S, E>(
|
||||||
render: impl Fn(&mut S, &mut ViewContext<S>) -> E + Send + Sync + 'static,
|
render: impl Fn(&mut S, &mut ViewContext<S>) -> E + Send + Sync + 'static,
|
||||||
) -> View<S>
|
) -> View<S>
|
||||||
where
|
where
|
||||||
|
E: IntoAnyElement<S>,
|
||||||
S: 'static + Send + Sync,
|
S: 'static + Send + Sync,
|
||||||
E: Element<ViewState = S>,
|
|
||||||
{
|
{
|
||||||
View {
|
View {
|
||||||
state,
|
state,
|
||||||
|
@ -86,6 +86,8 @@ impl<S: 'static + Send + Sync> Element for View<S> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<S: Send + Sync + 'static> IdentifiedElement for View<S> {}
|
||||||
|
|
||||||
struct EraseViewState<ViewState: 'static + Send + Sync, ParentViewState> {
|
struct EraseViewState<ViewState: 'static + Send + Sync, ParentViewState> {
|
||||||
view: View<ViewState>,
|
view: View<ViewState>,
|
||||||
parent_view_state_type: PhantomData<ParentViewState>,
|
parent_view_state_type: PhantomData<ParentViewState>,
|
||||||
|
@ -137,11 +139,9 @@ where
|
||||||
trait ViewObject: 'static + Send + Sync {
|
trait ViewObject: 'static + Send + Sync {
|
||||||
fn entity_id(&self) -> EntityId;
|
fn entity_id(&self) -> EntityId;
|
||||||
fn layout(&mut self, cx: &mut WindowContext) -> (LayoutId, AnyBox);
|
fn layout(&mut self, cx: &mut WindowContext) -> (LayoutId, AnyBox);
|
||||||
fn paint(&mut self, bounds: Bounds<Pixels>, element: &mut dyn Any, cx: &mut WindowContext);
|
fn paint(&mut self, bounds: Bounds<Pixels>, element: &mut AnyBox, cx: &mut WindowContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<S: Send + Sync + 'static> IdentifiedElement for View<S> {}
|
|
||||||
|
|
||||||
impl<S: Send + Sync + 'static> ViewObject for View<S> {
|
impl<S: Send + Sync + 'static> ViewObject for View<S> {
|
||||||
fn entity_id(&self) -> EntityId {
|
fn entity_id(&self) -> EntityId {
|
||||||
self.state.id
|
self.state.id
|
||||||
|
@ -158,7 +158,7 @@ impl<S: Send + Sync + 'static> ViewObject for View<S> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn paint(&mut self, _: Bounds<Pixels>, element: &mut dyn Any, cx: &mut WindowContext) {
|
fn paint(&mut self, _: Bounds<Pixels>, element: &mut AnyBox, cx: &mut WindowContext) {
|
||||||
cx.with_element_id(IdentifiedElement::element_id(self), |cx| {
|
cx.with_element_id(IdentifiedElement::element_id(self), |cx| {
|
||||||
self.state.update(cx, |state, cx| {
|
self.state.update(cx, |state, cx| {
|
||||||
let element = element.downcast_mut::<AnyElement<S>>().unwrap();
|
let element = element.downcast_mut::<AnyElement<S>>().unwrap();
|
||||||
|
@ -208,7 +208,7 @@ impl Element for AnyView {
|
||||||
element: &mut AnyBox,
|
element: &mut AnyBox,
|
||||||
cx: &mut ViewContext<Self::ViewState>,
|
cx: &mut ViewContext<Self::ViewState>,
|
||||||
) {
|
) {
|
||||||
self.view.lock().paint(bounds, element.as_mut(), cx)
|
self.view.lock().paint(bounds, element, cx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,7 @@ pub fn derive_element(input: TokenStream) -> TokenStream {
|
||||||
type ElementState = gpui3::AnyElement<#state_type>;
|
type ElementState = gpui3::AnyElement<#state_type>;
|
||||||
|
|
||||||
fn element_id(&self) -> Option<gpui3::ElementId> {
|
fn element_id(&self) -> Option<gpui3::ElementId> {
|
||||||
|
// todo!("What should element_id be here?")
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ use clap::ValueEnum;
|
||||||
use gpui3::AnyElement;
|
use gpui3::AnyElement;
|
||||||
use strum::{EnumIter, EnumString, IntoEnumIterator};
|
use strum::{EnumIter, EnumString, IntoEnumIterator};
|
||||||
|
|
||||||
use ui::prelude::*;
|
use ui::{prelude::*, AssistantPanelStory};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, Clone, Copy, strum::Display, EnumString, EnumIter)]
|
#[derive(Debug, PartialEq, Eq, Clone, Copy, strum::Display, EnumString, EnumIter)]
|
||||||
#[strum(serialize_all = "snake_case")]
|
#[strum(serialize_all = "snake_case")]
|
||||||
|
@ -90,7 +90,7 @@ impl ComponentStory {
|
||||||
Self::Toast => ui::ToastStory::new().into_any(),
|
Self::Toast => ui::ToastStory::new().into_any(),
|
||||||
Self::Toolbar => ui::ToolbarStory::new().into_any(),
|
Self::Toolbar => ui::ToolbarStory::new().into_any(),
|
||||||
Self::TrafficLights => ui::TrafficLightsStory::new().into_any(),
|
Self::TrafficLights => ui::TrafficLightsStory::new().into_any(),
|
||||||
Self::Workspace => todo!(),
|
Self::Workspace => ui::workspace_story(cx).into_any().into_any(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,6 +94,7 @@ fn main() {
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct StoryWrapper {
|
pub struct StoryWrapper {
|
||||||
selector: StorySelector,
|
selector: StorySelector,
|
||||||
|
// story:
|
||||||
theme: Theme,
|
theme: Theme,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,59 +33,50 @@ impl<S: 'static + Send + Sync + Clone> AssistantPanel<S> {
|
||||||
pub scroll_state: ScrollState,
|
pub scroll_state: ScrollState,
|
||||||
}
|
}
|
||||||
|
|
||||||
Panel::new(
|
Panel::new(self.scroll_state.clone())
|
||||||
self.scroll_state.clone(),
|
.children(vec![div()
|
||||||
|_, payload| {
|
.flex()
|
||||||
let payload = payload.downcast_ref::<PanelPayload>().unwrap();
|
.flex_col()
|
||||||
|
.h_full()
|
||||||
vec![div()
|
.px_2()
|
||||||
.flex()
|
.gap_2()
|
||||||
.flex_col()
|
// Header
|
||||||
.h_full()
|
.child(
|
||||||
.px_2()
|
div()
|
||||||
.gap_2()
|
.flex()
|
||||||
// Header
|
.justify_between()
|
||||||
.child(
|
.gap_2()
|
||||||
div()
|
.child(
|
||||||
.flex()
|
div()
|
||||||
.justify_between()
|
.flex()
|
||||||
.gap_2()
|
.child(IconButton::new(Icon::Menu))
|
||||||
.child(
|
.child(Label::new("New Conversation")),
|
||||||
div()
|
)
|
||||||
.flex()
|
.child(
|
||||||
.child(IconButton::new(Icon::Menu))
|
div()
|
||||||
.child(Label::new("New Conversation")),
|
.flex()
|
||||||
)
|
.items_center()
|
||||||
.child(
|
.gap_px()
|
||||||
div()
|
.child(IconButton::new(Icon::SplitMessage))
|
||||||
.flex()
|
.child(IconButton::new(Icon::Quote))
|
||||||
.items_center()
|
.child(IconButton::new(Icon::MagicWand))
|
||||||
.gap_px()
|
.child(IconButton::new(Icon::Plus))
|
||||||
.child(IconButton::new(Icon::SplitMessage))
|
.child(IconButton::new(Icon::Maximize)),
|
||||||
.child(IconButton::new(Icon::Quote))
|
),
|
||||||
.child(IconButton::new(Icon::MagicWand))
|
)
|
||||||
.child(IconButton::new(Icon::Plus))
|
// Chat Body
|
||||||
.child(IconButton::new(Icon::Maximize)),
|
.child(
|
||||||
),
|
div()
|
||||||
)
|
.w_full()
|
||||||
// Chat Body
|
.flex()
|
||||||
.child(
|
.flex_col()
|
||||||
div()
|
.gap_3()
|
||||||
.w_full()
|
.overflow_y_scroll(self.scroll_state.clone())
|
||||||
.flex()
|
.child(Label::new("Is this thing on?")),
|
||||||
.flex_col()
|
)
|
||||||
.gap_3()
|
.into_any()])
|
||||||
.overflow_y_scroll(payload.scroll_state.clone())
|
.side(self.current_side)
|
||||||
.child(Label::new("Is this thing on?")),
|
.width(AbsoluteLength::Rems(rems(32.)))
|
||||||
)
|
|
||||||
.into_any()]
|
|
||||||
},
|
|
||||||
Box::new(PanelPayload {
|
|
||||||
scroll_state: self.scroll_state.clone(),
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.side(self.current_side)
|
|
||||||
.width(AbsoluteLength::Rems(rems(32.)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +101,11 @@ mod stories {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
fn render(
|
||||||
|
&mut self,
|
||||||
|
_view: &mut S,
|
||||||
|
cx: &mut ViewContext<S>,
|
||||||
|
) -> impl Element<ViewState = S> {
|
||||||
Story::container(cx)
|
Story::container(cx)
|
||||||
.child(Story::title_for::<_, AssistantPanel<S>>(cx))
|
.child(Story::title_for::<_, AssistantPanel<S>>(cx))
|
||||||
.child(Story::label(cx, "Default"))
|
.child(Story::label(cx, "Default"))
|
||||||
|
|
|
@ -20,7 +20,7 @@ impl<S: 'static + Send + Sync + Clone> ChatPanel<S> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_messages(mut self, messages: Vec<ChatMessage<S>>) -> Self {
|
pub fn messages(mut self, messages: Vec<ChatMessage<S>>) -> Self {
|
||||||
self.messages = messages;
|
self.messages = messages;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
@ -130,39 +130,36 @@ mod stories {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
fn render(
|
||||||
|
&mut self,
|
||||||
|
_view: &mut S,
|
||||||
|
cx: &mut ViewContext<S>,
|
||||||
|
) -> impl Element<ViewState = S> {
|
||||||
Story::container(cx)
|
Story::container(cx)
|
||||||
.child(Story::title_for::<_, ChatPanel<S>>(cx))
|
.child(Story::title_for::<_, ChatPanel<S>>(cx))
|
||||||
.child(Story::label(cx, "Default"))
|
.child(Story::label(cx, "Default"))
|
||||||
.child(Panel::new(
|
.child(
|
||||||
ScrollState::default(),
|
Panel::new(ScrollState::default())
|
||||||
|_, _| vec![ChatPanel::new(ScrollState::default()).into_any()],
|
.child(ChatPanel::new(ScrollState::default())),
|
||||||
Box::new(()),
|
)
|
||||||
))
|
|
||||||
.child(Story::label(cx, "With Mesages"))
|
.child(Story::label(cx, "With Mesages"))
|
||||||
.child(Panel::new(
|
.child(Panel::new(ScrollState::default()).child(
|
||||||
ScrollState::default(),
|
ChatPanel::new(ScrollState::default()).messages(vec![
|
||||||
|_, _| {
|
ChatMessage::new(
|
||||||
vec![ChatPanel::new(ScrollState::default())
|
"osiewicz".to_string(),
|
||||||
.with_messages(vec![
|
"is this thing on?".to_string(),
|
||||||
ChatMessage::new(
|
DateTime::parse_from_rfc3339("2023-09-27T15:40:52.707Z")
|
||||||
"osiewicz".to_string(),
|
.unwrap()
|
||||||
"is this thing on?".to_string(),
|
.naive_local(),
|
||||||
DateTime::parse_from_rfc3339("2023-09-27T15:40:52.707Z")
|
),
|
||||||
.unwrap()
|
ChatMessage::new(
|
||||||
.naive_local(),
|
"maxdeviant".to_string(),
|
||||||
),
|
"Reading you loud and clear!".to_string(),
|
||||||
ChatMessage::new(
|
DateTime::parse_from_rfc3339("2023-09-28T15:40:52.707Z")
|
||||||
"maxdeviant".to_string(),
|
.unwrap()
|
||||||
"Reading you loud and clear!".to_string(),
|
.naive_local(),
|
||||||
DateTime::parse_from_rfc3339("2023-09-28T15:40:52.707Z")
|
),
|
||||||
.unwrap()
|
]),
|
||||||
.naive_local(),
|
|
||||||
),
|
|
||||||
])
|
|
||||||
.into_any()]
|
|
||||||
},
|
|
||||||
Box::new(()),
|
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,11 @@ mod stories {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
fn render(
|
||||||
|
&mut self,
|
||||||
|
_view: &mut S,
|
||||||
|
cx: &mut ViewContext<S>,
|
||||||
|
) -> impl Element<ViewState = S> {
|
||||||
let theme = theme(cx);
|
let theme = theme(cx);
|
||||||
|
|
||||||
Story::container(cx)
|
Story::container(cx)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
use gpui3::AbsoluteLength;
|
use gpui3::{AbsoluteLength, AnyElement};
|
||||||
|
use smallvec::SmallVec;
|
||||||
|
|
||||||
use crate::{prelude::*, theme};
|
use crate::{prelude::*, theme};
|
||||||
use crate::{token, v_stack};
|
use crate::{token, v_stack};
|
||||||
|
@ -47,16 +48,11 @@ pub struct Panel<S: 'static + Send + Sync> {
|
||||||
allowed_sides: PanelAllowedSides,
|
allowed_sides: PanelAllowedSides,
|
||||||
initial_width: AbsoluteLength,
|
initial_width: AbsoluteLength,
|
||||||
width: Option<AbsoluteLength>,
|
width: Option<AbsoluteLength>,
|
||||||
children: HackyChildren<S>,
|
children: SmallVec<[AnyElement<S>; 2]>,
|
||||||
payload: HackyChildrenPayload,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<S: 'static + Send + Sync> Panel<S> {
|
impl<S: 'static + Send + Sync> Panel<S> {
|
||||||
pub fn new(
|
pub fn new(scroll_state: ScrollState) -> Self {
|
||||||
scroll_state: ScrollState,
|
|
||||||
children: HackyChildren<S>,
|
|
||||||
payload: HackyChildrenPayload,
|
|
||||||
) -> Self {
|
|
||||||
let token = token();
|
let token = token();
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
@ -66,8 +62,7 @@ impl<S: 'static + Send + Sync> Panel<S> {
|
||||||
allowed_sides: PanelAllowedSides::default(),
|
allowed_sides: PanelAllowedSides::default(),
|
||||||
initial_width: token.default_panel_size,
|
initial_width: token.default_panel_size,
|
||||||
width: None,
|
width: None,
|
||||||
children,
|
children: SmallVec::new(),
|
||||||
payload,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,7 +135,15 @@ impl<S: 'static + Send + Sync> Panel<S> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
panel_base.children_any((self.children)(cx, self.payload.as_ref()))
|
panel_base.children(self.children.drain(..))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<S: 'static + Send + Sync> ParentElement for Panel<S> {
|
||||||
|
type State = S;
|
||||||
|
|
||||||
|
fn children_mut(&mut self) -> &mut SmallVec<[AnyElement<Self::State>; 2]> {
|
||||||
|
&mut self.children
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,20 +168,21 @@ mod stories {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
fn render(
|
||||||
|
&mut self,
|
||||||
|
_view: &mut S,
|
||||||
|
cx: &mut ViewContext<S>,
|
||||||
|
) -> impl Element<ViewState = S> {
|
||||||
Story::container(cx)
|
Story::container(cx)
|
||||||
.child(Story::title_for::<_, Panel<S>>(cx))
|
.child(Story::title_for::<_, Panel<S>>(cx))
|
||||||
.child(Story::label(cx, "Default"))
|
.child(Story::label(cx, "Default"))
|
||||||
.child(Panel::new(
|
.child(
|
||||||
ScrollState::default(),
|
Panel::new(ScrollState::default()).child(
|
||||||
|_, _| {
|
div()
|
||||||
vec![div()
|
|
||||||
.overflow_y_scroll(ScrollState::default())
|
.overflow_y_scroll(ScrollState::default())
|
||||||
.children((0..100).map(|ix| Label::new(format!("Item {}", ix + 1))))
|
.children((0..100).map(|ix| Label::new(format!("Item {}", ix + 1)))),
|
||||||
.into_any()]
|
),
|
||||||
},
|
)
|
||||||
Box::new(()),
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,15 +78,18 @@ mod stories {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
fn render(
|
||||||
|
&mut self,
|
||||||
|
_view: &mut S,
|
||||||
|
cx: &mut ViewContext<S>,
|
||||||
|
) -> impl Element<ViewState = S> {
|
||||||
Story::container(cx)
|
Story::container(cx)
|
||||||
.child(Story::title_for::<_, ProjectPanel<S>>(cx))
|
.child(Story::title_for::<_, ProjectPanel<S>>(cx))
|
||||||
.child(Story::label(cx, "Default"))
|
.child(Story::label(cx, "Default"))
|
||||||
.child(Panel::new(
|
.child(
|
||||||
ScrollState::default(),
|
Panel::new(ScrollState::default())
|
||||||
|_, _| vec![ProjectPanel::new(ScrollState::default()).into_any()],
|
.child(ProjectPanel::new(ScrollState::default())),
|
||||||
Box::new(()),
|
)
|
||||||
))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -244,27 +244,17 @@ impl Workspace {
|
||||||
.border_color(theme.lowest.base.default.border)
|
.border_color(theme.lowest.base.default.border)
|
||||||
.children(
|
.children(
|
||||||
Some(
|
Some(
|
||||||
Panel::new(
|
Panel::new(self.left_panel_scroll_state.clone())
|
||||||
self.left_panel_scroll_state.clone(),
|
.side(PanelSide::Left)
|
||||||
|_, payload| {
|
.child(ProjectPanel::new(ScrollState::default())),
|
||||||
vec![ProjectPanel::new(ScrollState::default()).into_any()]
|
|
||||||
},
|
|
||||||
Box::new(()),
|
|
||||||
)
|
|
||||||
.side(PanelSide::Left),
|
|
||||||
)
|
)
|
||||||
.filter(|_| workspace_state.is_project_panel_open()),
|
.filter(|_| workspace_state.is_project_panel_open()),
|
||||||
)
|
)
|
||||||
.children(
|
.children(
|
||||||
Some(
|
Some(
|
||||||
Panel::new(
|
Panel::new(self.left_panel_scroll_state.clone())
|
||||||
self.left_panel_scroll_state.clone(),
|
.child(CollabPanel::new(ScrollState::default()))
|
||||||
|_, payload| {
|
.side(PanelSide::Left),
|
||||||
vec![CollabPanel::new(ScrollState::default()).into_any()]
|
|
||||||
},
|
|
||||||
Box::new(()),
|
|
||||||
)
|
|
||||||
.side(PanelSide::Left),
|
|
||||||
)
|
)
|
||||||
.filter(|_| workspace_state.is_collab_panel_open()),
|
.filter(|_| workspace_state.is_collab_panel_open()),
|
||||||
)
|
)
|
||||||
|
@ -285,57 +275,42 @@ impl Workspace {
|
||||||
)
|
)
|
||||||
.children(
|
.children(
|
||||||
Some(
|
Some(
|
||||||
Panel::new(
|
Panel::new(self.bottom_panel_scroll_state.clone())
|
||||||
self.bottom_panel_scroll_state.clone(),
|
.child(Terminal::new())
|
||||||
|_, _| vec![Terminal::new().into_any()],
|
.allowed_sides(PanelAllowedSides::BottomOnly)
|
||||||
Box::new(()),
|
.side(PanelSide::Bottom),
|
||||||
)
|
|
||||||
.allowed_sides(PanelAllowedSides::BottomOnly)
|
|
||||||
.side(PanelSide::Bottom),
|
|
||||||
)
|
)
|
||||||
.filter(|_| workspace_state.show_terminal.load(Ordering::SeqCst)),
|
.filter(|_| workspace_state.show_terminal.load(Ordering::SeqCst)),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.children(
|
.children(
|
||||||
Some(
|
Some(
|
||||||
Panel::new(
|
Panel::new(self.right_panel_scroll_state.clone())
|
||||||
self.right_panel_scroll_state.clone(),
|
.side(PanelSide::Right)
|
||||||
|_, payload| {
|
.child(ChatPanel::new(ScrollState::default()).messages(vec![
|
||||||
vec![ChatPanel::new(ScrollState::default())
|
ChatMessage::new(
|
||||||
.with_messages(vec![
|
"osiewicz".to_string(),
|
||||||
ChatMessage::new(
|
"is this thing on?".to_string(),
|
||||||
"osiewicz".to_string(),
|
DateTime::parse_from_rfc3339("2023-09-27T15:40:52.707Z")
|
||||||
"is this thing on?".to_string(),
|
.unwrap()
|
||||||
DateTime::parse_from_rfc3339(
|
.naive_local(),
|
||||||
"2023-09-27T15:40:52.707Z",
|
),
|
||||||
)
|
ChatMessage::new(
|
||||||
.unwrap()
|
"maxdeviant".to_string(),
|
||||||
.naive_local(),
|
"Reading you loud and clear!".to_string(),
|
||||||
),
|
DateTime::parse_from_rfc3339("2023-09-28T15:40:52.707Z")
|
||||||
ChatMessage::new(
|
.unwrap()
|
||||||
"maxdeviant".to_string(),
|
.naive_local(),
|
||||||
"Reading you loud and clear!".to_string(),
|
),
|
||||||
DateTime::parse_from_rfc3339(
|
])),
|
||||||
"2023-09-28T15:40:52.707Z",
|
|
||||||
)
|
|
||||||
.unwrap()
|
|
||||||
.naive_local(),
|
|
||||||
),
|
|
||||||
])
|
|
||||||
.into_any()]
|
|
||||||
},
|
|
||||||
Box::new(()),
|
|
||||||
)
|
|
||||||
.side(PanelSide::Right),
|
|
||||||
)
|
)
|
||||||
.filter(|_| workspace_state.is_chat_panel_open()),
|
.filter(|_| workspace_state.is_chat_panel_open()),
|
||||||
)
|
)
|
||||||
.children(
|
.children(
|
||||||
Some(Panel::new(
|
Some(
|
||||||
self.right_panel_scroll_state.clone(),
|
Panel::new(self.right_panel_scroll_state.clone())
|
||||||
|_, _| vec![AssistantPanel::new().into_any()],
|
.child(AssistantPanel::new()),
|
||||||
Box::new(()),
|
)
|
||||||
))
|
|
||||||
.filter(|_| workspace_state.is_assistant_panel_open()),
|
.filter(|_| workspace_state.is_assistant_panel_open()),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue