fix(app): editor route split into dialogs and pickers components, canvas without lint suppression, findings picker coverage restored; golden test pins every generated draft file; stale doc lines
This commit is contained in:
1 parent
0476276a8f
commit
09d8b01a54
11 files changed
+374
-161
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { useCallback, useEffect, useRef } from 'react'
|
||||
import { useCallback, useEffect, useLayoutEffect, useRef } from 'react'
|
||||
import { buildViewSvg, type ViewStates } from '@/anatomy/drawing'
|
||||
import type { SheetIndex } from '@/services/sheetIndex'
|
||||
import { useLocaleStore } from '@/state/localeStore'
|
||||
@@ -35,13 +35,16 @@ export default function AnatomyCanvas({
|
||||
const svgRef = useRef<HTMLDivElement | null>(null)
|
||||
const tooltipRef = useRef<HTMLDivElement | null>(null)
|
||||
const locale = useLocaleStore((s) => s.locale)
|
||||
// Latest states for the build effect, which must only re-run on a view change.
|
||||
const statesRef = useRef(states)
|
||||
useLayoutEffect(() => {
|
||||
statesRef.current = states
|
||||
}, [states])
|
||||
|
||||
useEffect(() => {
|
||||
const host = svgRef.current
|
||||
if (!host) return
|
||||
host.replaceChildren(buildViewSvg(index, viewId, states))
|
||||
// States are applied by the effect below; the build only needs the view.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
host.replaceChildren(buildViewSvg(index, viewId, statesRef.current))
|
||||
}, [index, viewId])
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in new issue
Block a user