diff --git a/visual_workflow_builder/frontend_v4/src/components/CaptureLibrary.tsx b/visual_workflow_builder/frontend_v4/src/components/CaptureLibrary.tsx
index fb8706d43..389579e7b 100644
--- a/visual_workflow_builder/frontend_v4/src/components/CaptureLibrary.tsx
+++ b/visual_workflow_builder/frontend_v4/src/components/CaptureLibrary.tsx
@@ -6,6 +6,12 @@ import {
compressThumbnail,
} from '../services/captureLibraryStorage';
+function b64ImgSrc(base64: string): string {
+ if (base64.startsWith('data:')) return base64;
+ const mime = base64.startsWith('/9j/') ? 'image/jpeg' : 'image/png';
+ return `data:${mime};base64,${base64}`;
+}
+
interface LibraryItem {
id: string;
capture: Capture;
@@ -149,7 +155,7 @@ export default function CaptureLibrary({ currentCapture, onSelectCapture, onCapt
{!isExpanded && currentCapture && (

setIsExpanded(true)}
/>
@@ -209,7 +215,7 @@ export default function CaptureLibrary({ currentCapture, onSelectCapture, onCapt
className={`library-item ${selectedItems.has(item.id) ? 'selected' : ''}`}
>

onSelectCapture(item.capture)}
/>
diff --git a/visual_workflow_builder/frontend_v4/src/components/CapturePanel.tsx b/visual_workflow_builder/frontend_v4/src/components/CapturePanel.tsx
index 4077022db..3ffc84bc1 100644
--- a/visual_workflow_builder/frontend_v4/src/components/CapturePanel.tsx
+++ b/visual_workflow_builder/frontend_v4/src/components/CapturePanel.tsx
@@ -7,6 +7,12 @@ import {
compressThumbnail,
} from '../services/captureLibraryStorage';
+function b64ImgSrc(base64: string): string {
+ if (base64.startsWith('data:')) return base64;
+ const mime = base64.startsWith('/9j/') ? 'image/jpeg' : 'image/png';
+ return `data:${mime};base64,${base64}`;
+}
+
interface DetectionZone {
x: number;
y: number;
@@ -106,7 +112,7 @@ export default function CapturePanel({
try {
const { detectUIElements } = await import('../services/uiDetection');
const result = await detectUIElements(
- `data:image/png;base64,${currentCapture.screenshot_base64}`,
+ {b64ImgSrc(currentCapture.screenshot_base64)},
{ threshold: 0.35 }
);
setPreviewElements(result.elements);
@@ -211,7 +217,7 @@ export default function CapturePanel({

setIsFullscreen(true)}
onLoad={handlePreviewImageLoad}
@@ -274,7 +280,7 @@ export default function CapturePanel({
{library.slice(0, 4).map(item => (

handleLibrarySelect(item)}
/>
@@ -315,7 +321,7 @@ export default function CapturePanel({
}}
>
@@ -382,7 +388,7 @@ function FullscreenSelector({
try {
const { detectUIElements } = await import('../services/uiDetection');
const result = await detectUIElements(
- `data:image/png;base64,${capture.screenshot_base64}`,
+ b64ImgSrc(capture.screenshot_base64),
{ threshold: 0.35 }
);
setDetectedElements(result.elements);
@@ -538,14 +544,14 @@ function FullscreenSelector({
onMouseUp={handleMouseUp}
>
{/* Conteneur relatif pour positionner les bboxes et la sélection par rapport à l'image */}
-
+

{/* Overlay des éléments détectés — visible dans tous les modes */}
diff --git a/visual_workflow_builder/frontend_v4/src/styles.css b/visual_workflow_builder/frontend_v4/src/styles.css
index a53212f52..b7abd9387 100644
--- a/visual_workflow_builder/frontend_v4/src/styles.css
+++ b/visual_workflow_builder/frontend_v4/src/styles.css
@@ -1079,11 +1079,16 @@ body {
justify-content: center;
overflow: auto;
position: relative;
+ height: 0;
+ min-height: 0;
}
.fullscreen-content img {
max-width: 100%;
max-height: 100%;
+ width: auto;
+ height: auto;
+ object-fit: contain;
cursor: crosshair;
}