@@ -70,12 +70,19 @@ struct ChatContextMenu: View {
7070
7171 @ViewBuilder
7272 var chatModel : some View {
73+ let allModels = chatModels + [ . init(
74+ id: " com.github.copilot " ,
75+ name: " GitHub Copilot (poc) " ,
76+ format: . openAI,
77+ info: . init( )
78+ ) ]
79+
7380 Menu ( " Chat Model " ) {
7481 Button ( action: {
7582 store. send ( . chatModelIdOverrideSelected( nil ) )
7683 } ) {
7784 HStack {
78- if let defaultModel = chatModels
85+ if let defaultModel = allModels
7986 . first ( where: { $0. id == defaultChatModelId } )
8087 {
8188 Text ( " Default ( \( defaultModel. name) ) " )
@@ -88,7 +95,7 @@ struct ChatContextMenu: View {
8895 }
8996 }
9097
91- if let id = store. chatModelIdOverride, !chatModels . map ( \. id) . contains ( id) {
98+ if let id = store. chatModelIdOverride, !allModels . map ( \. id) . contains ( id) {
9299 Button ( action: {
93100 store. send ( . chatModelIdOverrideSelected( nil ) )
94101 } ) {
@@ -101,7 +108,7 @@ struct ChatContextMenu: View {
101108
102109 Divider ( )
103110
104- ForEach ( chatModels , id: \. id) { model in
111+ ForEach ( allModels , id: \. id) { model in
105112 Button ( action: {
106113 store. send ( . chatModelIdOverrideSelected( model. id) )
107114 } ) {
@@ -152,26 +159,26 @@ struct ChatContextMenu: View {
152159 @ViewBuilder
153160 var defaultScopes : some View {
154161 Menu ( " Default Scopes " ) {
162+ Button ( action: {
163+ store. send ( . resetDefaultScopesButtonTapped)
164+ } ) {
165+ Text ( " Reset Default Scopes " )
166+ }
167+
168+ Divider ( )
169+
170+ ForEach ( ChatService . Scope. allCases, id: \. rawValue) { value in
155171 Button ( action: {
156- store. send ( . resetDefaultScopesButtonTapped )
172+ store. send ( . toggleScope ( value ) )
157173 } ) {
158- Text ( " Reset Default Scopes " )
159- }
160-
161- Divider ( )
162-
163- ForEach ( ChatService . Scope. allCases, id: \. rawValue) { value in
164- Button ( action: {
165- store. send ( . toggleScope( value) )
166- } ) {
167- HStack {
168- Text ( " @ " + value. rawValue)
169- if store. defaultScopes. contains ( value) {
170- Image ( systemName: " checkmark " )
171- }
174+ HStack {
175+ Text ( " @ " + value. rawValue)
176+ if store. defaultScopes. contains ( value) {
177+ Image ( systemName: " checkmark " )
172178 }
173179 }
174180 }
181+ }
175182 }
176183 }
177184
0 commit comments