@@ -208,72 +208,71 @@ export const TabsUI = (props: TabsUIProps) => {
208
208
< i className = "fas fa-play" > </ i >
209
209
</ button >
210
210
</ CustomTooltip >
211
- < div className = "border-left ml-2" style = { { height : "3em" } } > </ div >
212
- < CustomTooltip
213
- placement = "bottom"
214
- tooltipId = "overlay-tooltip-explaination"
215
- tooltipText = {
216
- < span >
217
- { tabsState . currentExt === 'sol' ? (
218
- < FormattedMessage id = "remixUiTabs.tooltipText5" />
219
- ) : (
220
- < FormattedMessage id = "remixUiTabs.tooltipText4" />
221
- ) }
222
- </ span >
223
- }
224
- >
225
- < button
226
- data-id = "explain-editor"
227
- id = 'explain_btn'
228
- className = 'btn text-ai pl-2 pr-0 py-0 d-flex'
229
- disabled = { ! ( tabsState . currentExt === 'sol' ) || explaining }
230
- onClick = { async ( ) => {
231
- const path = active ( ) . substr ( active ( ) . indexOf ( '/' ) + 1 , active ( ) . length )
232
- const content = await props . plugin . call ( 'fileManager' , 'readFile' , path )
233
- if ( tabsState . currentExt === 'sol' ) {
234
- setExplaining ( true )
235
- await props . plugin . call ( 'solcoder' , 'code_explaining' , content )
236
- setExplaining ( false )
237
- _paq . push ( [ 'trackEvent' , 'ai' , 'solcoder' , 'explain_file' ] )
238
- }
239
- } }
211
+ < div className = "d-flex"
212
+ < CustomTooltip
213
+ placement = "bottom"
214
+ tooltipId = "overlay-tooltip-explaination"
215
+ tooltipText = {
216
+ < span >
217
+ { tabsState . currentExt === 'sol' ? (
218
+ < FormattedMessage id = "remixUiTabs.tooltipText5" />
219
+ ) : (
220
+ < FormattedMessage id = "remixUiTabs.tooltipText4" />
221
+ ) }
222
+ </ span >
223
+ }
240
224
>
241
- < i className = { `fas fa-user-robot ${ explaining ? 'loadingExplanation' : '' } ` } > </ i >
242
- </ button >
243
- </ CustomTooltip >
244
- < CustomTooltip
245
- placement = "bottom"
246
- tooltipId = "overlay-tooltip-copilot"
247
- tooltipText = {
248
- < span >
249
- { tabsState . currentExt === 'sol' ? (
250
- ! ai_switch ? (
251
- < FormattedMessage id = "remixUiTabs.tooltipText6" />
252
- ) : ( < FormattedMessage id = "remixUiTabs.tooltipText7" /> )
253
- ) : (
254
- < FormattedMessage id = "remixUiTabs.tooltipTextDisabledCopilot" />
255
- ) }
256
- </ span >
257
- }
258
- >
259
- < button
260
- data-id = "remix_ai_switch"
261
- id = 'remix_ai_switch'
262
- className = "btn ai-switch text-ai pl-2 pr-0 py-0 d-flex"
263
- disabled = { ! ( tabsState . currentExt === 'sol' ) }
264
- onClick = { async ( ) => {
265
- await props . plugin . call ( 'settings' , 'updateCopilotChoice' , ! ai_switch )
266
- setAI_switch ( ! ai_switch )
267
- ai_switch ? _paq . push ( [ 'trackEvent' , 'ai' , 'solcoder' , 'copilot_enabled' ] ) : _paq . push ( [ 'trackEvent' , 'ai' , 'solcoder' , 'copilot_disabled' ] )
268
- } }
225
+ < button
226
+ data-id = "explain-editor"
227
+ id = 'explain_btn'
228
+ className = 'btn text-ai pl-2 pr-0 py-0 d-flex'
229
+ disabled = { ! ( tabsState . currentExt === 'sol' ) || explaining }
230
+ onClick = { async ( ) => {
231
+ const path = active ( ) . substr ( active ( ) . indexOf ( '/' ) + 1 , active ( ) . length )
232
+ const content = await props . plugin . call ( 'fileManager' , 'readFile' , path )
233
+ if ( tabsState . currentExt === 'sol' ) {
234
+ setExplaining ( true )
235
+ await props . plugin . call ( 'solcoder' , 'code_explaining' , content )
236
+ setExplaining ( false )
237
+ _paq . push ( [ 'trackEvent' , 'ai' , 'solcoder' , 'explain_file' ] )
238
+ }
239
+ } }
240
+ >
241
+ < i className = { `fas fa-user-robot ${ explaining ? 'loadingExplanation' : '' } ` } > </ i >
242
+ </ button >
243
+ </ CustomTooltip >
244
+ < CustomTooltip
245
+ placement = "bottom"
246
+ tooltipId = "overlay-tooltip-copilot"
247
+ tooltipText = {
248
+ < span >
249
+ { tabsState . currentExt === 'sol' ? (
250
+ ! ai_switch ? (
251
+ < FormattedMessage id = "remixUiTabs.tooltipText6" />
252
+ ) : ( < FormattedMessage id = "remixUiTabs.tooltipText7" /> )
253
+ ) : (
254
+ < FormattedMessage id = "remixUiTabs.tooltipTextDisabledCopilot" />
255
+ ) }
256
+ </ span >
257
+ }
269
258
>
270
- < i
271
- className = { ai_switch ? "fas fa-toggle-on" : "fas fa-toggle-off" }
272
- > </ i >
273
- </ button >
274
- </ CustomTooltip >
275
-
276
- < div className = "border-left ml-2" style = { { height : "3em" } } > </ div >
259
+ < button
260
+ data-id = "remix_ai_switch"
261
+ id = 'remix_ai_switch'
262
+ className = "btn ai-switch text-ai pl-2 pr-0 py-0 d-flex"
263
+ disabled = { ! ( tabsState . currentExt === 'sol' ) }
264
+ onClick = { async ( ) => {
265
+ await props . plugin . call ( 'settings' , 'updateCopilotChoice' , ! ai_switch )
266
+ setAI_switch ( ! ai_switch )
267
+ ai_switch ? _paq . push ( [ 'trackEvent' , 'ai' , 'solcoder' , 'copilot_enabled' ] ) : _paq . push ( [ 'trackEvent' , 'ai' , 'solcoder' , 'copilot_disabled' ] )
268
+ } }
269
+ >
270
+ < i
271
+ className = { ai_switch ? "fas fa-toggle-on" : "fas fa-toggle-off" }
272
+ > </ i >
273
+ </ button >
274
+ </ CustomTooltip >
275
+ </ div >
277
276
278
277
< CustomTooltip placement = "bottom" tooltipId = "overlay-tooltip-zoom-out" tooltipText = { < FormattedMessage id = "remixUiTabs.zoomOut" /> } >
279
278
< span data-id = "tabProxyZoomOut" className = "btn fas fa-search-minus text-dark pl-2 pr-0 py-0 d-flex" onClick = { ( ) => props . onZoomOut ( ) } > </ span >
0 commit comments