@@ -195,6 +195,8 @@ export default function Message(props: Readonly<Props>) {
195
195
} ) != null
196
196
) ;
197
197
} ) ;
198
+ const [ autoFocusReply , setAutoFocusReply ] = useState < boolean > ( false ) ;
199
+ const [ autoFocusEdit , setAutoFocusEdit ] = useState < boolean > ( false ) ;
198
200
199
201
const replyMessageRef = useRef < string > ( "" ) ;
200
202
const replyMentionsRef = useRef < SubmitMentionsFn > ( ) ;
@@ -318,6 +320,7 @@ export default function Message(props: Readonly<Props>) {
318
320
return ;
319
321
}
320
322
props . actions . set_editing ( message , true ) ;
323
+ setAutoFocusEdit ( true ) ;
321
324
props . scroll_into_view ( ) ;
322
325
}
323
326
@@ -579,7 +582,7 @@ export default function Message(props: Readonly<Props>) {
579
582
return (
580
583
< div >
581
584
< ChatInput
582
- autoFocus
585
+ autoFocus = { autoFocusEdit }
583
586
cacheId = { `${ props . path } ${ props . project_id } ${ date } ` }
584
587
input = { newest_content ( message ) }
585
588
submitMentionsRef = { submitMentionsRef }
@@ -633,7 +636,7 @@ export default function Message(props: Readonly<Props>) {
633
636
return (
634
637
< div style = { { marginLeft : mode === "standalone" ? "30px" : "0" } } >
635
638
< ChatInput
636
- autoFocus
639
+ autoFocus = { autoFocusReply }
637
640
style = { {
638
641
borderRadius : "8px" ,
639
642
height : "auto" /* for some reason the default 100% breaks things */ ,
@@ -655,6 +658,7 @@ export default function Message(props: Readonly<Props>) {
655
658
/>
656
659
< div style = { { margin : "5px 0" } } >
657
660
< Button
661
+ style = { { marginRight : "5px" } }
658
662
onClick = { ( ) => {
659
663
setReplying ( false ) ;
660
664
props . actions ?. syncdb ?. delete ( {
@@ -666,12 +670,8 @@ export default function Message(props: Readonly<Props>) {
666
670
>
667
671
Cancel
668
672
</ Button >
669
- < Button
670
- onClick = { sendReply }
671
- type = "primary"
672
- style = { { marginRight : "5px" } }
673
- >
674
- < Icon name = "paper-plane" /> Send Reply
673
+ < Button onClick = { sendReply } type = "primary" >
674
+ Send Reply
675
675
</ Button >
676
676
< LLMCostEstimationChat
677
677
llm_cost = { llm_cost_reply }
@@ -734,7 +734,10 @@ export default function Message(props: Readonly<Props>) {
734
734
>
735
735
< Button
736
736
type = "text"
737
- onClick = { ( ) => setReplying ( true ) }
737
+ onClick = { ( ) => {
738
+ setReplying ( true ) ;
739
+ setAutoFocusReply ( true ) ;
740
+ } }
738
741
style = { { color : COLORS . GRAY_M } }
739
742
>
740
743
< Icon name = "reply" /> Reply
0 commit comments