@@ -4,7 +4,10 @@ import { Bot, Hash, LogIn, Plus, Sparkles, UserPlus } from "lucide-react";
44import { useMediaUpload } from "@/features/messages/lib/useMediaUpload" ;
55import { MessageComposer } from "@/features/messages/ui/MessageComposer" ;
66import { DropZoneOverlay } from "@/features/messages/ui/ComposerAttachments" ;
7- import { MessageThreadPanel } from "@/features/messages/ui/MessageThreadPanel" ;
7+ import {
8+ MessageThreadPanel ,
9+ MessageThreadPanelSkeleton ,
10+ } from "@/features/messages/ui/MessageThreadPanel" ;
811import { MessageTimeline } from "@/features/messages/ui/MessageTimeline" ;
912import type { ImetaMedia } from "@/features/messages/lib/imetaMediaMarkdown" ;
1013import { useComposerHeightPadding } from "@/features/messages/ui/useComposerHeightPadding" ;
@@ -714,7 +717,7 @@ export const ChannelPane = React.memo(function ChannelPane({
714717 size = "sm"
715718 variant = "default"
716719 >
717- < LogIn className = "mr-1.5 h-3.5 w-3.5 " />
720+ < LogIn className = "mr-1.5 h-4 w-4 " />
718721 { isJoining ? "Joining..." : "Join to participate" }
719722 </ Button >
720723 </ div >
@@ -854,27 +857,15 @@ export const ChannelPane = React.memo(function ChannelPane({
854857 panel
855858 ) ;
856859 } ) ( )
857- : activeChannel && selectedAgent
860+ : openThreadHeadId && activeChannel
858861 ? ( ( ) => {
859862 const panel = (
860- < AgentSessionThreadPanel
861- agent = { selectedAgent }
862- canInterruptTurn = { selectedAgent . canInterruptTurn }
863- channel = { activeChannel }
864- isWorking = { botTypingEntries . some (
865- ( entry ) =>
866- entry . pubkey . toLowerCase ( ) ===
867- selectedAgent . pubkey . toLowerCase ( ) ,
868- ) }
863+ < MessageThreadPanelSkeleton
869864 isSinglePanelView = {
870865 useSplitAuxiliaryPane ? false : isSinglePanelView
871866 }
872867 layout = { useSplitAuxiliaryPane ? "split" : "standalone" }
873- profiles = { profiles }
874- onBackToProfile = { ( ) =>
875- onOpenProfilePanel ( selectedAgent . pubkey )
876- }
877- onClose = { onCloseAgentSession }
868+ onClose = { onCloseThread }
878869 widthPx = { threadPanelWidthPx }
879870 />
880871 ) ;
@@ -883,7 +874,7 @@ export const ChannelPane = React.memo(function ChannelPane({
883874 canResetWidth = { canResetThreadPanelWidth }
884875 onResetWidth = { onResetThreadPanelWidth }
885876 onResizeStart = { onThreadPanelResizeStart }
886- testId = "agent-session -thread-panel"
877+ testId = "message -thread-panel"
887878 widthPx = { threadPanelWidthPx }
888879 >
889880 { panel }
@@ -892,19 +883,27 @@ export const ChannelPane = React.memo(function ChannelPane({
892883 panel
893884 ) ;
894885 } ) ( )
895- : profilePanelPubkey
886+ : activeChannel && selectedAgent
896887 ? ( ( ) => {
897888 const panel = (
898- < UserProfilePanel
899- currentPubkey = { currentPubkey }
889+ < AgentSessionThreadPanel
890+ agent = { selectedAgent }
891+ canInterruptTurn = { selectedAgent . canInterruptTurn }
892+ channel = { activeChannel }
893+ isWorking = { botTypingEntries . some (
894+ ( entry ) =>
895+ entry . pubkey . toLowerCase ( ) ===
896+ selectedAgent . pubkey . toLowerCase ( ) ,
897+ ) }
900898 isSinglePanelView = {
901899 useSplitAuxiliaryPane ? false : isSinglePanelView
902900 }
903901 layout = { useSplitAuxiliaryPane ? "split" : "standalone" }
904- onClose = { onCloseProfilePanel }
905- onOpenDm = { onOpenDm }
906- pubkey = { profilePanelPubkey }
907- splitPaneClamp
902+ profiles = { profiles }
903+ onBackToProfile = { ( ) =>
904+ onOpenProfilePanel ( selectedAgent . pubkey )
905+ }
906+ onClose = { onCloseAgentSession }
908907 widthPx = { threadPanelWidthPx }
909908 />
910909 ) ;
@@ -913,7 +912,7 @@ export const ChannelPane = React.memo(function ChannelPane({
913912 canResetWidth = { canResetThreadPanelWidth }
914913 onResetWidth = { onResetThreadPanelWidth }
915914 onResizeStart = { onThreadPanelResizeStart }
916- testId = "user-profile -panel"
915+ testId = "agent-session-thread -panel"
917916 widthPx = { threadPanelWidthPx }
918917 >
919918 { panel }
@@ -922,7 +921,37 @@ export const ChannelPane = React.memo(function ChannelPane({
922921 panel
923922 ) ;
924923 } ) ( )
925- : null }
924+ : profilePanelPubkey
925+ ? ( ( ) => {
926+ const panel = (
927+ < UserProfilePanel
928+ currentPubkey = { currentPubkey }
929+ isSinglePanelView = {
930+ useSplitAuxiliaryPane ? false : isSinglePanelView
931+ }
932+ layout = { useSplitAuxiliaryPane ? "split" : "standalone" }
933+ onClose = { onCloseProfilePanel }
934+ onOpenDm = { onOpenDm }
935+ pubkey = { profilePanelPubkey }
936+ splitPaneClamp
937+ widthPx = { threadPanelWidthPx }
938+ />
939+ ) ;
940+ return useSplitAuxiliaryPane ? (
941+ < RightAuxiliaryPane
942+ canResetWidth = { canResetThreadPanelWidth }
943+ onResetWidth = { onResetThreadPanelWidth }
944+ onResizeStart = { onThreadPanelResizeStart }
945+ testId = "user-profile-panel"
946+ widthPx = { threadPanelWidthPx }
947+ >
948+ { panel }
949+ </ RightAuxiliaryPane >
950+ ) : (
951+ panel
952+ ) ;
953+ } ) ( )
954+ : null }
926955 </ div >
927956 ) ;
928957} ) ;
0 commit comments