feat(roof-shape): PDF 지붕형상 descriptor atom 저장 배선

[작업내용] :
- pdfRoofShapeDescriptorState atom 추가(outerLineAtom)
- analyzePdfAndApply: 분석 시작 시 리셋 + payload.roofShape 저장
- 소비(매칭·pre-select)는 다음 task

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
sangwook yoo 2026-06-24 14:51:53 +09:00
parent 9d60948e64
commit 28ea1e9b8e
2 changed files with 14 additions and 0 deletions

View File

@ -24,6 +24,7 @@ import { usePlan } from '@/hooks/usePlan'
import { normalizeDecimal } from '@/util/input-utils' import { normalizeDecimal } from '@/util/input-utils'
import { CalculatorInput } from '@/components/common/input/CalcInput' import { CalculatorInput } from '@/components/common/input/CalcInput'
import { usePdfImport } from '@/hooks/pdf-import/usePdfImport' import { usePdfImport } from '@/hooks/pdf-import/usePdfImport'
import { pdfRoofShapeDescriptorState } from '@/store/outerLineAtom'
import { logger } from '@/util/logger' import { logger } from '@/util/logger'
import { QcastContext } from '@/app/QcastProvider' import { QcastContext } from '@/app/QcastProvider'
// [LOW-PITCH-WARN 2026-05-06] + alert // [LOW-PITCH-WARN 2026-05-06] + alert
@ -87,6 +88,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
const { setPolygonLinesActualSize } = usePolygon() const { setPolygonLinesActualSize } = usePolygon()
const { setSelectedMenu } = useCanvasMenu() const { setSelectedMenu } = useCanvasMenu()
const setCurrentMenu = useSetRecoilState(currentMenuState) const setCurrentMenu = useSetRecoilState(currentMenuState)
const setPdfRoofShapeDescriptor = useSetRecoilState(pdfRoofShapeDescriptorState)
const roofRef = { const roofRef = {
roofCd: useRef(null), roofCd: useRef(null),
@ -174,6 +176,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
formData.append('floorPages', pdfFloorPages.trim()) formData.append('floorPages', pdfFloorPages.trim())
} }
setPdfRoofShapeDescriptor(null) // (cross-run staleness )
setPdfAnalyzing(true) setPdfAnalyzing(true)
setIsGlobalLoading(true) setIsGlobalLoading(true)
const controller = new AbortController() const controller = new AbortController()
@ -239,6 +242,8 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
return false return false
} }
setPdfRoofShapeDescriptor(payload.roofShape ?? null) // (C)
// (autoFix:false) ' ' . // (autoFix:false) ' ' .
const applied = await applyOuterline(payload.outerline, { unit: payload.unit || 'mm', autoFix: false }) const applied = await applyOuterline(payload.outerline, { unit: payload.unit || 'mm', autoFix: false })
if (!applied) { if (!applied) {

View File

@ -77,3 +77,12 @@ export const autoOuterLineFixState = atom({
key: 'autoOuterLineFixState', key: 'autoOuterLineFixState',
default: true, default: true,
}) })
/**
* PDF 분석이 산출한 지붕형상 서술자(RoofShapeDescriptor | null).
* analyzePdfAndApply 저장 useRoofShapeSetting 마운트 매칭·소비(consume-once).
*/
export const pdfRoofShapeDescriptorState = atom({
key: 'pdfRoofShapeDescriptorState',
default: null,
})