Compare commits

...

2 Commits

Author SHA1 Message Date
Glary-Bot
9529182117 fix: watch composite bottom-panel rendered condition incl. focusMode
Address review: bottomPanelVisible alone misses the focusMode case
(splitter hides the panel when focusMode is on, regardless of the
store flag). Compose the same condition the splitter uses so toggling
focusMode while the panel is open also triggers the redraw/resync.
2026-05-15 21:28:19 +00:00
Glary-Bot
bb3731bcd9 fix: redraw canvas and resync slot layouts on bottom-panel toggle
Belt-and-braces for the bottom-panel/node-displacement bug. The
PrimeVue Splitter changes the canvas container size which triggers
the canvas ResizeObserver and the per-node Vue ResizeObservers, but
both have failure modes during animated transitions (RAF batching,
suspended-tab handling, stale viewport state on the first measurement).
Explicitly request a slot layout resync and setDirty(true, true) on
the canvas when bottomPanelVisible flips, so links stay aligned with
slot connectors regardless of what the RO chain did during the
transition.

Mirrors the existing linearMode watcher pattern in this file.
2026-05-15 21:23:25 +00:00

View File

@@ -181,6 +181,7 @@ import { useCommandStore } from '@/stores/commandStore'
import { useExecutionStore } from '@/stores/executionStore'
import { useExecutionErrorStore } from '@/stores/executionErrorStore'
import { useNodeDefStore } from '@/stores/nodeDefStore'
import { useBottomPanelStore } from '@/stores/workspace/bottomPanelStore'
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'
import { useSearchBoxStore } from '@/stores/workspace/searchBoxStore'
import { useAppMode } from '@/composables/useAppMode'
@@ -297,6 +298,25 @@ watch(
}
)
const { bottomPanelVisible } = storeToRefs(useBottomPanelStore())
// Mirror the splitter's rendered condition: the bottom panel is hidden when
// focusMode is on, regardless of bottomPanelVisible (see
// LiteGraphCanvasSplitterOverlay.vue). Watching the composite means entering
// or leaving focus mode while the panel is open also triggers the redraw.
const bottomPanelRendered = computed(
() => bottomPanelVisible.value && !workspaceStore.focusMode
)
watch(bottomPanelRendered, () => {
// The splitter resizes the canvas container, which triggers the canvas
// ResizeObserver and (eventually) the per-node Vue ResizeObservers. Force a
// slot/link redraw once the splitter has settled so links stay aligned with
// slot connectors even if any RO callback was missed or measured stale
// viewport state during the transition.
if (!canvasStore.canvas) return
requestSlotLayoutSyncForAllNodes()
canvasStore.canvas.setDirty(true, true)
})
function onLinkOverlayReady(el: HTMLCanvasElement) {
if (!canvasStore.canvas) return
canvasStore.canvas.overlayCanvas = el