@@ -84,7 +84,7 @@ class AssistantView extends React.Component<Props, State> implements SessionCont
8484 getWatermarkView ( ) : any {
8585 return < a style = { styles . watermark } href = 'https://www.superluminal.dev' target = '_blank' >
8686 < span style = { { opacity : 0.4 , fontSize : '11px' } } > Powered by</ span >
87- < img src = { LogoText } height = "14px" style = { { opacity : 0.4 , marginTop : '1px' } } />
87+ < img src = { LogoText } height = "14px" style = { { opacity : 0.4 , marginTop : '1px' } } draggable = { false } />
8888 </ a >
8989 }
9090
@@ -109,7 +109,7 @@ class AssistantView extends React.Component<Props, State> implements SessionCont
109109 case 'assistant' :
110110 if ( 'text' in message . content ) {
111111 return < div key = { message . id } style = { styles . messageContainer } >
112- < img src = { LogoInverted } style = { styles . profilePictureView } width = "24px" height = "24px" />
112+ < img src = { LogoInverted } style = { styles . profilePictureView } width = "24px" height = "24px" draggable = { false } />
113113 < div style = { { ...styles . assistantMessage , ...assistantMessageStyle } } > { message . content . text } </ div >
114114 </ div >
115115 } else if ( 'plot' in message . content ) {
@@ -120,7 +120,7 @@ class AssistantView extends React.Component<Props, State> implements SessionCont
120120 const height = ( ( plot . layout . width * width ) / plot . layout . height ) ;
121121 const layout = { ...plot . layout , width, height, margin : { t : 30 , b : 10 , l : 10 , r : 10 , pad : 0 } } ;
122122 return < div key = { message . id } style = { styles . messageContainer } >
123- < img src = { LogoInverted } style = { styles . profilePictureView } width = "24px" height = "24px" />
123+ < img src = { LogoInverted } style = { styles . profilePictureView } width = "24px" height = "24px" draggable = { false } />
124124 < div style = { { display : 'flex' , flexDirection : 'column' , rowGap : '12px' } } >
125125 < div style = { { ...styles . assistantMessage , ...{ maxWidth : '100%' , background : '#FFFFFF' } , ...assistantMessageStyle } } >
126126 < Plot data = { plot . data } layout = { layout } config = { { toImageButtonOptions : { scale : 3 } } } />
@@ -131,8 +131,8 @@ class AssistantView extends React.Component<Props, State> implements SessionCont
131131 const table = message . content . table ;
132132 return < div key = { message . id } style = { styles . messageContainer } >
133133 < div style = { { display : 'flex' , justifyContent : 'space-between' , alignItems : 'flex-end' } } >
134- < img src = { LogoInverted } style = { styles . profilePictureView } width = "24px" height = "24px" />
135- < img src = { IconExpand } width = "20px" height = "20px" onClick = { ( ) => this . expandTable ( table ) } />
134+ < img src = { LogoInverted } style = { styles . profilePictureView } width = "24px" height = "24px" draggable = { false } />
135+ < img src = { IconExpand } width = "20px" height = "20px" onClick = { ( ) => this . expandTable ( table ) } draggable = { false } />
136136 </ div >
137137 < div style = { { ...styles . assistantMessage , ...{ maxWidth : '100%' , background : '#FFFFFF' } , ...assistantMessageStyle } } >
138138 < TablePreview table = { table } />
@@ -153,12 +153,16 @@ class AssistantView extends React.Component<Props, State> implements SessionCont
153153 document . body
154154 ) }
155155 </ div >
156- } else {
156+ } else if ( sessionState == 'initializing' || sessionState == 'waiting_for_data' || sessionState == 'validating_data' ) {
157157 return < div style = { { width : '100%' , height : '100%' , display : 'flex' , flexDirection : 'column' , justifyContent : 'center' , alignItems : 'center' } } >
158- < img src = 'https://superluminal.dev/images/ai.webp' width = "64px" height = "64px" />
158+ < img src = 'https://superluminal.dev/images/ai.webp' width = "64px" height = "64px" draggable = { false } />
159159 < div style = { { fontSize : '20px' , fontWeight : 600 , color : '#000000' , marginTop : '8px' } } > Loading</ div >
160160 </ div >
161- }
161+ } else { // 'error' | 'unavailable'
162+ return < div style = { { width : '100%' , height : '100%' , display : 'flex' , flexDirection : 'column' , justifyContent : 'center' , alignItems : 'center' , padding : '8px' } } >
163+ < div style = { { fontSize : '14px' , fontWeight : 600 , color : '#000000' , marginTop : '8px' , textAlign : 'center' } } > An unexpected error occurred.< br /> Please try again later.</ div >
164+ </ div >
165+ }
162166 }
163167
164168 getInputView ( ) : any {
@@ -188,7 +192,7 @@ class AssistantView extends React.Component<Props, State> implements SessionCont
188192 this . setState ( { user } ) ;
189193 }
190194
191- onSessionStateUpdated ( sessionState : SessionState ) {
195+ onSessionStateUpdated ( sessionState : SessionState , error : string | null ) {
192196 this . setState ( { sessionState } ) ;
193197 }
194198
0 commit comments