File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,13 @@ export function MessageActions({
4444 const [ isSubmittingFeedback , setIsSubmittingFeedback ] = useState ( false )
4545 const isLoading = status === 'submitted' || status === 'streaming'
4646
47+ // Do not render at all when actions should be hidden.
48+ // Rendering while loading is allowed so previous messages keep their actions
49+ // visible even during a new message's streaming.
50+ if ( ! visible ) {
51+ return null
52+ }
53+
4754 async function handleCopy ( ) {
4855 await navigator . clipboard . writeText ( message )
4956 toast . success ( 'Message copied to clipboard' )
@@ -87,7 +94,7 @@ export function MessageActions({
8794 < div
8895 className = { cn (
8996 'flex items-center gap-0.5 self-end transition-opacity duration-200' ,
90- ! visible || isLoading ? 'opacity-0' : 'opacity-100' ,
97+ 'opacity-100' ,
9198 className
9299 ) }
93100 >
You can’t perform that action at this time.
0 commit comments