u-foo 2.5.10 → 2.5.11
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/src/ui/ink/ChatApp.js +25 -2
package/package.json
CHANGED
package/src/ui/ink/ChatApp.js
CHANGED
|
@@ -1264,7 +1264,16 @@ function createChatApp({ React, ink, props, interactive = true }) {
|
|
|
1264
1264
|
appendChatHistory(activeChatHistoryRoot, kind, text, meta, activeChatHistoryOptions);
|
|
1265
1265
|
}, [activeChatHistoryRoot, activeChatHistoryOptions.globalMode]);
|
|
1266
1266
|
|
|
1267
|
+
// Terminal statuses (command replies, ✓/✗ resolutions) must not animate
|
|
1268
|
+
// forever; show them briefly, then revert the status line to Ready.
|
|
1269
|
+
const statusAutoClearRef = useRef(null);
|
|
1270
|
+
|
|
1267
1271
|
const setStatusText = useCallback((text, options = {}) => {
|
|
1272
|
+
// Any new status supersedes a pending auto-clear.
|
|
1273
|
+
if (statusAutoClearRef.current) {
|
|
1274
|
+
clearTimeout(statusAutoClearRef.current);
|
|
1275
|
+
statusAutoClearRef.current = null;
|
|
1276
|
+
}
|
|
1268
1277
|
const clean = stripBlessedTags(text).trim();
|
|
1269
1278
|
if (!clean) {
|
|
1270
1279
|
dispatch({ type: "status/idle" });
|
|
@@ -1282,6 +1291,15 @@ function createChatApp({ React, ink, props, interactive = true }) {
|
|
|
1282
1291
|
});
|
|
1283
1292
|
}, []);
|
|
1284
1293
|
|
|
1294
|
+
const scheduleStatusAutoClear = useCallback(() => {
|
|
1295
|
+
if (statusAutoClearRef.current) clearTimeout(statusAutoClearRef.current);
|
|
1296
|
+
statusAutoClearRef.current = setTimeout(() => {
|
|
1297
|
+
statusAutoClearRef.current = null;
|
|
1298
|
+
dispatch({ type: "status/idle" });
|
|
1299
|
+
}, 5000);
|
|
1300
|
+
if (typeof statusAutoClearRef.current.unref === "function") statusAutoClearRef.current.unref();
|
|
1301
|
+
}, []);
|
|
1302
|
+
|
|
1285
1303
|
const logInkMessage = useCallback((kind, text, meta = {}) => {
|
|
1286
1304
|
const type = String(kind || "system");
|
|
1287
1305
|
if (type === "status") {
|
|
@@ -1786,13 +1804,18 @@ function createChatApp({ React, ink, props, interactive = true }) {
|
|
|
1786
1804
|
updateDashboard: updateDashboardFromStatus,
|
|
1787
1805
|
requestStatus: requestDaemonStatus,
|
|
1788
1806
|
resolveStatusLine: (text, data = {}) => {
|
|
1807
|
+
// Terminal status: static (no UFO) and auto-revert to Ready.
|
|
1789
1808
|
setStatusText(text, {
|
|
1790
|
-
type: data && data.phase === "error" ? "error" : "
|
|
1809
|
+
type: data && data.phase === "error" ? "error" : "none",
|
|
1791
1810
|
showTimer: false,
|
|
1792
1811
|
});
|
|
1812
|
+
scheduleStatusAutoClear();
|
|
1793
1813
|
},
|
|
1794
1814
|
enqueueBusStatus: (item = {}) => setStatusText(item.text || "Processing bus message", { type: "typing" }),
|
|
1795
|
-
resolveBusStatus: (item = {}) =>
|
|
1815
|
+
resolveBusStatus: (item = {}) => {
|
|
1816
|
+
setStatusText(item.text || "Bus message processed", { type: "done" });
|
|
1817
|
+
scheduleStatusAutoClear();
|
|
1818
|
+
},
|
|
1796
1819
|
getPending: () => pendingRef.current,
|
|
1797
1820
|
setPending: (value) => { pendingRef.current = value || null; },
|
|
1798
1821
|
resolveAgentDisplayName: (value) => {
|