File tree Expand file tree Collapse file tree
Core/Sources/SuggestionWidget Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,14 @@ struct ChatWindowView: View {
5050 }
5151 . opacity ( 0 )
5252 . keyboardShortcut ( " M " , modifiers: [ . command] )
53+
54+ Button ( action: {
55+ viewStore. send ( . closeActiveTabClicked)
56+ } ) {
57+ EmptyView ( )
58+ }
59+ . opacity ( 0 )
60+ . keyboardShortcut ( " W " , modifiers: [ . command] )
5361 }
5462 . background ( . regularMaterial)
5563 . xcodeStyleFrame ( )
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ public struct ChatPanelFeature: ReducerProtocol {
4040 public enum Action : Equatable {
4141 // Window
4242 case hideButtonClicked
43+ case closeActiveTabClicked
4344 case toggleChatPanelDetachedButtonClicked
4445 case detachChatPanel
4546 case attachChatPanel
@@ -67,7 +68,17 @@ public struct ChatPanelFeature: ReducerProtocol {
6768 return . run { _ in
6869 await activatePreviouslyActiveXcode ( )
6970 }
70-
71+
72+ case . closeActiveTabClicked:
73+ if let id = state. chatTapGroup. selectedTabId {
74+ return . run { send in
75+ await send ( . closeTabButtonClicked( id: id) )
76+ }
77+ }
78+
79+ state. isPanelDisplayed = false
80+ return . none
81+
7182 case . toggleChatPanelDetachedButtonClicked:
7283 state. chatPanelInASeparateWindow. toggle ( )
7384 return . none
@@ -111,6 +122,9 @@ public struct ChatPanelFeature: ReducerProtocol {
111122
112123 case let . closeTabButtonClicked( id) :
113124 state. chatTapGroup. tabs. removeAll { $0. id == id }
125+ if state. chatTapGroup. tabs. isEmpty {
126+ state. isPanelDisplayed = false
127+ }
114128 return . none
115129
116130 case . createNewTapButtonClicked:
You can’t perform that action at this time.
0 commit comments