Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

place jump to bottom button on the right #169

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
224 changes: 115 additions & 109 deletions src/chat/chat_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ live_design! {
JumpToButtom = <View> {
width: Fill,
height: Fill,
align: {x: 0.5, y: 1.0},
align: {x: 1.0, y: 1.0},
padding: {bottom: 60},

jump_to_bottom = <CircleButton> {
width: 34,
Expand Down Expand Up @@ -252,161 +253,166 @@ live_design! {
}

ChatPanel = {{ChatPanel}} {
width: Fill,
height: Fill,
margin: {top: 0, left: 20, right: 20, bottom: 20},

flow: Overlay,

no_downloaded_model = <View> {
width: Fill,
height: Fill,
flow: Overlay
width: Fill
height: Fill

flow: Down,
align: {x: 0.5, y: 0.5},
<View> {
flow: Overlay
width: Fill
height: Fill
padding: {left: 25, right: 25, bottom: 20},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added 5 units to the right add some little extra space for the button. Added 5 units to the left just for symmetry.


<View> {
no_downloaded_model = <View> {
width: Fill,
height: Fill,

flow: Down,
spacing: 30,
align: {x: 0.5, y: 0.5},

<Label> {
draw_text: {
text_style: <REGULAR_FONT>{font_size: 12},
color: #667085
}
text: "You haven’t downloaded any models yet."
}
go_to_discover_button = <MoxinButton> {
width: Fit,
height: Fit,

draw_bg: {
border_color: #D0D5DD,
border_width: 1.0,
color: #fff,
color_hover: #E2F1F1,
radius: 2.0,
<View> {
width: Fill,
height: Fill,
flow: Down,
spacing: 30,
align: {x: 0.5, y: 0.5},

<Label> {
draw_text: {
text_style: <REGULAR_FONT>{font_size: 12},
color: #667085
}
text: "You haven’t downloaded any models yet."
}
go_to_discover_button = <MoxinButton> {
width: Fit,
height: Fit,

draw_bg: {
border_color: #D0D5DD,
border_width: 1.0,
color: #fff,
color_hover: #E2F1F1,
radius: 2.0,
}

padding: {top: 14, right: 12, bottom: 14, left: 12}
text: "Go To Discover"
draw_text: {
text_style: <BOLD_FONT>{font_size: 12},
fn get_color(self) -> vec4 {
return #087443;
padding: {top: 14, right: 12, bottom: 14, left: 12}
text: "Go To Discover"
draw_text: {
text_style: <BOLD_FONT>{font_size: 12},
fn get_color(self) -> vec4 {
return #087443;
}
}
}
}
}

<View> {
width: Fill, height: Fit
flow: Down,
align: {x: 0.5, y: 0.5},
no_downloaded_model_prompt_input = <ChatPromptInput> {}
}

}

no_model = <View> {
width: Fill,
height: Fill,
<View> {
width: Fill, height: Fit
flow: Down,
align: {x: 0.5, y: 0.5},
no_downloaded_model_prompt_input = <ChatPromptInput> {}
}

flow: Down,
align: {x: 0.5, y: 0.5},
}

<View> {
no_model = <View> {
width: Fill,
height: Fill,

flow: Down,
spacing: 30,
align: {x: 0.5, y: 0.5},

<Icon> {
draw_icon: {
svg_file: dep("crate://self/resources/icons/chat.svg"),
color: #D0D5DD
<View> {
width: Fill,
height: Fill,
flow: Down,
spacing: 30,
align: {x: 0.5, y: 0.5},

<Icon> {
draw_icon: {
svg_file: dep("crate://self/resources/icons/chat.svg"),
color: #D0D5DD
}
icon_walk: {width: 128, height: 128}
}

<Label> {
draw_text: {
text_style: <REGULAR_FONT>{font_size: 14},
color: #667085
}
text: "Start chatting by choosing a model from above"
}
icon_walk: {width: 128, height: 128}
}

<Label> {
draw_text: {
text_style: <REGULAR_FONT>{font_size: 14},
color: #667085
}
text: "Start chatting by choosing a model from above"
<View> {
width: Fill, height: Fit
flow: Down,
align: {x: 0.5, y: 0.5},
no_model_prompt_input = <ChatPromptInput> {}
}
}

<View> {
width: Fill, height: Fit
flow: Down,
align: {x: 0.5, y: 0.5},
no_model_prompt_input = <ChatPromptInput> {}
}

}

empty_conversation = <View> {
visible: false,
empty_conversation = <View> {
visible: false,

width: Fill,
height: Fill,
width: Fill,
height: Fill,

flow: Down,
spacing: 30,
align: {x: 0.5, y: 0.5},
flow: Down,
spacing: 30,
align: {x: 0.5, y: 0.5},

<ChatAgentAvatar> {}
<Label> {
draw_text: {
text_style: <REGULAR_FONT>{font_size: 14},
color: #101828
<ChatAgentAvatar> {}
<Label> {
draw_text: {
text_style: <REGULAR_FONT>{font_size: 14},
color: #101828
}
text: "How can I help you?"
}
text: "How can I help you?"
}
}

main = <View> {
visible: false
main = <View> {
visible: false

width: Fill,
height: Fill,

margin: { top: 86 }
spacing: 4,
flow: Down,

<View> {
width: Fill,
height: Fill,

flow: Overlay
chat = <PortalList> {
scroll_bar: {
bar_size: 0.0,
}
margin: { top: 86 }
spacing: 4,
flow: Down,

<View> {
width: Fill,
height: Fill,

drag_scrolling: false,
flow: Overlay
chat = <PortalList> {
scroll_bar: {
bar_size: 0.0,
}
width: Fill,
height: Fill,

drag_scrolling: false,

UserChatLine = <UserChatLine> {}
ModelChatLine = <ModelChatLine> {}
EndOfChat = <View> {height: 0.1}
UserChatLine = <UserChatLine> {}
ModelChatLine = <ModelChatLine> {}
EndOfChat = <View> {height: 0.1}
}
}

<JumpToButtom> {}
main_prompt_input = <ChatPromptInput> {}
}

main_prompt_input = <ChatPromptInput> {}
model_selector = <ModelSelector> {}
}

model_selector = <ModelSelector> {}
<JumpToButtom> {}
}
}

Expand Down
Loading