@@ -4,7 +4,7 @@ import Browser from 'webextension-polyfill'
44import InputBox from '../InputBox'
55import ConversationItem from '../ConversationItem'
66import { createElementAtPosition , initSession , isSafari } from '../../utils'
7- import { DownloadIcon , LinkExternalIcon } from '@primer/octicons-react'
7+ import { DownloadIcon , LinkExternalIcon , ArchiveIcon } from '@primer/octicons-react'
88import { WindowDesktop , XLg , Pin } from 'react-bootstrap-icons'
99import FileSaver from 'file-saver'
1010import { render } from 'preact'
@@ -14,6 +14,7 @@ import { Models } from '../../config/index.mjs'
1414import { useTranslation } from 'react-i18next'
1515import DeleteButton from '../DeleteButton'
1616import { useConfig } from '../../hooks/use-config.mjs'
17+ import { createSession } from '../../config/localSession.mjs'
1718
1819const logo = Browser . runtime . getURL ( 'logo.png' )
1920
@@ -295,6 +296,31 @@ function ConversationCard(props) {
295296 setSession ( newSession )
296297 } }
297298 />
299+ { ! props . pageMode && (
300+ < span
301+ title = { t ( 'Store to Independent Conversation Page' ) }
302+ className = "gpt-util-icon"
303+ onClick = { ( ) => {
304+ const newSession = {
305+ ...session ,
306+ sessionName : new Date ( ) . toLocaleString ( ) ,
307+ autoClean : false ,
308+ sessionId : crypto . randomUUID ( ) ,
309+ }
310+ setSession ( newSession )
311+ createSession ( newSession ) . then ( ( ) =>
312+ Browser . runtime . sendMessage ( {
313+ type : 'OPEN_URL' ,
314+ data : {
315+ url : Browser . runtime . getURL ( 'IndependentPanel.html' ) ,
316+ } ,
317+ } ) ,
318+ )
319+ } }
320+ >
321+ < ArchiveIcon size = { 16 } />
322+ </ span >
323+ ) }
298324 < span
299325 title = { t ( 'Save Conversation' ) }
300326 className = "gpt-util-icon"
@@ -369,6 +395,7 @@ ConversationCard.propTypes = {
369395 dockable : PropTypes . bool ,
370396 onDock : PropTypes . func ,
371397 notClampSize : PropTypes . bool ,
398+ pageMode : PropTypes . bool ,
372399}
373400
374401export default memo ( ConversationCard )
0 commit comments