tycono 0.3.7 → 0.3.9
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/tui/app.tsx +4 -18
package/package.json
CHANGED
package/src/tui/app.tsx
CHANGED
|
@@ -297,7 +297,7 @@ export const App: React.FC = () => {
|
|
|
297
297
|
useEffect(() => {
|
|
298
298
|
if (view !== 'dashboard' || autoWaveCreated.current) return;
|
|
299
299
|
|
|
300
|
-
if (api.activeWaves.length > 0) {
|
|
300
|
+
if (api.activeWaves.length > 0 || api.pastWaves.length > 0) {
|
|
301
301
|
// Attach to existing active waves from API
|
|
302
302
|
const apiWaves: WaveInfo[] = api.activeWaves.map(w => ({
|
|
303
303
|
waveId: w.waveId,
|
|
@@ -317,25 +317,11 @@ export const App: React.FC = () => {
|
|
|
317
317
|
}));
|
|
318
318
|
|
|
319
319
|
const allWaves = [...pastEntries, ...apiWaves];
|
|
320
|
+
allWaves.sort((a, b) => a.startedAt - b.startedAt);
|
|
320
321
|
setWaves(allWaves);
|
|
321
|
-
|
|
322
|
+
// Focus most recent wave
|
|
323
|
+
setFocusedWaveId(allWaves[allWaves.length - 1]?.waveId ?? null);
|
|
322
324
|
autoWaveCreated.current = true;
|
|
323
|
-
} else if (api.loaded && api.pastWaves.length > 0) {
|
|
324
|
-
// No active waves, past waves exist — resume last wave (don't create new)
|
|
325
|
-
autoWaveCreated.current = true;
|
|
326
|
-
const pastEntries: WaveInfo[] = api.pastWaves.slice(0, 10).map(pw => ({
|
|
327
|
-
waveId: pw.id,
|
|
328
|
-
directive: pw.directive || '',
|
|
329
|
-
startedAt: pw.startedAt ? new Date(pw.startedAt).getTime() : 0,
|
|
330
|
-
}));
|
|
331
|
-
// Sort by startedAt ascending (oldest first = Wave 1)
|
|
332
|
-
pastEntries.sort((a, b) => a.startedAt - b.startedAt);
|
|
333
|
-
setWaves(pastEntries);
|
|
334
|
-
// Focus most recent wave (last in sorted list)
|
|
335
|
-
const lastWave = pastEntries[pastEntries.length - 1];
|
|
336
|
-
setFocusedWaveId(lastWave?.waveId ?? null);
|
|
337
|
-
|
|
338
|
-
// SSE replay handles history display automatically (persistent channel model)
|
|
339
325
|
} else if (api.loaded) {
|
|
340
326
|
// No active waves, no past waves — fresh start
|
|
341
327
|
autoWaveCreated.current = true;
|