feat(parity): profile menu and settings menu like Teams
- Profile menu: status, Pause notifications (30 min to this week, resume), work location, status message, View account link - Paused notifications stay silent, also urgent ones; pause survives a restart - New ... button next to the avatar: Settings, chat list, translation, notifications, test call, zoom Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -164,6 +164,7 @@ pub struct AppState {
164
164
pub forward_selection: Option<ForwardSelection>,
165
165
pub image_viewer_request: Option<ViewerRequest>,
166
166
pub own_status: PresenceStatus,
167
pub notifications_paused_until: Option<chrono::DateTime<chrono::Utc>>,
167
168
pub own_email: String,
168
169
pub own_time_zone: Option<String>,
169
170
pub own_time_zone_requested: bool,
@@ -264,6 +265,7 @@ impl AppState {
264
265
pub fn new(store: Arc<Store>, mode: Mode) -> Self {
265
266
let sidebar = store.sidebar().unwrap_or_default();
266
267
let speed_dial = crate::call::speed_dial::load(&store);
268
let notifications_paused_until = crate::notify::pause::load(&store);
267
269
let chat_settings = teams_core::stored_chat_settings(&store);
268
270
let markdown_mode = crate::chat_settings_actions::stored_markdown_mode(&store);
269
271
let actions_on_right_click =
@@ -322,6 +324,7 @@ impl AppState {
322
324
forward_selection: None,
323
325
image_viewer_request: None,
324
326
own_status: PresenceStatus::default(),
327
notifications_paused_until,
325
328
own_email: String::new(),
326
329
own_time_zone: None,
327
330
own_time_zone_requested: false,
@@ -164,6 +164,7 @@ pub struct AppState {164
pub forward_selection: Option<ForwardSelection>,164
pub forward_selection: Option<ForwardSelection>,165
pub image_viewer_request: Option<ViewerRequest>,165
pub image_viewer_request: Option<ViewerRequest>,166
pub own_status: PresenceStatus,166
pub own_status: PresenceStatus,167
pub notifications_paused_until: Option<chrono::DateTime<chrono::Utc>>,167
pub own_email: String,168
pub own_email: String,168
pub own_time_zone: Option<String>,169
pub own_time_zone: Option<String>,169
pub own_time_zone_requested: bool,170
pub own_time_zone_requested: bool,@@ -264,6 +265,7 @@ impl AppState {264
pub fn new(store: Arc<Store>, mode: Mode) -> Self {265
pub fn new(store: Arc<Store>, mode: Mode) -> Self {265
let sidebar = store.sidebar().unwrap_or_default();266
let sidebar = store.sidebar().unwrap_or_default();266
let speed_dial = crate::call::speed_dial::load(&store);267
let speed_dial = crate::call::speed_dial::load(&store);268
let notifications_paused_until = crate::notify::pause::load(&store);267
let chat_settings = teams_core::stored_chat_settings(&store);269
let chat_settings = teams_core::stored_chat_settings(&store);268
let markdown_mode = crate::chat_settings_actions::stored_markdown_mode(&store);270
let markdown_mode = crate::chat_settings_actions::stored_markdown_mode(&store);269
let actions_on_right_click =271
let actions_on_right_click =@@ -322,6 +324,7 @@ impl AppState {322
forward_selection: None,324
forward_selection: None,323
image_viewer_request: None,325
image_viewer_request: None,324
own_status: PresenceStatus::default(),326
own_status: PresenceStatus::default(),327
notifications_paused_until,325
own_email: String::new(),328
own_email: String::new(),326
own_time_zone: None,329
own_time_zone: None,327
own_time_zone_requested: false,330
own_time_zone_requested: false,@@ -1,5 +1,6 @@
1
1
pub mod incoming;
2
2
pub mod layout;
3
pub mod pause;
3
4
pub mod rules;
4
5
pub mod settings;
5
6
pub mod stack;
@@ -1,5 +1,6 @@1
pub mod incoming;1
pub mod incoming;2
pub mod layout;2
pub mod layout;3
pub mod pause;3
pub mod rules;4
pub mod rules;4
pub mod settings;5
pub mod settings;5
pub mod stack;6
pub mod stack;@@ -0,0 +1,65 @@
1
use chrono::{DateTime, Local, Utc};
2
use gpui_kit::Context;
3
use store::Store;
4
5
use crate::app_state::AppState;
6
use crate::own_status::until_label;
7
8
const META_KEY: &str = "notify_paused_until";
9
pub const PAUSE_LABEL: &str = "Pause notifications";
10
11
pub fn load(store: &Store) -> Option<DateTime<Utc>> {
12
store
13
.meta(META_KEY)
14
.ok()
15
.flatten()
16
.and_then(|text| DateTime::parse_from_rfc3339(&text).ok())
17
.map(|until| until.with_timezone(&Utc))
18
}
19
20
pub fn is_paused(until: Option<DateTime<Utc>>, now: DateTime<Utc>) -> bool {
21
until.is_some_and(|until| now < until)
22
}
23
24
pub fn menu_label(until: Option<DateTime<Utc>>, now: DateTime<Local>) -> String {
25
match until.filter(|until| now.with_timezone(&Utc) < *until) {
26
Some(until) => format!("Paused {}", until_label(until, &now)),
27
None => PAUSE_LABEL.to_owned(),
28
}
29
}
30
31
impl AppState {
32
pub fn notifications_paused(&self, now: DateTime<Utc>) -> bool {
33
is_paused(self.notifications_paused_until, now)
34
}
35
36
pub fn pause_notifications(&mut self, until: DateTime<Utc>, cx: &mut Context<Self>) {
37
let _ = self.store.set_meta(META_KEY, &until.to_rfc3339());
38
self.notifications_paused_until = Some(until);
39
cx.notify();
40
}
41
42
pub fn resume_notifications(&mut self, cx: &mut Context<Self>) {
43
let _ = self.store.set_meta(META_KEY, "");
44
self.notifications_paused_until = None;
45
cx.notify();
46
}
47
}
48
49
#[cfg(test)]
50
mod tests {
51
use chrono::TimeZone;
52
53
use super::*;
54
55
#[test]
56
fn a_pause_ends_at_its_time() {
57
let until = Utc.with_ymd_and_hms(2026, 11, 8, 15, 0, 0).unwrap();
58
let before = Utc.with_ymd_and_hms(2026, 11, 8, 14, 59, 0).unwrap();
59
assert!(is_paused(Some(until), before));
60
assert!(!is_paused(Some(until), until));
61
assert!(!is_paused(None, before));
62
let later = Local.from_utc_datetime(&until.naive_utc());
63
assert_eq!(menu_label(Some(until), later), PAUSE_LABEL);
64
}
65
}
@@ -0,0 +1,65 @@1
use chrono::{DateTime, Local, Utc};2
use gpui_kit::Context;3
use store::Store;4
5
use crate::app_state::AppState;6
use crate::own_status::until_label;7
8
const META_KEY: &str = "notify_paused_until";9
pub const PAUSE_LABEL: &str = "Pause notifications";10
11
pub fn load(store: &Store) -> Option<DateTime<Utc>> {12
store13
.meta(META_KEY)14
.ok()15
.flatten()16
.and_then(|text| DateTime::parse_from_rfc3339(&text).ok())17
.map(|until| until.with_timezone(&Utc))18
}19
20
pub fn is_paused(until: Option<DateTime<Utc>>, now: DateTime<Utc>) -> bool {21
until.is_some_and(|until| now < until)22
}23
24
pub fn menu_label(until: Option<DateTime<Utc>>, now: DateTime<Local>) -> String {25
match until.filter(|until| now.with_timezone(&Utc) < *until) {26
Some(until) => format!("Paused {}", until_label(until, &now)),27
None => PAUSE_LABEL.to_owned(),28
}29
}30
31
impl AppState {32
pub fn notifications_paused(&self, now: DateTime<Utc>) -> bool {33
is_paused(self.notifications_paused_until, now)34
}35
36
pub fn pause_notifications(&mut self, until: DateTime<Utc>, cx: &mut Context<Self>) {37
let _ = self.store.set_meta(META_KEY, &until.to_rfc3339());38
self.notifications_paused_until = Some(until);39
cx.notify();40
}41
42
pub fn resume_notifications(&mut self, cx: &mut Context<Self>) {43
let _ = self.store.set_meta(META_KEY, "");44
self.notifications_paused_until = None;45
cx.notify();46
}47
}48
49
#[cfg(test)]50
mod tests {51
use chrono::TimeZone;52
53
use super::*;54
55
#[test]56
fn a_pause_ends_at_its_time() {57
let until = Utc.with_ymd_and_hms(2026, 11, 8, 15, 0, 0).unwrap();58
let before = Utc.with_ymd_and_hms(2026, 11, 8, 14, 59, 0).unwrap();59
assert!(is_paused(Some(until), before));60
assert!(!is_paused(Some(until), until));61
assert!(!is_paused(None, before));62
let later = Local.from_utc_datetime(&until.naive_utc());63
assert_eq!(menu_label(Some(until), later), PAUSE_LABEL);64
}65
}@@ -156,6 +156,7 @@ pub struct Environment {
156
156
pub chat_in_foreground: bool,
157
157
pub system_quiet: bool,
158
158
pub own_do_not_disturb: bool,
159
pub paused: bool,
159
160
pub own_busy: bool,
160
161
pub in_call: bool,
161
162
}
@@ -260,6 +261,7 @@ pub fn decide(settings: &Settings, incoming: &Incoming, environment: Environment
260
261
|| environment.chat_in_foreground
261
262
|| environment.system_quiet
262
263
|| (environment.own_do_not_disturb && !urgent)
264
|| environment.paused
263
265
|| settings.do_not_disturb
264
266
|| (settings.mute_in_calls && environment.in_call)
265
267
|| (!urgent && !account_toasts(&settings.account, incoming));
@@ -284,6 +286,7 @@ pub fn decide_proposal(
284
286
|| environment.chat_in_foreground
285
287
|| environment.system_quiet
286
288
|| environment.own_do_not_disturb
289
|| environment.paused
287
290
|| settings.do_not_disturb
288
291
|| (settings.mute_in_calls && environment.in_call);
289
292
if suppressed {
@@ -372,6 +375,17 @@ mod tests {
372
375
incoming(ChatKind::Group { member_count: 5 })
373
376
}
374
377
378
#[test]
379
fn paused_notifications_stay_silent_even_when_urgent() {
380
let mut incoming = incoming(ChatKind::Direct);
381
incoming.importance = MessageImportance::Urgent;
382
let paused = Environment {
383
paused: true,
384
..Environment::default()
385
};
386
assert_eq!(decide(&Settings::default(), &incoming, paused), SILENT);
387
}
388
375
389
#[test]
376
390
fn plain_message_gets_toast_and_sound() {
377
391
let decision = decide(&Settings::default(), &group(), Environment::default());
@@ -156,6 +156,7 @@ pub struct Environment {156
pub chat_in_foreground: bool,156
pub chat_in_foreground: bool,157
pub system_quiet: bool,157
pub system_quiet: bool,158
pub own_do_not_disturb: bool,158
pub own_do_not_disturb: bool,159
pub paused: bool,159
pub own_busy: bool,160
pub own_busy: bool,160
pub in_call: bool,161
pub in_call: bool,161
}162
}@@ -260,6 +261,7 @@ pub fn decide(settings: &Settings, incoming: &Incoming, environment: Environment260
|| environment.chat_in_foreground261
|| environment.chat_in_foreground261
|| environment.system_quiet262
|| environment.system_quiet262
|| (environment.own_do_not_disturb && !urgent)263
|| (environment.own_do_not_disturb && !urgent)264
|| environment.paused263
|| settings.do_not_disturb265
|| settings.do_not_disturb264
|| (settings.mute_in_calls && environment.in_call)266
|| (settings.mute_in_calls && environment.in_call)265
|| (!urgent && !account_toasts(&settings.account, incoming));267
|| (!urgent && !account_toasts(&settings.account, incoming));@@ -284,6 +286,7 @@ pub fn decide_proposal(284
|| environment.chat_in_foreground286
|| environment.chat_in_foreground285
|| environment.system_quiet287
|| environment.system_quiet286
|| environment.own_do_not_disturb288
|| environment.own_do_not_disturb289
|| environment.paused287
|| settings.do_not_disturb290
|| settings.do_not_disturb288
|| (settings.mute_in_calls && environment.in_call);291
|| (settings.mute_in_calls && environment.in_call);289
if suppressed {292
if suppressed {@@ -372,6 +375,17 @@ mod tests {372
incoming(ChatKind::Group { member_count: 5 })375
incoming(ChatKind::Group { member_count: 5 })373
}376
}374
377
378
#[test]379
fn paused_notifications_stay_silent_even_when_urgent() {380
let mut incoming = incoming(ChatKind::Direct);381
incoming.importance = MessageImportance::Urgent;382
let paused = Environment {383
paused: true,384
..Environment::default()385
};386
assert_eq!(decide(&Settings::default(), &incoming, paused), SILENT);387
}388
375
#[test]389
#[test]376
fn plain_message_gets_toast_and_sound() {390
fn plain_message_gets_toast_and_sound() {377
let decision = decide(&Settings::default(), &group(), Environment::default());391
let decision = decide(&Settings::default(), &group(), Environment::default());@@ -439,10 +439,12 @@ impl NotificationCenter {
439
439
_ => false,
440
440
};
441
441
let in_call = in_call(server_in_call, state.call.as_ref().map(|call| &call.model));
442
let paused = state.notifications_paused(chrono::Utc::now());
442
443
Environment {
443
444
chat_in_foreground: selected && self.main_window_active(cx),
444
445
system_quiet: platform::system_quiet(),
445
446
own_do_not_disturb,
447
paused,
446
448
own_busy,
447
449
in_call,
448
450
}
@@ -439,10 +439,12 @@ impl NotificationCenter {439
_ => false,439
_ => false,440
};440
};441
let in_call = in_call(server_in_call, state.call.as_ref().map(|call| &call.model));441
let in_call = in_call(server_in_call, state.call.as_ref().map(|call| &call.model));442
let paused = state.notifications_paused(chrono::Utc::now());442
Environment {443
Environment {443
chat_in_foreground: selected && self.main_window_active(cx),444
chat_in_foreground: selected && self.main_window_active(cx),444
system_quiet: platform::system_quiet(),445
system_quiet: platform::system_quiet(),445
own_do_not_disturb,446
own_do_not_disturb,447
paused,446
own_busy,448
own_busy,447
in_call,449
in_call,448
}450
}@@ -40,7 +40,7 @@ use app_ui_kit::render::hooks::RenderHooks;
40
40
use app_ui_kit::layout::{ISLAND_GAP, RAIL_WIDTH, SIDEBAR_WIDTH};
41
41
use super::connection_banner::render_connection_banner;
42
42
use super::notice_toast::NoticeToasts;
43
use super::status_menu::own_status_button;
43
use super::status_menu::{own_status_button, settings_more_button};
44
44
use super::status_message_dialog::{StatusMessageDialog, StatusMessageDialogEvent};
45
45
use super::switcher::{Switcher, SwitcherEvent, candidates_from};
46
46
use super::title_bar::{mode_label, render_title_bar, update_button};
@@ -1069,6 +1069,7 @@ impl Render for AppShell {
1069
1069
&self.update,
1070
1070
cx.listener(|this, _, _, cx| this.restart_into_update(cx)),
1071
1071
),
1072
Some(settings_more_button(&self.state)),
1072
1073
own_status_button(&self.state, state),
1073
1074
]
1074
1075
.into_iter()
@@ -40,7 +40,7 @@ use app_ui_kit::render::hooks::RenderHooks;40
use app_ui_kit::layout::{ISLAND_GAP, RAIL_WIDTH, SIDEBAR_WIDTH};40
use app_ui_kit::layout::{ISLAND_GAP, RAIL_WIDTH, SIDEBAR_WIDTH};41
use super::connection_banner::render_connection_banner;41
use super::connection_banner::render_connection_banner;42
use super::notice_toast::NoticeToasts;42
use super::notice_toast::NoticeToasts;43
use super::status_menu::own_status_button;43
use super::status_menu::{own_status_button, settings_more_button};44
use super::status_message_dialog::{StatusMessageDialog, StatusMessageDialogEvent};44
use super::status_message_dialog::{StatusMessageDialog, StatusMessageDialogEvent};45
use super::switcher::{Switcher, SwitcherEvent, candidates_from};45
use super::switcher::{Switcher, SwitcherEvent, candidates_from};46
use super::title_bar::{mode_label, render_title_bar, update_button};46
use super::title_bar::{mode_label, render_title_bar, update_button};@@ -1069,6 +1069,7 @@ impl Render for AppShell {1069
&self.update,1069
&self.update,1070
cx.listener(|this, _, _, cx| this.restart_into_update(cx)),1070
cx.listener(|this, _, _, cx| this.restart_into_update(cx)),1071
),1071
),1072
Some(settings_more_button(&self.state)),1072
own_status_button(&self.state, state),1073
own_status_button(&self.state, state),1073
]1074
]1074
.into_iter()1075
.into_iter()