@@ -76,7 +76,7 @@ import {
7676 ADJUSTMENT_SECTIONS ,
7777} from '../../../utils/adjustments' ;
7878import { useContextMenu } from '../../../context/ContextMenuContext' ;
79- import { OPTION_SEPARATOR , Orientation } from '../../ui/AppProperties' ;
79+ import { OPTION_SEPARATOR , Orientation , Panel } from '../../ui/AppProperties' ;
8080import { createSubMask } from '../../../utils/maskUtils' ;
8181import { usePresets } from '../../../hooks/usePresets' ;
8282import Text from '../../ui/Text' ;
@@ -251,7 +251,23 @@ export default function MasksPanel() {
251251 const { t } = useTranslation ( ) ;
252252 const { setAdjustments } = useEditorActions ( ) ;
253253 const { handleGenerateAiDepthMask, handleGenerateAiForegroundMask, handleGenerateAiSkyMask } = useAiMasking ( ) ;
254- const setCustomEscapeHandler = useUIStore ( ( s ) => s . setCustomEscapeHandler ) ;
254+ const { setCustomEscapeHandler, isAdjustmentsPanelVisible } = useUIStore (
255+ useShallow ( ( state ) => {
256+ const leftVisible = state . uiVisibility . leftPanel ;
257+ const rightVisible = state . uiVisibility . rightPanel ;
258+
259+ const isVisible =
260+ ( leftVisible && state . activePanels . leftTop === Panel . Adjustments ) ||
261+ ( leftVisible && state . activePanels . leftBottom === Panel . Adjustments ) ||
262+ ( rightVisible && state . activePanels . rightTop === Panel . Adjustments ) ||
263+ ( rightVisible && state . activePanels . rightBottom === Panel . Adjustments ) ;
264+
265+ return {
266+ setCustomEscapeHandler : state . setCustomEscapeHandler ,
267+ isAdjustmentsPanelVisible : isVisible ,
268+ } ;
269+ } ) ,
270+ ) ;
255271 const { appSettings } = useSettingsStore (
256272 useShallow ( ( state ) => ( {
257273 appSettings : state . appSettings ,
@@ -969,10 +985,19 @@ export default function MasksPanel() {
969985 < button
970986 className = { clsx (
971987 'p-2 rounded-full transition-colors' ,
972- isWaveformVisible ? 'bg-surface hover:bg-card-active' : 'hover:bg-surface' ,
988+ isAdjustmentsPanelVisible
989+ ? 'opacity-50 cursor-not-allowed text-text-secondary'
990+ : isWaveformVisible
991+ ? 'bg-surface hover:bg-card-active'
992+ : 'hover:bg-surface' ,
973993 ) }
974994 onClick = { onToggleWaveform }
975- data-tooltip = { t ( 'editor.masks.toggleAnalyticsTooltip' ) }
995+ disabled = { isAdjustmentsPanelVisible }
996+ data-tooltip = {
997+ isAdjustmentsPanelVisible
998+ ? t ( 'editor.masks.toggleAnalyticsInAdjustments' )
999+ : t ( 'editor.masks.toggleAnalyticsTooltip' )
1000+ }
9761001 >
9771002 < ChartArea size = { 18 } />
9781003 </ button >
@@ -987,7 +1012,7 @@ export default function MasksPanel() {
9871012 </ div >
9881013
9891014 < AnimatePresence initial = { false } >
990- { isWaveformVisible && (
1015+ { isWaveformVisible && ! isAdjustmentsPanelVisible && (
9911016 < motion . div
9921017 initial = { { height : 0 , opacity : 0 } }
9931018 animate = { { height : waveformHeight || 256 , opacity : 1 } }
0 commit comments