@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
3
3
import Browser from 'webextension-polyfill'
4
4
import InputBox from '../InputBox'
5
5
import ConversationItem from '../ConversationItem'
6
- import { createElementAtPosition , isSafari } from '../../utils'
6
+ import { createElementAtPosition , isFirefox , isMobile , isSafari } from '../../utils'
7
7
import {
8
8
LinkExternalIcon ,
9
9
ArchiveIcon ,
@@ -47,6 +47,8 @@ function ConversationCard(props) {
47
47
const [ session , setSession ] = useState ( props . session )
48
48
const windowSize = useClampWindowSize ( [ 750 , 1500 ] , [ 250 , 1100 ] )
49
49
const bodyRef = useRef ( null )
50
+ const [ completeDraggable , setCompleteDraggable ] = useState ( false )
51
+
50
52
/**
51
53
* @type {[ConversationItemData[], (conversationItemData: ConversationItemData[]) => void] }
52
54
*/
@@ -73,6 +75,10 @@ function ConversationCard(props) {
73
75
)
74
76
const config = useConfig ( )
75
77
78
+ useEffect ( ( ) => {
79
+ setCompleteDraggable ( ! isSafari ( ) && ! isFirefox ( ) && ! isMobile ( ) )
80
+ } , [ ] )
81
+
76
82
useEffect ( ( ) => {
77
83
if ( props . onUpdate ) props . onUpdate ( port , session , conversationItemData )
78
84
} , [ session , conversationItemData ] )
@@ -218,10 +224,18 @@ function ConversationCard(props) {
218
224
return (
219
225
< div className = "gpt-inner" >
220
226
< div
221
- className = { props . draggable ? 'gpt-header draggable' : 'gpt-header' }
222
- style = "padding:15px;user-select:none;"
227
+ className = {
228
+ props . draggable ? `gpt-header${ completeDraggable ? ' draggable' : '' } ` : 'gpt-header'
229
+ }
230
+ style = "user-select:none;"
223
231
>
224
- < span className = "gpt-util-group" style = { props . notClampSize ? { } : { flexGrow : 1 } } >
232
+ < span
233
+ className = "gpt-util-group"
234
+ style = { {
235
+ padding : '15px 0 15px 15px' ,
236
+ ...( props . notClampSize ? { } : { flexGrow : 1 } ) ,
237
+ } }
238
+ >
225
239
{ props . closeable ? (
226
240
< XLg
227
241
className = "gpt-util-icon"
@@ -278,7 +292,17 @@ function ConversationCard(props) {
278
292
} ) }
279
293
</ select >
280
294
</ span >
281
- < span className = "gpt-util-group" style = { { flexGrow : 1 , justifyContent : 'flex-end' } } >
295
+ { props . draggable && ! completeDraggable && (
296
+ < div className = "draggable" style = { { flexGrow : 2 , cursor : 'move' , height : '55px' } } />
297
+ ) }
298
+ < span
299
+ className = "gpt-util-group"
300
+ style = { {
301
+ padding : '15px 15px 15px 0' ,
302
+ justifyContent : 'flex-end' ,
303
+ flexGrow : props . draggable && ! completeDraggable ? 0 : 1 ,
304
+ } }
305
+ >
282
306
{ ! config . disableWebModeHistory && session && session . conversationId && (
283
307
< a
284
308
title = { t ( 'Continue on official website' ) }
0 commit comments