tycono 0.3.8 → 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 +1 -17
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,
|
|
@@ -322,22 +322,6 @@ export const App: React.FC = () => {
|
|
|
322
322
|
// Focus most recent wave
|
|
323
323
|
setFocusedWaveId(allWaves[allWaves.length - 1]?.waveId ?? null);
|
|
324
324
|
autoWaveCreated.current = true;
|
|
325
|
-
} else if (api.loaded && api.pastWaves.length > 0) {
|
|
326
|
-
// No active waves, past waves exist — resume last wave (don't create new)
|
|
327
|
-
autoWaveCreated.current = true;
|
|
328
|
-
const pastEntries: WaveInfo[] = api.pastWaves.slice(0, 10).map(pw => ({
|
|
329
|
-
waveId: pw.id,
|
|
330
|
-
directive: pw.directive || '',
|
|
331
|
-
startedAt: pw.startedAt ? new Date(pw.startedAt).getTime() : 0,
|
|
332
|
-
}));
|
|
333
|
-
// Sort by startedAt ascending (oldest first = Wave 1)
|
|
334
|
-
pastEntries.sort((a, b) => a.startedAt - b.startedAt);
|
|
335
|
-
setWaves(pastEntries);
|
|
336
|
-
// Focus most recent wave (last in sorted list)
|
|
337
|
-
const lastWave = pastEntries[pastEntries.length - 1];
|
|
338
|
-
setFocusedWaveId(lastWave?.waveId ?? null);
|
|
339
|
-
|
|
340
|
-
// SSE replay handles history display automatically (persistent channel model)
|
|
341
325
|
} else if (api.loaded) {
|
|
342
326
|
// No active waves, no past waves — fresh start
|
|
343
327
|
autoWaveCreated.current = true;
|