File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Service/SuggestionCommandHandler
SuggestionWidget/FeatureReducers Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -284,7 +284,7 @@ struct PseudoCommandHandler: CommandHandler {
284284 usesTabsForIndentation: filespace. codeMetadata. usesTabsForIndentation ?? false ,
285285 commandName: nil ,
286286 isContinuous: false
287- ) ) ) )
287+ ) , sendImmediately : false ) ) )
288288 } catch {
289289 toast. toast ( content: error. localizedDescription, type: . error)
290290 }
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public struct PromptToCodeGroup {
3232 public enum Action {
3333 /// Activate the prompt to code if it exists or create it if it doesn't
3434 case activateOrCreatePromptToCode( PromptToCodePanel . State )
35- case createPromptToCode( PromptToCodePanel . State )
35+ case createPromptToCode( PromptToCodePanel . State , sendImmediately : Bool )
3636 case updatePromptToCodeRange(
3737 id: PromptToCodePanel . State . ID ,
3838 snippetId: UUID ,
@@ -58,13 +58,13 @@ public struct PromptToCodeGroup {
5858 }
5959 }
6060 return . run { send in
61- await send ( . createPromptToCode( s) )
61+ await send ( . createPromptToCode( s, sendImmediately : false ) )
6262 }
63- case let . createPromptToCode( newPromptToCode) :
63+ case let . createPromptToCode( newPromptToCode, sendImmediately ) :
6464 // insert at 0 so it has high priority then the other detached prompt to codes
6565 state. promptToCodes. insert ( newPromptToCode, at: 0 )
6666 return . run { send in
67- if !newPromptToCode. promptToCodeState. instruction. isEmpty {
67+ if sendImmediately , !newPromptToCode. promptToCodeState. instruction. isEmpty {
6868 await send ( . promptToCode( newPromptToCode. id, . modifyCodeButtonTapped) )
6969 }
7070 } . cancellable (
Original file line number Diff line number Diff line change @@ -78,7 +78,10 @@ public struct WidgetPanel {
7878
7979 case let . presentPromptToCode( initialState) :
8080 return . run { send in
81- await send ( . sharedPanel( . promptToCodeGroup( . createPromptToCode( initialState) ) ) )
81+ await send ( . sharedPanel( . promptToCodeGroup( . createPromptToCode(
82+ initialState,
83+ sendImmediately: true
84+ ) ) ) )
8285 }
8386
8487 case . displayPanelContent:
You can’t perform that action at this time.
0 commit comments