@@ -514,84 +514,87 @@ export default function Message({
514
514
< >
515
515
< span style = { lighten } >
516
516
< Time message = { message } edit = { edit_message } />
517
- { ! isLLMThread && (
518
- < Tip
519
- placement = { "bottom" }
520
- title = {
521
- ! showOtherFeedback
522
- ? undefined
523
- : ( ) => {
524
- return (
525
- < div >
526
- { Object . keys (
527
- message . get ( "feedback" ) ?. toJS ( ) ?? { } ,
528
- ) . map ( ( account_id ) => (
529
- < div
530
- key = { account_id }
531
- style = { { marginBottom : "2px" } }
532
- >
533
- < Avatar size = { 24 } account_id = { account_id } /> { " " }
534
- < User account_id = { account_id } />
535
- </ div >
536
- ) ) }
537
- </ div >
538
- ) ;
539
- }
540
- }
541
- >
542
- < Button
543
- style = { {
544
- marginRight : "5px" ,
545
- float : "right" ,
546
- marginTop : "-4px" ,
547
- color : ! feedback && is_viewers_message ? "white" : "#888" ,
548
- fontSize : "12px" ,
549
- } }
550
- size = "small"
551
- type = { feedback ? "dashed" : "text" }
552
- onClick = { ( ) => {
553
- actions ?. feedback ( message , feedback ? null : "positive" ) ;
554
- } }
517
+ < Space
518
+ size = { "small" }
519
+ align = "baseline"
520
+ style = { { float : "right" , marginRight : "10px" } }
521
+ >
522
+ { ! isLLMThread && (
523
+ < Tip
524
+ placement = { "top" }
525
+ title = {
526
+ ! showOtherFeedback
527
+ ? "Like this"
528
+ : ( ) => {
529
+ return (
530
+ < div >
531
+ { Object . keys (
532
+ message . get ( "feedback" ) ?. toJS ( ) ?? { } ,
533
+ ) . map ( ( account_id ) => (
534
+ < div
535
+ key = { account_id }
536
+ style = { { marginBottom : "2px" } }
537
+ >
538
+ < Avatar size = { 24 } account_id = { account_id } /> { " " }
539
+ < User account_id = { account_id } />
540
+ </ div >
541
+ ) ) }
542
+ </ div >
543
+ ) ;
544
+ }
545
+ }
555
546
>
556
- { showOtherFeedback ? (
557
- < Badge count = { otherFeedback } color = "darkblue" size = "small" />
558
- ) : (
559
- ""
560
- ) }
561
- < Tip
562
- placement = { "bottom" }
563
- title = { showOtherFeedback ? undefined : "Like this" }
547
+ < Button
548
+ style = { {
549
+ color : ! feedback && is_viewers_message ? "white" : "#888" ,
550
+ fontSize : "12px" ,
551
+ marginTop : "-4px" ,
552
+ ...( feedback ? { } : { position : "relative" , top : "-5px" } ) ,
553
+ } }
554
+ size = "small"
555
+ type = { feedback ? "dashed" : "text" }
556
+ onClick = { ( ) => {
557
+ actions ?. feedback ( message , feedback ? null : "positive" ) ;
558
+ } }
564
559
>
560
+ { showOtherFeedback ? (
561
+ < Badge
562
+ count = { otherFeedback }
563
+ color = "darkblue"
564
+ size = "small"
565
+ />
566
+ ) : (
567
+ ""
568
+ ) }
565
569
< Icon
566
570
name = "thumbs-up"
567
571
style = { {
568
572
color : showOtherFeedback ? "darkblue" : undefined ,
569
573
} }
570
574
/>
571
- </ Tip >
575
+ </ Button >
576
+ </ Tip >
577
+ ) }
578
+ < Tip
579
+ placement = { "top" }
580
+ title = "Select message. Copy URL to link to this message."
581
+ >
582
+ < Button
583
+ onClick = { ( ) => {
584
+ actions ?. setFragment ( message . get ( "date" ) ) ;
585
+ } }
586
+ size = "small"
587
+ type = { "text" }
588
+ style = { {
589
+ color : is_viewers_message ? "white" : "#888" ,
590
+ fontSize : "12px" ,
591
+ marginTop : "-4px" ,
592
+ } }
593
+ >
594
+ < Icon name = "link" />
572
595
</ Button >
573
596
</ Tip >
574
- ) } { " " }
575
- < Tip
576
- placement = { "bottom" }
577
- title = "Select message. Copy URL to link to this message."
578
- >
579
- < Button
580
- onClick = { ( ) => {
581
- actions ?. setFragment ( message . get ( "date" ) ) ;
582
- } }
583
- size = "small"
584
- type = { "text" }
585
- style = { {
586
- float : "right" ,
587
- marginTop : "-4px" ,
588
- color : is_viewers_message ? "white" : "#888" ,
589
- fontSize : "12px" ,
590
- } }
591
- >
592
- < Icon name = "link" />
593
- </ Button >
594
- </ Tip >
597
+ </ Space >
595
598
</ span >
596
599
< MostlyStaticMarkdown
597
600
style = { MARKDOWN_STYLE }
@@ -608,6 +611,7 @@ export default function Message({
608
611
: undefined
609
612
}
610
613
/>
614
+ { renderEditControlRow ( ) }
611
615
</ >
612
616
) ;
613
617
}
@@ -636,8 +640,6 @@ export default function Message({
636
640
? { marginLeft : "5px" , marginRight : "5px" }
637
641
: undefined ) ,
638
642
...( selected ? { border : "3px solid #66bb6a" } : undefined ) ,
639
- maxHeight : is_folded ? "100px" : undefined ,
640
- overflowY : is_folded ? "auto" : undefined ,
641
643
} as const ;
642
644
643
645
const mainXS = mode === "standalone" ? 20 : 22 ;
@@ -671,27 +673,27 @@ export default function Message({
671
673
className = "smc-chat-message"
672
674
onDoubleClick = { edit_message }
673
675
>
674
- { isEditing ? (
675
- renderEditMessage ( )
676
- ) : (
677
- < >
678
- { renderMessageBody ( { lighten, message_class } ) }
679
- { renderEditControlRow ( ) }
680
- </ >
681
- ) }
676
+ { isEditing
677
+ ? renderEditMessage ( )
678
+ : renderMessageBody ( { lighten, message_class } ) }
682
679
</ div >
683
- { show_history && (
684
- < div >
685
- < HistoryTitle />
686
- < History history = { message . get ( "history" ) } user_map = { user_map } />
687
- < HistoryFooter />
688
- </ div >
689
- ) }
690
- { replying ? renderComposeReply ( ) : undefined }
680
+ { renderHistory ( ) }
681
+ { renderComposeReply ( ) }
691
682
</ Col >
692
683
) ;
693
684
}
694
685
686
+ function renderHistory ( ) {
687
+ if ( ! show_history ) return ;
688
+ return (
689
+ < div >
690
+ < HistoryTitle />
691
+ < History history = { message . get ( "history" ) } user_map = { user_map } />
692
+ < HistoryFooter />
693
+ </ div >
694
+ ) ;
695
+ }
696
+
695
697
function saveEditedMessage ( ) : void {
696
698
if ( actions == null ) return ;
697
699
const mesg =
@@ -768,11 +770,14 @@ export default function Message({
768
770
}
769
771
770
772
function renderComposeReply ( ) {
773
+ if ( ! replying ) return ;
774
+
771
775
if ( project_id == null || path == null || actions ?. syncdb == null ) {
772
776
// should never get into this position
773
777
// when null.
774
778
return ;
775
779
}
780
+
776
781
const replyDate = - getThreadRootDate ( { date, messages } ) ;
777
782
let input ;
778
783
let moveCursorToEndOfLine = false ;
0 commit comments