@ibealec/create-zed-bridge 1.0.9 → 1.0.10
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 +63 -11
- package/templates/@zed-controller/react-bridge/dist/index.cjs.map +1 -1
- package/templates/@zed-controller/react-bridge/dist/index.js +63 -11
- package/templates/@zed-controller/react-bridge/dist/index.js.map +1 -1
|
@@ -1693,6 +1693,7 @@ function TaskStatusToast({
|
|
|
1693
1693
|
const [expanded, setExpanded] = useState4(false);
|
|
1694
1694
|
const [size, setSize] = useState4({ width: DEFAULT_WIDTH, height: DEFAULT_HEIGHT });
|
|
1695
1695
|
const [isResizing, setIsResizing] = useState4(false);
|
|
1696
|
+
const [isSaving, setIsSaving] = useState4(false);
|
|
1696
1697
|
const resizeRef = useRef5(null);
|
|
1697
1698
|
useEffect5(() => {
|
|
1698
1699
|
if (task) {
|
|
@@ -1784,12 +1785,17 @@ function TaskStatusToast({
|
|
|
1784
1785
|
resolve();
|
|
1785
1786
|
}
|
|
1786
1787
|
};
|
|
1787
|
-
setTimeout(cleanup,
|
|
1788
|
+
setTimeout(cleanup, 35e3);
|
|
1788
1789
|
});
|
|
1789
1790
|
}, [serverUrl, token]);
|
|
1790
1791
|
const handleDismiss = useCallback3(async () => {
|
|
1791
1792
|
if (killOnClose && task?.sessionId) {
|
|
1792
|
-
|
|
1793
|
+
setIsSaving(true);
|
|
1794
|
+
try {
|
|
1795
|
+
await killSession(task.sessionId, task.prompt);
|
|
1796
|
+
} finally {
|
|
1797
|
+
setIsSaving(false);
|
|
1798
|
+
}
|
|
1793
1799
|
}
|
|
1794
1800
|
setVisible(false);
|
|
1795
1801
|
setExpanded(false);
|
|
@@ -1804,9 +1810,10 @@ function TaskStatusToast({
|
|
|
1804
1810
|
starting: { bg: "#f59e0b", text: "Starting..." },
|
|
1805
1811
|
running: { bg: "#22c55e", text: "Running" },
|
|
1806
1812
|
completed: { bg: "#22c55e", text: "Completed" },
|
|
1807
|
-
failed: { bg: "#ef4444", text: "Failed" }
|
|
1813
|
+
failed: { bg: "#ef4444", text: "Failed" },
|
|
1814
|
+
saving: { bg: "#f59e0b", text: "Saving..." }
|
|
1808
1815
|
};
|
|
1809
|
-
const status = statusColors[task.status] || statusColors.queued;
|
|
1816
|
+
const status = isSaving ? statusColors.saving : statusColors[task.status] || statusColors.queued;
|
|
1810
1817
|
const zedUrl = task.sessionId ? `${serverUrl}?token=${encodeURIComponent(token)}&session=${task.sessionId}` : `${serverUrl}?token=${encodeURIComponent(token)}`;
|
|
1811
1818
|
const handleOpenZed = () => {
|
|
1812
1819
|
window.open(zedUrl, "_blank");
|
|
@@ -1873,16 +1880,17 @@ function TaskStatusToast({
|
|
|
1873
1880
|
"button",
|
|
1874
1881
|
{
|
|
1875
1882
|
onClick: handleDismiss,
|
|
1883
|
+
disabled: isSaving,
|
|
1876
1884
|
style: {
|
|
1877
1885
|
background: "transparent",
|
|
1878
1886
|
border: "none",
|
|
1879
|
-
color: "rgba(255, 255, 255, 0.5)",
|
|
1880
|
-
cursor: "pointer",
|
|
1887
|
+
color: isSaving ? "rgba(255, 255, 255, 0.3)" : "rgba(255, 255, 255, 0.5)",
|
|
1888
|
+
cursor: isSaving ? "not-allowed" : "pointer",
|
|
1881
1889
|
padding: 4,
|
|
1882
1890
|
fontSize: 18,
|
|
1883
1891
|
lineHeight: 1
|
|
1884
1892
|
},
|
|
1885
|
-
children: "\xD7"
|
|
1893
|
+
children: isSaving ? "..." : "\xD7"
|
|
1886
1894
|
}
|
|
1887
1895
|
)
|
|
1888
1896
|
]
|
|
@@ -2137,17 +2145,61 @@ function TaskStatusToast({
|
|
|
2137
2145
|
"button",
|
|
2138
2146
|
{
|
|
2139
2147
|
onClick: handleDismiss,
|
|
2140
|
-
|
|
2148
|
+
disabled: isSaving,
|
|
2149
|
+
title: isSaving ? "Saving changes..." : "Close",
|
|
2141
2150
|
style: {
|
|
2142
2151
|
background: "transparent",
|
|
2143
2152
|
border: "none",
|
|
2144
|
-
color: "rgba(255, 255, 255, 0.5)",
|
|
2145
|
-
cursor: "pointer",
|
|
2153
|
+
color: isSaving ? "rgba(255, 255, 255, 0.3)" : "rgba(255, 255, 255, 0.5)",
|
|
2154
|
+
cursor: isSaving ? "not-allowed" : "pointer",
|
|
2146
2155
|
padding: 4,
|
|
2147
2156
|
fontSize: 18,
|
|
2148
2157
|
lineHeight: 1
|
|
2149
2158
|
},
|
|
2150
|
-
children: "\xD7"
|
|
2159
|
+
children: isSaving ? "..." : "\xD7"
|
|
2160
|
+
}
|
|
2161
|
+
)
|
|
2162
|
+
]
|
|
2163
|
+
}
|
|
2164
|
+
),
|
|
2165
|
+
isSaving && /* @__PURE__ */ jsxs5(
|
|
2166
|
+
"div",
|
|
2167
|
+
{
|
|
2168
|
+
style: {
|
|
2169
|
+
position: "absolute",
|
|
2170
|
+
top: 0,
|
|
2171
|
+
left: 0,
|
|
2172
|
+
right: 0,
|
|
2173
|
+
bottom: 0,
|
|
2174
|
+
background: "rgba(0, 0, 0, 0.7)",
|
|
2175
|
+
display: "flex",
|
|
2176
|
+
flexDirection: "column",
|
|
2177
|
+
alignItems: "center",
|
|
2178
|
+
justifyContent: "center",
|
|
2179
|
+
zIndex: 10,
|
|
2180
|
+
borderRadius: 12
|
|
2181
|
+
},
|
|
2182
|
+
children: [
|
|
2183
|
+
/* @__PURE__ */ jsx5(
|
|
2184
|
+
"div",
|
|
2185
|
+
{
|
|
2186
|
+
style: {
|
|
2187
|
+
color: "#f59e0b",
|
|
2188
|
+
fontSize: 14,
|
|
2189
|
+
fontWeight: 500,
|
|
2190
|
+
marginBottom: 8
|
|
2191
|
+
},
|
|
2192
|
+
children: "Saving changes..."
|
|
2193
|
+
}
|
|
2194
|
+
),
|
|
2195
|
+
/* @__PURE__ */ jsx5(
|
|
2196
|
+
"div",
|
|
2197
|
+
{
|
|
2198
|
+
style: {
|
|
2199
|
+
color: "rgba(255, 255, 255, 0.6)",
|
|
2200
|
+
fontSize: 12
|
|
2201
|
+
},
|
|
2202
|
+
children: "Generating commit message with AI"
|
|
2151
2203
|
}
|
|
2152
2204
|
)
|
|
2153
2205
|
]
|