sync: backport monorepo PRs #240 #251 #253 (#225)

This commit is contained in:
Pascal
2026-04-13 11:24:13 -04:00
committed by GitHub
parent b25be8227a
commit 682e2a1a12
30 changed files with 1246 additions and 755 deletions
@@ -1,4 +1,4 @@
import { sceneRegistry } from '@pascal-app/core'
import { emitter, sceneRegistry } from '@pascal-app/core'
import { useEffect } from 'react'
import useViewer from '../../store/use-viewer'
@@ -14,5 +14,30 @@ export const ScanSystem = () => {
}
})
}, [showScans])
useEffect(() => {
const hideForCapture = () => {
const scans = sceneRegistry.byType.scan || new Set()
scans.forEach((scanId) => {
const node = sceneRegistry.nodes.get(scanId)
if (node) node.visible = false
})
}
const restoreAfterCapture = () => {
const showScansNow = useViewer.getState().showScans
const scans = sceneRegistry.byType.scan || new Set()
scans.forEach((scanId) => {
const node = sceneRegistry.nodes.get(scanId)
if (node) node.visible = showScansNow
})
}
emitter.on('thumbnail:before-capture', hideForCapture)
emitter.on('thumbnail:after-capture', restoreAfterCapture)
return () => {
emitter.off('thumbnail:before-capture', hideForCapture)
emitter.off('thumbnail:after-capture', restoreAfterCapture)
}
}, [])
return null
}