@@ -330,42 +330,14 @@ struct EditCustomCommandView: View {
330330 }
331331 . padding ( . bottom)
332332 . background ( . regularMaterial)
333- . sheet ( isPresented: . init( get: { editingContentInFullScreen != nil } , set: {
334- if $0 == false {
335- editingContentInFullScreen = nil
336- }
337- } ) , content: {
338- VStack {
339- if let editingContentInFullScreen {
340- TextEditor ( text: editingContentInFullScreen)
341- . font ( Font . system ( . body, design: . monospaced) )
342- . padding ( 4 )
343- . frame ( minHeight: 120 )
344- . multilineTextAlignment ( . leading)
345- . overlay (
346- RoundedRectangle ( cornerRadius: 4 )
347- . stroke ( Color ( nsColor: . separatorColor) , lineWidth: 1 )
348- )
349- }
350-
351- Button ( action: {
352- editingContentInFullScreen = nil
353- } ) {
354- Text ( " Done " )
355- }
356- }
357- . padding ( )
358- . frame ( width: 600 , height: 500 )
359- . background ( Color ( nsColor: . windowBackgroundColor) )
360- } )
361333 }
362334 }
363335
364336 @ViewBuilder
365337 var promptTextField : some View {
366338 VStack ( alignment: . leading, spacing: 4 ) {
367339 Text ( " Prompt " )
368- editableText ( $prompt)
340+ EditableText ( text : $prompt)
369341 }
370342 . padding ( . vertical, 4 )
371343 }
@@ -378,7 +350,7 @@ struct EditCustomCommandView: View {
378350 } else {
379351 Text ( title ?? " System Prompt " )
380352 }
381- editableText ( $systemPrompt)
353+ EditableText ( text : $systemPrompt)
382354 }
383355 . padding ( . vertical, 4 )
384356 }
@@ -390,38 +362,6 @@ struct EditCustomCommandView: View {
390362 var generateDescriptionToggle : some View {
391363 Toggle ( " Generate Description " , isOn: $generatingPromptToCodeDescription)
392364 }
393-
394- func editableText( _ binding: Binding < String > ) -> some View {
395- Button ( action: {
396- editingContentInFullScreen = binding
397- } ) {
398- HStack ( alignment: . top) {
399- Text ( binding. wrappedValue)
400- . font ( Font . system ( . body, design: . monospaced) )
401- . padding ( 4 )
402- . multilineTextAlignment ( . leading)
403- . frame ( maxWidth: . infinity, alignment: . leading)
404- . background {
405- RoundedRectangle ( cornerRadius: 4 )
406- . fill ( Color ( nsColor: . textBackgroundColor) )
407- }
408- . overlay {
409- RoundedRectangle ( cornerRadius: 4 )
410- . stroke ( Color ( nsColor: . separatorColor) , style: . init( lineWidth: 1 ) )
411- }
412- Image ( systemName: " square.and.pencil " )
413- . resizable ( )
414- . scaledToFit ( )
415- . frame ( width: 14 )
416- . padding ( 4 )
417- . background (
418- Color . primary. opacity ( 0.1 ) ,
419- in: RoundedRectangle ( cornerRadius: 4 )
420- )
421- }
422- }
423- . buttonStyle ( . plain)
424- }
425365}
426366
427367// MARK: - Previews
0 commit comments