@ibealec/create-zed-bridge 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/@zed-controller/react-bridge/dist/index.cjs +33 -7
- package/templates/@zed-controller/react-bridge/dist/index.cjs.map +1 -1
- package/templates/@zed-controller/react-bridge/dist/index.js +33 -7
- package/templates/@zed-controller/react-bridge/dist/index.js.map +1 -1
|
@@ -441,11 +441,34 @@ async function captureElementScreenshot(element, options = {}) {
|
|
|
441
441
|
useCORS: true,
|
|
442
442
|
allowTaint: true,
|
|
443
443
|
backgroundColor: null,
|
|
444
|
-
logging: false
|
|
444
|
+
logging: false,
|
|
445
|
+
// Ignore elements that might cause issues
|
|
446
|
+
ignoreElements: (el) => {
|
|
447
|
+
return el.tagName === "IFRAME" || el.tagName === "VIDEO";
|
|
448
|
+
},
|
|
449
|
+
onclone: (clonedDoc) => {
|
|
450
|
+
try {
|
|
451
|
+
const styleSheets = clonedDoc.styleSheets;
|
|
452
|
+
const fallbackStyle = clonedDoc.createElement("style");
|
|
453
|
+
fallbackStyle.textContent = `
|
|
454
|
+
* {
|
|
455
|
+
/* Fallback for elements using unsupported color functions */
|
|
456
|
+
--html2canvas-fallback: inherit;
|
|
457
|
+
}
|
|
458
|
+
`;
|
|
459
|
+
clonedDoc.head.appendChild(fallbackStyle);
|
|
460
|
+
} catch {
|
|
461
|
+
}
|
|
462
|
+
}
|
|
445
463
|
});
|
|
446
464
|
return canvas.toDataURL("image/png");
|
|
447
465
|
} catch (error) {
|
|
448
|
-
|
|
466
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
467
|
+
if (errorMessage.includes("unsupported color function") || errorMessage.includes("oklch") || errorMessage.includes("lab(") || errorMessage.includes("lch(")) {
|
|
468
|
+
console.debug("[ClaudeBridge] Screenshot skipped: page uses modern CSS colors not supported by html2canvas");
|
|
469
|
+
return void 0;
|
|
470
|
+
}
|
|
471
|
+
console.warn("[ClaudeBridge] Screenshot capture failed:", errorMessage);
|
|
449
472
|
return void 0;
|
|
450
473
|
}
|
|
451
474
|
}
|
|
@@ -1722,7 +1745,7 @@ function TaskStatusToast({
|
|
|
1722
1745
|
document.addEventListener("mousemove", handleMouseMove);
|
|
1723
1746
|
document.addEventListener("mouseup", handleMouseUp);
|
|
1724
1747
|
}, [size]);
|
|
1725
|
-
const killSession = useCallback3((sessionId) => {
|
|
1748
|
+
const killSession = useCallback3((sessionId, taskPrompt) => {
|
|
1726
1749
|
return new Promise((resolve) => {
|
|
1727
1750
|
const wsUrl = serverUrl.replace(/^http/, "ws").replace(/\/$/, "");
|
|
1728
1751
|
const ws = new WebSocket(`${wsUrl}/ws/bridge?token=${encodeURIComponent(token)}`);
|
|
@@ -1737,7 +1760,10 @@ function TaskStatusToast({
|
|
|
1737
1760
|
ws.onopen = () => {
|
|
1738
1761
|
ws.send(JSON.stringify({
|
|
1739
1762
|
type: "kill_session",
|
|
1740
|
-
sessionId
|
|
1763
|
+
sessionId,
|
|
1764
|
+
// Include task prompt for auto-commit message
|
|
1765
|
+
taskPrompt,
|
|
1766
|
+
autoCommit: true
|
|
1741
1767
|
}));
|
|
1742
1768
|
};
|
|
1743
1769
|
ws.onmessage = (event) => {
|
|
@@ -1758,17 +1784,17 @@ function TaskStatusToast({
|
|
|
1758
1784
|
resolve();
|
|
1759
1785
|
}
|
|
1760
1786
|
};
|
|
1761
|
-
setTimeout(cleanup,
|
|
1787
|
+
setTimeout(cleanup, 1e4);
|
|
1762
1788
|
});
|
|
1763
1789
|
}, [serverUrl, token]);
|
|
1764
1790
|
const handleDismiss = useCallback3(async () => {
|
|
1765
1791
|
if (killOnClose && task?.sessionId) {
|
|
1766
|
-
await killSession(task.sessionId);
|
|
1792
|
+
await killSession(task.sessionId, task.prompt);
|
|
1767
1793
|
}
|
|
1768
1794
|
setVisible(false);
|
|
1769
1795
|
setExpanded(false);
|
|
1770
1796
|
setTimeout(onDismiss, 300);
|
|
1771
|
-
}, [killOnClose, task?.sessionId, killSession, onDismiss]);
|
|
1797
|
+
}, [killOnClose, task?.sessionId, task?.prompt, killSession, onDismiss]);
|
|
1772
1798
|
const handleToggleExpand = useCallback3(() => {
|
|
1773
1799
|
setExpanded(!expanded);
|
|
1774
1800
|
}, [expanded]);
|