feat(chat): Chat and Shared tabs in every chat header like Teams
- Chat / Shared tabs for all chats, Recap stays for meeting chats with a recording - Shared in chats lists files and links from messages, without the library switch - composer and proposal card hidden while Shared is open Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -27,6 +27,7 @@ pub const POSTS_LABEL: &str = "Posts";
27
27
pub const SHARED_LABEL: &str = "Shared";
28
28
pub const CHAT_LABEL: &str = "Chat";
29
29
pub const RECAP_LABEL: &str = "Recap";
30
pub const CHAT_SHARED_TAB_TAG: &str = "shell/islands/main/chat-shared-tab";
30
31
31
32
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
32
33
pub enum ChannelPane {
@@ -213,9 +214,10 @@ pub fn render_tab_bar(
213
214
.into_any_element()
214
215
}
215
216
216
pub fn render_meeting_bar(pane: ChannelPane, select: SelectPane) -> AnyElement {
217
/// Chat, Shared and, for meeting chats with a recording, Recap.
218
pub fn render_chat_bar(pane: ChannelPane, with_recap: bool, select: SelectPane) -> AnyElement {
217
219
let chat = tab_label(
218
"meeting-tab-chat".into(),
220
"chat-tab-chat".into(),
219
221
CHAT_LABEL,
220
222
pane == ChannelPane::Posts,
221
223
false,
@@ -224,15 +226,32 @@ pub fn render_meeting_bar(pane: ChannelPane, select: SelectPane) -> AnyElement {
224
226
move |_, cx| select(ChannelPane::Posts, cx)
225
227
},
226
228
);
227
let recap = tab_label(
228
"meeting-tab-recap".into(),
229
RECAP_LABEL,
230
pane == ChannelPane::Recap,
229
let shared = tab_label(
230
"chat-tab-shared".into(),
231
SHARED_LABEL,
232
pane == ChannelPane::Shared,
231
233
false,
232
move |_, cx| select(ChannelPane::Recap, cx),
234
{
235
let select = select.clone();
236
move |_, cx| select(ChannelPane::Shared, cx)
237
},
233
238
)
234
.debug_selector(|| "shell/islands/main/recap-tab".into());
235
header_tab_row().child(chat).child(recap).into_any_element()
239
.debug_selector(|| CHAT_SHARED_TAB_TAG.into());
240
let recap = with_recap.then(|| {
241
tab_label(
242
"chat-tab-recap".into(),
243
RECAP_LABEL,
244
pane == ChannelPane::Recap,
245
false,
246
move |_, cx| select(ChannelPane::Recap, cx),
247
)
248
.debug_selector(|| "shell/islands/main/recap-tab".into())
249
});
250
header_tab_row()
251
.child(chat)
252
.child(shared)
253
.children(recap)
254
.into_any_element()
236
255
}
237
256
238
257
#[cfg(test)]
@@ -27,6 +27,7 @@ pub const POSTS_LABEL: &str = "Posts";27
pub const SHARED_LABEL: &str = "Shared";27
pub const SHARED_LABEL: &str = "Shared";28
pub const CHAT_LABEL: &str = "Chat";28
pub const CHAT_LABEL: &str = "Chat";29
pub const RECAP_LABEL: &str = "Recap";29
pub const RECAP_LABEL: &str = "Recap";30
pub const CHAT_SHARED_TAB_TAG: &str = "shell/islands/main/chat-shared-tab";30
31
31
#[derive(Debug, Clone, Copy, PartialEq, Eq)]32
#[derive(Debug, Clone, Copy, PartialEq, Eq)]32
pub enum ChannelPane {33
pub enum ChannelPane {@@ -213,9 +214,10 @@ pub fn render_tab_bar(213
.into_any_element()214
.into_any_element()214
}215
}215
216
216
pub fn render_meeting_bar(pane: ChannelPane, select: SelectPane) -> AnyElement {217
/// Chat, Shared and, for meeting chats with a recording, Recap.218
pub fn render_chat_bar(pane: ChannelPane, with_recap: bool, select: SelectPane) -> AnyElement {217
let chat = tab_label(219
let chat = tab_label(218
"meeting-tab-chat".into(),220
"chat-tab-chat".into(),219
CHAT_LABEL,221
CHAT_LABEL,220
pane == ChannelPane::Posts,222
pane == ChannelPane::Posts,221
false,223
false,@@ -224,15 +226,32 @@ pub fn render_meeting_bar(pane: ChannelPane, select: SelectPane) -> AnyElement {224
move |_, cx| select(ChannelPane::Posts, cx)226
move |_, cx| select(ChannelPane::Posts, cx)225
},227
},226
);228
);227
let recap = tab_label(229
let shared = tab_label(228
"meeting-tab-recap".into(),230
"chat-tab-shared".into(),229
RECAP_LABEL,231
SHARED_LABEL,230
pane == ChannelPane::Recap,232
pane == ChannelPane::Shared,231
false,233
false,232
move |_, cx| select(ChannelPane::Recap, cx),234
{235
let select = select.clone();236
move |_, cx| select(ChannelPane::Shared, cx)237
},233
)238
)234
.debug_selector(|| "shell/islands/main/recap-tab".into());239
.debug_selector(|| CHAT_SHARED_TAB_TAG.into());235
header_tab_row().child(chat).child(recap).into_any_element()240
let recap = with_recap.then(|| {241
tab_label(242
"chat-tab-recap".into(),243
RECAP_LABEL,244
pane == ChannelPane::Recap,245
false,246
move |_, cx| select(ChannelPane::Recap, cx),247
)248
.debug_selector(|| "shell/islands/main/recap-tab".into())249
});250
header_tab_row()251
.child(chat)252
.child(shared)253
.children(recap)254
.into_any_element()236
}255
}237
256
238
#[cfg(test)]257
#[cfg(test)]@@ -3954,7 +3954,7 @@ impl Render for ConversationView {
3954
3954
Some(current) => {
3955
3955
let tab_bar = self
3956
3956
.render_tab_bar(window, cx)
3957
.or_else(|| self.render_meeting_tab_bar(cx));
3957
.or_else(|| self.render_chat_tab_bar(cx));
3958
3958
let (inline_tabs, tabs_row) = match tab_bar {
3959
3959
Some(tabs) if self.tabs_below_title(window) => (None, Some(tabs)),
3960
3960
tabs => (tabs, None),
@@ -4058,7 +4058,7 @@ impl Render for ConversationView {
4058
4058
)
4059
4059
.children(self.render_draft_error(cx).map(|error| runway(error, comfy)))
4060
4060
.when(
4061
!in_feed && !recap_active,
4061
!in_feed && !recap_active && !self.shared_active(),
4062
4062
|column| match &forward_selection {
4063
4063
Some(snapshot) => {
4064
4064
column.child(runway(self.render_forward_footer(snapshot, cx), comfy))
@@ -3954,7 +3954,7 @@ impl Render for ConversationView {3954
Some(current) => {3954
Some(current) => {3955
let tab_bar = self3955
let tab_bar = self3956
.render_tab_bar(window, cx)3956
.render_tab_bar(window, cx)3957
.or_else(|| self.render_meeting_tab_bar(cx));3957
.or_else(|| self.render_chat_tab_bar(cx));3958
let (inline_tabs, tabs_row) = match tab_bar {3958
let (inline_tabs, tabs_row) = match tab_bar {3959
Some(tabs) if self.tabs_below_title(window) => (None, Some(tabs)),3959
Some(tabs) if self.tabs_below_title(window) => (None, Some(tabs)),3960
tabs => (tabs, None),3960
tabs => (tabs, None),@@ -4058,7 +4058,7 @@ impl Render for ConversationView {4058
)4058
)4059
.children(self.render_draft_error(cx).map(|error| runway(error, comfy)))4059
.children(self.render_draft_error(cx).map(|error| runway(error, comfy)))4060
.when(4060
.when(4061
!in_feed && !recap_active,4061
!in_feed && !recap_active && !self.shared_active(),4062
|column| match &forward_selection {4062
|column| match &forward_selection {4063
Some(snapshot) => {4063
Some(snapshot) => {4064
column.child(runway(self.render_forward_footer(snapshot, cx), comfy))4064
column.child(runway(self.render_forward_footer(snapshot, cx), comfy))@@ -23,7 +23,7 @@ use crate::downloads::{self, DownloadState};
23
23
use crate::notice::short_error;
24
24
use crate::recap::{DELETE_QUESTION, Load, save_name};
25
25
use crate::runtime;
26
use crate::views::channel_tabs::{ChannelPane, render_meeting_bar};
26
use crate::views::channel_tabs::{ChannelPane, render_chat_bar};
27
27
use crate::views::recap_tab::{RecapCommand, RecapDownload, RecapRun, RecapView, render_recap};
28
28
use crate::views::shared_tab::{SharedCommand, SharedRun};
29
29
@@ -356,15 +356,16 @@ impl ConversationView {
356
356
.detach();
357
357
}
358
358
359
pub(super) fn render_meeting_tab_bar(&self, cx: &mut Context<Self>) -> Option<AnyElement> {
360
if self.occurrences().is_empty() || !self.is_meeting_chat(cx) {
359
pub(super) fn render_chat_tab_bar(&self, cx: &mut Context<Self>) -> Option<AnyElement> {
360
if !self.in_chat() {
361
361
return None;
362
362
}
363
let with_recap = !self.occurrences().is_empty() && self.is_meeting_chat(cx);
363
364
let view = cx.weak_entity();
364
365
let select = Rc::new(move |pane, cx: &mut App| {
365
366
view.update(cx, |this, cx| this.select_pane(pane, cx)).ok();
366
367
});
367
Some(render_meeting_bar(self.pane, select))
368
Some(render_chat_bar(self.pane, with_recap, select))
368
369
}
369
370
370
371
pub(super) fn render_recap(&self, cx: &mut Context<Self>) -> AnyElement {
@@ -23,7 +23,7 @@ use crate::downloads::{self, DownloadState};23
use crate::notice::short_error;23
use crate::notice::short_error;24
use crate::recap::{DELETE_QUESTION, Load, save_name};24
use crate::recap::{DELETE_QUESTION, Load, save_name};25
use crate::runtime;25
use crate::runtime;26
use crate::views::channel_tabs::{ChannelPane, render_meeting_bar};26
use crate::views::channel_tabs::{ChannelPane, render_chat_bar};27
use crate::views::recap_tab::{RecapCommand, RecapDownload, RecapRun, RecapView, render_recap};27
use crate::views::recap_tab::{RecapCommand, RecapDownload, RecapRun, RecapView, render_recap};28
use crate::views::shared_tab::{SharedCommand, SharedRun};28
use crate::views::shared_tab::{SharedCommand, SharedRun};29
29
@@ -356,15 +356,16 @@ impl ConversationView {356
.detach();356
.detach();357
}357
}358
358
359
pub(super) fn render_meeting_tab_bar(&self, cx: &mut Context<Self>) -> Option<AnyElement> {359
pub(super) fn render_chat_tab_bar(&self, cx: &mut Context<Self>) -> Option<AnyElement> {360
if self.occurrences().is_empty() || !self.is_meeting_chat(cx) {360
if !self.in_chat() {361
return None;361
return None;362
}362
}363
let with_recap = !self.occurrences().is_empty() && self.is_meeting_chat(cx);363
let view = cx.weak_entity();364
let view = cx.weak_entity();364
let select = Rc::new(move |pane, cx: &mut App| {365
let select = Rc::new(move |pane, cx: &mut App| {365
view.update(cx, |this, cx| this.select_pane(pane, cx)).ok();366
view.update(cx, |this, cx| this.select_pane(pane, cx)).ok();366
});367
});367
Some(render_meeting_bar(self.pane, select))368
Some(render_chat_bar(self.pane, with_recap, select))368
}369
}369
370
370
pub(super) fn render_recap(&self, cx: &mut Context<Self>) -> AnyElement {371
pub(super) fn render_recap(&self, cx: &mut Context<Self>) -> AnyElement {