tycono 0.3.23-beta.0 → 0.3.24-beta.0
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
CHANGED
|
@@ -362,25 +362,29 @@ export const CommandMode: React.FC<CommandModeProps> = ({
|
|
|
362
362
|
|
|
363
363
|
const eventLines = eventLinesRef.current;
|
|
364
364
|
|
|
365
|
-
// Merge
|
|
366
|
-
|
|
365
|
+
// Merge lines: system + events go to scrollback, user inputs are pinned in live area.
|
|
366
|
+
// Without pinning, long responses push ━━ > lines into Static scrollback → invisible.
|
|
367
|
+
const scrollableLines = [...systemMessages, ...eventLines]
|
|
367
368
|
.sort((a, b) => a.id - b.id)
|
|
368
369
|
.slice(-60);
|
|
369
370
|
|
|
370
|
-
// Reset committedRef if it exceeds
|
|
371
|
-
if (committedRef.current >
|
|
372
|
-
committedRef.current = Math.max(0,
|
|
371
|
+
// Reset committedRef if it exceeds scrollableLines (prevents unbounded growth)
|
|
372
|
+
if (committedRef.current > scrollableLines.length) {
|
|
373
|
+
committedRef.current = Math.max(0, scrollableLines.length - 4);
|
|
373
374
|
}
|
|
374
375
|
|
|
375
|
-
// Commit older lines to Static scrollback, keep last
|
|
376
|
-
const newCount =
|
|
377
|
-
if (newCount >
|
|
378
|
-
committedRef.current =
|
|
376
|
+
// Commit older lines to Static scrollback, keep last 4 as live
|
|
377
|
+
const newCount = scrollableLines.length - committedRef.current;
|
|
378
|
+
if (newCount > 4) {
|
|
379
|
+
committedRef.current = scrollableLines.length - 4;
|
|
379
380
|
}
|
|
380
381
|
|
|
381
382
|
// Only send last 20 committed items to Static (prevent Ink memory growth)
|
|
382
|
-
const committedLines =
|
|
383
|
-
|
|
383
|
+
const committedLines = scrollableLines.slice(Math.max(0, committedRef.current - 20), committedRef.current);
|
|
384
|
+
// Live area: last user input (pinned) + recent scrollable lines
|
|
385
|
+
const recentUserInput = userInputs.slice(-1); // Always show last ━━ > line
|
|
386
|
+
const scrollableLive = scrollableLines.slice(committedRef.current);
|
|
387
|
+
const liveLines = [...recentUserInput, ...scrollableLive].sort((a, b) => a.id - b.id);
|
|
384
388
|
|
|
385
389
|
// Autocomplete: filter commands when input starts with /
|
|
386
390
|
const acOpen = input.startsWith('/') && input.length >= 1;
|