@gxp-dev/tools 2.0.14 → 2.0.16
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/bin/lib/tui/App.tsx +24 -21
- package/bin/lib/tui/components/CommandInput.tsx +11 -3
- package/browser-extensions/firefox/popup.html +478 -519
- package/browser-extensions/firefox/popup.js +444 -500
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +24 -22
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/components/CommandInput.d.ts.map +1 -1
- package/dist/tui/components/CommandInput.js +13 -3
- package/dist/tui/components/CommandInput.js.map +1 -1
- package/package.json +1 -1
package/bin/lib/tui/App.tsx
CHANGED
|
@@ -451,30 +451,33 @@ export default function App({ autoStart, args }: AppProps) {
|
|
|
451
451
|
};
|
|
452
452
|
|
|
453
453
|
const addSystemLog = (message: string) => {
|
|
454
|
-
//
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
}
|
|
454
|
+
// Use functional update to properly handle rapid successive calls
|
|
455
|
+
setServices(prev => {
|
|
456
|
+
const existingSystem = prev.find(s => s.id === 'system');
|
|
457
|
+
if (existingSystem) {
|
|
458
|
+
// Add message to existing system service
|
|
459
|
+
return prev.map(s =>
|
|
460
|
+
s.id === 'system' ? { ...s, logs: [...s.logs, message] } : s
|
|
461
|
+
);
|
|
462
|
+
} else {
|
|
463
|
+
// Create new system service with the message
|
|
464
|
+
const newService: Service = {
|
|
465
|
+
id: 'system',
|
|
466
|
+
name: 'System',
|
|
467
|
+
status: 'running',
|
|
468
|
+
logs: [message],
|
|
469
|
+
};
|
|
470
|
+
return [...prev, newService];
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
473
|
|
|
474
474
|
// Switch to system tab
|
|
475
475
|
setTimeout(() => {
|
|
476
|
-
|
|
477
|
-
|
|
476
|
+
setServices(current => {
|
|
477
|
+
const sysIdx = current.findIndex(s => s.id === 'system');
|
|
478
|
+
if (sysIdx >= 0) setActiveTab(sysIdx);
|
|
479
|
+
return current; // Don't modify, just read
|
|
480
|
+
});
|
|
478
481
|
}, 50);
|
|
479
482
|
};
|
|
480
483
|
|
|
@@ -124,14 +124,22 @@ export default function CommandInput({ onSubmit, activeService, onSuggestionsCha
|
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
// Up/Down to navigate suggestions when showing
|
|
127
|
+
// Up/Down to navigate suggestions when showing (circular navigation)
|
|
128
128
|
if (showSuggestions) {
|
|
129
129
|
if (key.upArrow) {
|
|
130
|
-
setSelectedSuggestion(prev =>
|
|
130
|
+
setSelectedSuggestion(prev => {
|
|
131
|
+
// Wrap to bottom when at top
|
|
132
|
+
if (prev <= 0) return suggestions.length - 1;
|
|
133
|
+
return prev - 1;
|
|
134
|
+
});
|
|
131
135
|
return;
|
|
132
136
|
}
|
|
133
137
|
if (key.downArrow) {
|
|
134
|
-
setSelectedSuggestion(prev =>
|
|
138
|
+
setSelectedSuggestion(prev => {
|
|
139
|
+
// Wrap to top when at bottom
|
|
140
|
+
if (prev >= suggestions.length - 1) return 0;
|
|
141
|
+
return prev + 1;
|
|
142
|
+
});
|
|
135
143
|
return;
|
|
136
144
|
}
|
|
137
145
|
} else {
|