BlueGit

ict rusty-teams

fix(parity): keep shortcuts working after the Teams rail opens a channel

- the channel feed takes focus when it opens, so the hidden chat composer no longer swallows actions
- leaving the calendar reacts to the selection event instead of a render-time diff

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-11-08 · 3 weeks ago

Hash
00c7763d8de2f116ed9e1edc018c0bf11a246391
Parent
7a908a34
2 files changed +7 −9
crates/app/src/views/conversation.rs +3 −1
@@ -982,7 +982,9 @@ impl ConversationView {
982 982 composer.set_conversation(&conversation_id, window, cx);
983 983 });
984 984 self.sync_reply_composer(window, cx);
985 if !self.draft_active && !self.in_feed() {
985 if self.in_feed() {
986 window.focus(&self.focus_handle, cx);
987 } else if !self.draft_active {
986 988 self.composer
987 989 .update(cx, |composer, cx| composer.focus(window, cx));
988 990 }
@@ -982,7 +982,9 @@ impl ConversationView {
982 composer.set_conversation(&conversation_id, window, cx);
982 composer.set_conversation(&conversation_id, window, cx);
983 });
983 });
984 self.sync_reply_composer(window, cx);
984 self.sync_reply_composer(window, cx);
985 if !self.draft_active && !self.in_feed() {
985 if self.in_feed() {
986 window.focus(&self.focus_handle, cx);
987 } else if !self.draft_active {
986 self.composer
988 self.composer
987 .update(cx, |composer, cx| composer.focus(window, cx));
989 .update(cx, |composer, cx| composer.focus(window, cx));
988 }
990 }
crates/app/src/views/shell.rs +4 −8
@@ -154,7 +154,6 @@ pub struct AppShell {
154 154 rail: Entity<RailView>,
155 155 sidebar: Entity<SidebarView>,
156 156 calendar: Entity<CalendarView>,
157 shown_selection: Option<Selection>,
158 157 conversation: Entity<ConversationView>,
159 158 call_chat: Option<(String, Entity<ConversationView>)>,
160 159 prejoin: Option<Entity<PrejoinView>>,
@@ -213,14 +212,10 @@ impl AppShell {
213 212 }
214 213
215 214 fn leave_calendar_on_selection(&mut self, cx: &mut Context<Self>) {
216 let selection = self.state.read(cx).selection.clone();
217 if selection == self.shown_selection {
218 return;
219 }
220 self.shown_selection = selection.clone();
221 215 if self.sidebar.read(cx).tab() != SidebarTab::Calendar {
222 216 return;
223 217 }
218 let selection = self.state.read(cx).selection.clone();
224 219 let sidebar = self.sidebar.clone();
225 220 cx.defer(move |cx| {
226 221 sidebar.update(cx, |sidebar, cx| match selection {
@@ -340,6 +335,9 @@ impl AppShell {
340 335 if matches!(event, AppEvent::Sidebar | AppEvent::Status) {
341 336 this.apply_open_target(cx);
342 337 }
338 if matches!(event, AppEvent::Selection) {
339 this.leave_calendar_on_selection(cx);
340 }
343 341 if matches!(event, AppEvent::Forward) {
344 342 this.open_forward_dialog(window, cx);
345 343 }
@@ -389,7 +387,6 @@ impl AppShell {
389 387 rail,
390 388 sidebar,
391 389 calendar,
392 shown_selection: None,
393 390 conversation,
394 391 call_chat: None,
395 392 prejoin: None,
@@ -978,7 +975,6 @@ impl Render for AppShell {
978 975 let chat_thread = self.state.read(cx).call_chat_thread();
979 976 self.sync_call_chat(chat_thread, window, cx);
980 977 self.sync_prejoin(window, cx);
981 self.leave_calendar_on_selection(cx);
982 978 let notice = self.state.read(cx).notice.clone();
983 979 self.toasts.sync(&self.state, notice.as_ref(), window, cx);
984 980 let update_failure = match &self.update {
@@ -154,7 +154,6 @@ pub struct AppShell {
154 rail: Entity<RailView>,
154 rail: Entity<RailView>,
155 sidebar: Entity<SidebarView>,
155 sidebar: Entity<SidebarView>,
156 calendar: Entity<CalendarView>,
156 calendar: Entity<CalendarView>,
157 shown_selection: Option<Selection>,
158 conversation: Entity<ConversationView>,
157 conversation: Entity<ConversationView>,
159 call_chat: Option<(String, Entity<ConversationView>)>,
158 call_chat: Option<(String, Entity<ConversationView>)>,
160 prejoin: Option<Entity<PrejoinView>>,
159 prejoin: Option<Entity<PrejoinView>>,
@@ -213,14 +212,10 @@ impl AppShell {
213 }
212 }
214
213
215 fn leave_calendar_on_selection(&mut self, cx: &mut Context<Self>) {
214 fn leave_calendar_on_selection(&mut self, cx: &mut Context<Self>) {
216 let selection = self.state.read(cx).selection.clone();
217 if selection == self.shown_selection {
218 return;
219 }
220 self.shown_selection = selection.clone();
221 if self.sidebar.read(cx).tab() != SidebarTab::Calendar {
215 if self.sidebar.read(cx).tab() != SidebarTab::Calendar {
222 return;
216 return;
223 }
217 }
218 let selection = self.state.read(cx).selection.clone();
224 let sidebar = self.sidebar.clone();
219 let sidebar = self.sidebar.clone();
225 cx.defer(move |cx| {
220 cx.defer(move |cx| {
226 sidebar.update(cx, |sidebar, cx| match selection {
221 sidebar.update(cx, |sidebar, cx| match selection {
@@ -340,6 +335,9 @@ impl AppShell {
340 if matches!(event, AppEvent::Sidebar | AppEvent::Status) {
335 if matches!(event, AppEvent::Sidebar | AppEvent::Status) {
341 this.apply_open_target(cx);
336 this.apply_open_target(cx);
342 }
337 }
338 if matches!(event, AppEvent::Selection) {
339 this.leave_calendar_on_selection(cx);
340 }
343 if matches!(event, AppEvent::Forward) {
341 if matches!(event, AppEvent::Forward) {
344 this.open_forward_dialog(window, cx);
342 this.open_forward_dialog(window, cx);
345 }
343 }
@@ -389,7 +387,6 @@ impl AppShell {
389 rail,
387 rail,
390 sidebar,
388 sidebar,
391 calendar,
389 calendar,
392 shown_selection: None,
393 conversation,
390 conversation,
394 call_chat: None,
391 call_chat: None,
395 prejoin: None,
392 prejoin: None,
@@ -978,7 +975,6 @@ impl Render for AppShell {
978 let chat_thread = self.state.read(cx).call_chat_thread();
975 let chat_thread = self.state.read(cx).call_chat_thread();
979 self.sync_call_chat(chat_thread, window, cx);
976 self.sync_call_chat(chat_thread, window, cx);
980 self.sync_prejoin(window, cx);
977 self.sync_prejoin(window, cx);
981 self.leave_calendar_on_selection(cx);
982 let notice = self.state.read(cx).notice.clone();
978 let notice = self.state.read(cx).notice.clone();
983 self.toasts.sync(&self.state, notice.as_ref(), window, cx);
979 self.toasts.sync(&self.state, notice.as_ref(), window, cx);
984 let update_failure = match &self.update {
980 let update_failure = match &self.update {