Skip to content

Commit aa138ca

Browse files
Native: Add Chat side panel
1 parent b6bdd14 commit aa138ca

File tree

6 files changed

+30
-5
lines changed

6 files changed

+30
-5
lines changed

application/apps/indexer/gui/application/src/host/ui/menu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use egui::{MenuBar, Popup, Theme, Ui};
1+
use egui::{MenuBar, Theme, Ui};
22
use stypes::FileFormat;
33
use tokio::sync::mpsc::Sender;
44

application/apps/indexer/gui/application/src/host/ui/state.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub struct HostState {
2626
pub sessions: HashMap<Uuid, Session>,
2727
pub session_setups: HashMap<Uuid, SessionSetup>,
2828
pub multi_setups: HashMap<Uuid, MultiFileSetup>,
29-
pub ai_configuration: AiConfiguration,
3029
}
3130

3231
impl HostState {
@@ -187,7 +186,6 @@ impl Default for HostState {
187186
sessions: HashMap::new(),
188187
session_setups: HashMap::new(),
189188
multi_setups: HashMap::new(),
190-
ai_configuration: AiConfiguration::default(),
191189
}
192190
}
193191
}

application/apps/indexer/gui/application/src/host/ui/tabs.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ pub fn render_all_tabs(state: &mut HostState, actions: &mut UiActions, ui: &mut
2929
sessions,
3030
session_setups,
3131
multi_setups,
32-
ai_configuration,
3332
} = state;
3433

3534
for (idx, tab) in tabs.iter().enumerate() {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use egui::Ui;
2+
use tokio::sync::mpsc;
3+
4+
use crate::session::{command::SessionCommand, ui::shared::SessionShared};
5+
6+
#[allow(unused)]
7+
#[derive(Debug)]
8+
pub struct ChatUi {
9+
cmd_tx: mpsc::Sender<SessionCommand>,
10+
}
11+
12+
impl ChatUi {
13+
pub fn new(cmd_tx: mpsc::Sender<SessionCommand>) -> Self {
14+
Self { cmd_tx }
15+
}
16+
17+
pub fn render_content(&mut self, _shared: &mut SessionShared, ui: &mut Ui) {}
18+
}

application/apps/indexer/gui/application/src/session/ui/side_panel/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ use crate::{
88
};
99

1010
mod attachments;
11+
mod chat;
1112
mod filters;
1213
mod observing;
1314
mod types;
1415

1516
use attachments::AttachmentsUi;
17+
use chat::ChatUi;
1618
use filters::FiltersUi;
1719
use observing::ObservingUi;
1820

@@ -23,14 +25,16 @@ pub struct SidePanelUi {
2325
observing: ObservingUi,
2426
attachments: AttachmentsUi,
2527
filters: FiltersUi,
28+
chat: ChatUi,
2629
}
2730

2831
impl SidePanelUi {
2932
pub fn new(observe_op: &ObserveOperation, cmd_tx: mpsc::Sender<SessionCommand>) -> Self {
3033
Self {
3134
observing: ObservingUi::new(observe_op, cmd_tx.clone()),
3235
attachments: AttachmentsUi::new(cmd_tx.clone()),
33-
filters: FiltersUi::new(cmd_tx),
36+
filters: FiltersUi::new(cmd_tx.clone()),
37+
chat: ChatUi::new(cmd_tx),
3438
}
3539
}
3640

@@ -65,6 +69,7 @@ impl SidePanelUi {
6569
SideTabType::Observing => self.observing.render_content(shared, actions, ui),
6670
SideTabType::Attachments => self.attachments.render_content(shared, ui),
6771
SideTabType::Filters => self.filters.render_content(shared, ui),
72+
SideTabType::Chat => self.chat.render_content(shared, ui),
6873
});
6974
}
7075
}
@@ -74,6 +79,7 @@ fn render_tab_button(target: SideTabType, current_tab: &mut SideTabType, ui: &mu
7479
SideTabType::Observing => icons::regular::BROADCAST,
7580
SideTabType::Attachments => icons::regular::PAPERCLIP,
7681
SideTabType::Filters => icons::regular::FUNNEL,
82+
SideTabType::Chat => icons::regular::CHAT,
7783
};
7884

7985
let (rect, mut res) = ui.allocate_exact_size(vec2(33., 40.), Sense::click());

application/apps/indexer/gui/application/src/session/ui/side_panel/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pub enum SideTabType {
55
Observing,
66
Attachments,
77
Filters,
8+
Chat,
89
}
910

1011
impl SideTabType {
@@ -14,12 +15,14 @@ impl SideTabType {
1415
SideTabType::Observing => {}
1516
SideTabType::Attachments => {}
1617
SideTabType::Filters => {}
18+
SideTabType::Chat => {}
1719
}
1820

1921
&[
2022
SideTabType::Observing,
2123
SideTabType::Attachments,
2224
SideTabType::Filters,
25+
SideTabType::Chat,
2326
]
2427
}
2528
}
@@ -30,6 +33,7 @@ impl Display for SideTabType {
3033
SideTabType::Observing => "Observing",
3134
SideTabType::Attachments => "Attachments",
3235
SideTabType::Filters => "Filters",
36+
SideTabType::Chat => "Chat",
3337
};
3438

3539
f.write_str(content)

0 commit comments

Comments
 (0)