feat(messages): Share to Outlook in the message menu
- "Share to Outlook" after Translate in chats and channels - Opens an Outlook on the web compose deeplink: subject = post subject or conversation title, plain text body = sender and time, message text, message link - Deviation: Teams opens an in-app compose dialog backed by shareToOutlookService (Outlook draft, sendEmailMessage, deleteShareToOutlookEmailDraft) and sends from there; that route is not verified, so we only open a new mail and send nothing - outlook_compose_link landed with the mentions commit in teams-core Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -45,6 +45,7 @@ pub mod scheduled;
45
45
pub mod scheduled_rows;
46
46
pub mod section_actions;
47
47
pub mod settings_section;
48
pub mod share_outlook;
48
49
pub mod sidebar_model;
49
50
pub mod sound_actions;
50
51
pub mod stored_outgoing;
@@ -45,6 +45,7 @@ pub mod scheduled;45
pub mod scheduled_rows;45
pub mod scheduled_rows;46
pub mod section_actions;46
pub mod section_actions;47
pub mod settings_section;47
pub mod settings_section;48
pub mod share_outlook;48
pub mod sidebar_model;49
pub mod sidebar_model;49
pub mod sound_actions;50
pub mod sound_actions;50
pub mod stored_outgoing;51
pub mod stored_outgoing;@@ -3111,6 +3111,7 @@ impl ConversationView {
3111
3111
copy: action(|this, key, _, cx| this.copy_text(key, cx)),
3112
3112
translate: Some(action(|this, key, _, cx| this.translate_message(key, cx))),
3113
3113
translate_label,
3114
share_to_outlook: Some(action(|this, key, _, cx| this.share_to_outlook(key, cx))),
3114
3115
save: Some(action(|this, key, _, cx| this.toggle_saved(key, cx))),
3115
3116
saved,
3116
3117
toggle_pinned: pinnable
@@ -3111,6 +3111,7 @@ impl ConversationView {3111
copy: action(|this, key, _, cx| this.copy_text(key, cx)),3111
copy: action(|this, key, _, cx| this.copy_text(key, cx)),3112
translate: Some(action(|this, key, _, cx| this.translate_message(key, cx))),3112
translate: Some(action(|this, key, _, cx| this.translate_message(key, cx))),3113
translate_label,3113
translate_label,3114
share_to_outlook: Some(action(|this, key, _, cx| this.share_to_outlook(key, cx))),3114
save: Some(action(|this, key, _, cx| this.toggle_saved(key, cx))),3115
save: Some(action(|this, key, _, cx| this.toggle_saved(key, cx))),3115
saved,3116
saved,3116
toggle_pinned: pinnable3117
toggle_pinned: pinnable@@ -9,7 +9,7 @@ use gpui_kit::component::WindowExt as _;
9
9
use gpui_kit::component::button::{Button, ButtonVariants as _};
10
10
use gpui_kit::component::dialog::DialogFooter;
11
11
12
use crate::app_state::{AppState, Selection};
12
use crate::app_state::{AppState, Selection, selection_title};
13
13
use crate::channel_menu::post_pin_dialog;
14
14
use crate::rows::reply_excerpt;
15
15
use crate::runtime;
@@ -253,6 +253,17 @@ impl ConversationView {
253
253
}
254
254
}
255
255
256
pub(super) fn share_to_outlook(&mut self, message_id: &str, cx: &mut Context<Self>) {
257
let Some(current) = self.current.as_ref() else {
258
return;
259
};
260
let conversation_id = current.selection.conversation_id().to_owned();
261
let title = selection_title(&self.app.read(cx).sidebar, ¤t.selection);
262
self.app.update(cx, |state, cx| {
263
state.share_to_outlook(&conversation_id, message_id, &title, cx)
264
});
265
}
266
256
267
pub(super) fn toggle_saved(&mut self, message_id: &str, cx: &mut Context<Self>) {
257
268
if let Some(conversation_id) = self.conversation_id() {
258
269
self.app.update(cx, |state, cx| {
@@ -9,7 +9,7 @@ use gpui_kit::component::WindowExt as _;9
use gpui_kit::component::button::{Button, ButtonVariants as _};9
use gpui_kit::component::button::{Button, ButtonVariants as _};10
use gpui_kit::component::dialog::DialogFooter;10
use gpui_kit::component::dialog::DialogFooter;11
11
12
use crate::app_state::{AppState, Selection};12
use crate::app_state::{AppState, Selection, selection_title};13
use crate::channel_menu::post_pin_dialog;13
use crate::channel_menu::post_pin_dialog;14
use crate::rows::reply_excerpt;14
use crate::rows::reply_excerpt;15
use crate::runtime;15
use crate::runtime;@@ -253,6 +253,17 @@ impl ConversationView {253
}253
}254
}254
}255
255
256
pub(super) fn share_to_outlook(&mut self, message_id: &str, cx: &mut Context<Self>) {257
let Some(current) = self.current.as_ref() else {258
return;259
};260
let conversation_id = current.selection.conversation_id().to_owned();261
let title = selection_title(&self.app.read(cx).sidebar, ¤t.selection);262
self.app.update(cx, |state, cx| {263
state.share_to_outlook(&conversation_id, message_id, &title, cx)264
});265
}266
256
pub(super) fn toggle_saved(&mut self, message_id: &str, cx: &mut Context<Self>) {267
pub(super) fn toggle_saved(&mut self, message_id: &str, cx: &mut Context<Self>) {257
if let Some(conversation_id) = self.conversation_id() {268
if let Some(conversation_id) = self.conversation_id() {258
self.app.update(cx, |state, cx| {269
self.app.update(cx, |state, cx| {@@ -17,6 +17,7 @@ use super::toolbar_placement::{HoverChange, TOOLBAR_HEIGHT, toolbar_slot};
17
17
use super::widgets::{icon, symbol};
18
18
use crate::forward_selection::{FORWARD_LABEL, MULTIPLE_MESSAGES_LABEL, THIS_MESSAGE_LABEL};
19
19
use crate::rows::reaction_glyph;
20
use crate::share_outlook::SHARE_TO_OUTLOOK_LABEL;
20
21
use crate::theme::{self, ElevatedSurface as _};
21
22
22
23
const BAR_BUTTON: f32 = 30.;
@@ -47,6 +48,7 @@ pub struct MessageMenu {
47
48
pub copy: Action,
48
49
pub translate: Option<Action>,
49
50
pub translate_label: &'static str,
51
pub share_to_outlook: Option<Action>,
50
52
pub save: Option<Action>,
51
53
pub saved: bool,
52
54
pub toggle_pinned: Option<Action>,
@@ -199,6 +201,7 @@ fn more_button(menu: &MessageMenu, cx: &App) -> AnyElement {
199
201
delete,
200
202
mark_unread,
201
203
refresh_card,
204
share_to_outlook,
202
205
pin,
203
206
) = (
204
207
menu.reply.clone(),
@@ -212,6 +215,7 @@ fn more_button(menu: &MessageMenu, cx: &App) -> AnyElement {
212
215
menu.delete.clone(),
213
216
menu.mark_unread.clone(),
214
217
menu.refresh_card.clone(),
218
menu.share_to_outlook.clone(),
215
219
menu.pin.clone(),
216
220
);
217
221
let (saved, pinned, translate_label) = (menu.saved, menu.pinned, menu.translate_label);
@@ -266,6 +270,13 @@ fn more_button(menu: &MessageMenu, cx: &App) -> AnyElement {
266
270
if let Some(translate) = translate.clone() {
267
271
popup = popup.item(item(translate_label, IconName::Languages, translate));
268
272
}
273
if let Some(share_to_outlook) = share_to_outlook.clone() {
274
popup = popup.item(item(
275
SHARE_TO_OUTLOOK_LABEL,
276
IconName::Mail,
277
share_to_outlook,
278
));
279
}
269
280
if let Some(save) = save.clone() {
270
281
popup = popup.item(if saved {
271
282
item("Unsave message", IconName::BookmarkOff, save)
@@ -17,6 +17,7 @@ use super::toolbar_placement::{HoverChange, TOOLBAR_HEIGHT, toolbar_slot};17
use super::widgets::{icon, symbol};17
use super::widgets::{icon, symbol};18
use crate::forward_selection::{FORWARD_LABEL, MULTIPLE_MESSAGES_LABEL, THIS_MESSAGE_LABEL};18
use crate::forward_selection::{FORWARD_LABEL, MULTIPLE_MESSAGES_LABEL, THIS_MESSAGE_LABEL};19
use crate::rows::reaction_glyph;19
use crate::rows::reaction_glyph;20
use crate::share_outlook::SHARE_TO_OUTLOOK_LABEL;20
use crate::theme::{self, ElevatedSurface as _};21
use crate::theme::{self, ElevatedSurface as _};21
22
22
const BAR_BUTTON: f32 = 30.;23
const BAR_BUTTON: f32 = 30.;@@ -47,6 +48,7 @@ pub struct MessageMenu {47
pub copy: Action,48
pub copy: Action,48
pub translate: Option<Action>,49
pub translate: Option<Action>,49
pub translate_label: &'static str,50
pub translate_label: &'static str,51
pub share_to_outlook: Option<Action>,50
pub save: Option<Action>,52
pub save: Option<Action>,51
pub saved: bool,53
pub saved: bool,52
pub toggle_pinned: Option<Action>,54
pub toggle_pinned: Option<Action>,@@ -199,6 +201,7 @@ fn more_button(menu: &MessageMenu, cx: &App) -> AnyElement {199
delete,201
delete,200
mark_unread,202
mark_unread,201
refresh_card,203
refresh_card,204
share_to_outlook,202
pin,205
pin,203
) = (206
) = (204
menu.reply.clone(),207
menu.reply.clone(),@@ -212,6 +215,7 @@ fn more_button(menu: &MessageMenu, cx: &App) -> AnyElement {212
menu.delete.clone(),215
menu.delete.clone(),213
menu.mark_unread.clone(),216
menu.mark_unread.clone(),214
menu.refresh_card.clone(),217
menu.refresh_card.clone(),218
menu.share_to_outlook.clone(),215
menu.pin.clone(),219
menu.pin.clone(),216
);220
);217
let (saved, pinned, translate_label) = (menu.saved, menu.pinned, menu.translate_label);221
let (saved, pinned, translate_label) = (menu.saved, menu.pinned, menu.translate_label);@@ -266,6 +270,13 @@ fn more_button(menu: &MessageMenu, cx: &App) -> AnyElement {266
if let Some(translate) = translate.clone() {270
if let Some(translate) = translate.clone() {267
popup = popup.item(item(translate_label, IconName::Languages, translate));271
popup = popup.item(item(translate_label, IconName::Languages, translate));268
}272
}273
if let Some(share_to_outlook) = share_to_outlook.clone() {274
popup = popup.item(item(275
SHARE_TO_OUTLOOK_LABEL,276
IconName::Mail,277
share_to_outlook,278
));279
}269
if let Some(save) = save.clone() {280
if let Some(save) = save.clone() {270
popup = popup.item(if saved {281
popup = popup.item(if saved {271
item("Unsave message", IconName::BookmarkOff, save)282
item("Unsave message", IconName::BookmarkOff, save)