@@ -61,6 +61,8 @@ const parsePanelDrop = (id: unknown):
6161interface ImageToolsPanelBar {
6262 appState : AppState ;
6363 selectedModel : ModelInfo | null ;
64+ isToolRailDisabled : boolean ;
65+ onDisabledToolRailClick : ( ) => void ;
6466 targetImage : ImageRecord | null ;
6567 referenceImages : ImageRecord [ ] ;
6668 rightImage : ImageRecord | null ;
@@ -104,6 +106,8 @@ interface ImageToolsPanelBar {
104106export const ImageToolsBar : React . FC < ImageToolsPanelBar > = ( {
105107 appState,
106108 selectedModel,
109+ isToolRailDisabled,
110+ onDisabledToolRailClick,
107111 targetImage,
108112 referenceImages,
109113 rightImage,
@@ -138,6 +142,7 @@ export const ImageToolsBar: React.FC<ImageToolsPanelBar> = ({
138142 onToggleHistoryStar,
139143 onDismissError,
140144} ) => {
145+ const majorElementGap = "30px" ;
141146 const hasTargetImage = ! ! targetImage ;
142147 const debugLog = React . useCallback ( ( ...args : any [ ] ) => {
143148 try {
@@ -318,22 +323,57 @@ export const ImageToolsBar: React.FC<ImageToolsPanelBar> = ({
318323 </ Stack >
319324 ) }
320325
321- < Box sx = { { flex : 1 , display : "flex" , overflow : "hidden" , minHeight : 0 } } >
322- < ImageTool
323- onApplyTool = { onApplyTool }
324- isProcessing = { appState . isProcessing }
325- onCancelProcessing = { onCancelProcessing }
326- onToolSelect = { onToolSelect }
327- referenceImageCount = { referenceImages . length }
328- hasTargetImage = { hasTargetImage }
329- isAuthenticated = { appState . isAuthenticated }
330- selectedModel = { selectedModel }
331- activeToolId = { activeToolId }
332- paramsByTool = { toolParams }
333- onParamChange = { onParamChange }
334- selectedArtStyleId = { selectedArtStyleId }
335- onArtStyleChange = { onArtStyleChange }
336- />
326+ < Box
327+ sx = { {
328+ flex : 1 ,
329+ display : "flex" ,
330+ overflow : "hidden" ,
331+ minHeight : 0 ,
332+ columnGap : majorElementGap ,
333+ } }
334+ >
335+ < Box
336+ sx = { {
337+ position : "relative" ,
338+ display : "flex" ,
339+ opacity : isToolRailDisabled ? 0.45 : 1 ,
340+ transition : "opacity 180ms ease" ,
341+ } }
342+ >
343+ < ImageTool
344+ onApplyTool = { onApplyTool }
345+ isProcessing = { appState . isProcessing }
346+ onCancelProcessing = { onCancelProcessing }
347+ onToolSelect = { onToolSelect }
348+ referenceImageCount = { referenceImages . length }
349+ hasTargetImage = { hasTargetImage }
350+ isAuthenticated = { appState . isAuthenticated }
351+ selectedModel = { selectedModel }
352+ activeToolId = { activeToolId }
353+ paramsByTool = { toolParams }
354+ onParamChange = { onParamChange }
355+ selectedArtStyleId = { selectedArtStyleId }
356+ onArtStyleChange = { onArtStyleChange }
357+ />
358+ { isToolRailDisabled && (
359+ < Box
360+ component = "button"
361+ type = "button"
362+ aria-label = "Connect to OpenRouter to use tools"
363+ onClick = { onDisabledToolRailClick }
364+ sx = { {
365+ position : "absolute" ,
366+ inset : 0 ,
367+ zIndex : 2 ,
368+ cursor : "not-allowed" ,
369+ background : "transparent" ,
370+ border : 0 ,
371+ m : 0 ,
372+ p : 0 ,
373+ } }
374+ />
375+ ) }
376+ </ Box >
337377
338378 < DndContext
339379 sensors = { sensors }
@@ -415,6 +455,7 @@ export const ImageToolsBar: React.FC<ImageToolsPanelBar> = ({
415455 flex : 1 ,
416456 display : "flex" ,
417457 flexDirection : "column" ,
458+ rowGap : majorElementGap ,
418459 minWidth : 0 ,
419460 minHeight : 0 ,
420461 } }
0 commit comments