Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

fix(frontend): document deliberate no-deps effect in image-view-block.tsx

dextmorgn74ce90f18d7b
diff --git a/flowsint-app/src/components/analyses/editor/extensions/image/components/image-view-block.tsx b/flowsint-app/src/components/analyses/editor/extensions/image/components/image-view-block.tsx
index 2b2de9ab..39f4b6c6 100644
--- a/flowsint-app/src/components/analyses/editor/extensions/image/components/image-view-block.tsx
+++ b/flowsint-app/src/components/analyses/editor/extensions/image/components/image-view-block.tsx
@@ -72,6 +72,12 @@ export const ImageViewBlock: React.FC<NodeViewProps> = ({
// after mount instead. containerRef.current is null on the first render,
// so Infinity is the correct starting value regardless.
const [containerMaxWidth, setContainerMaxWidth] = React.useState(Infinity)
+ // Deliberately no dependency array: --editor-width is a CSS custom
+ // property with no React-observable trigger (no prop/state changes when
+ // it does), so re-reading it after every commit is the only way to stay
+ // current — matches what reading it directly during render used to do,
+ // just moved somewhere safe to read the DOM from.
+ // eslint-disable-next-line react-hooks/exhaustive-deps
React.useLayoutEffect(() => {
if (!containerRef.current) return
setContainerMaxWidth(