perf: Use tail-only replay by default for faster terminal loading

- Change default to tailOnly=true (was false)
- Reduce chunks from 500 to 200
- Applies to both FloatingTerminal and TerminalPage
This commit is contained in:
2026-02-14 13:26:27 -06:00
parent 2a01574d00
commit 2766cbfd0b
2 changed files with 3 additions and 3 deletions

View File

@@ -547,9 +547,9 @@ function scrollTerminal(direction: 'up' | 'down' | 'end') {
else renderer.scrollToBottom() else renderer.scrollToBottom()
} }
function requestReplay(tailOnly = false) { function requestReplay(tailOnly = true) {
if (socket?.readyState === WebSocket.OPEN) { if (socket?.readyState === WebSocket.OPEN) {
socket.send(JSON.stringify({ type: 'request-replay', tailOnly, chunks: 500 })) socket.send(JSON.stringify({ type: 'request-replay', tailOnly, chunks: 200 }))
} }
} }

View File

@@ -85,7 +85,7 @@ async function connect() {
isResumedSession.value = !msg.isNew isResumedSession.value = !msg.isNew
if (msg.hasHistory) { if (msg.hasHistory) {
socket?.send(JSON.stringify({ type: 'request-replay', tailOnly: false })) socket?.send(JSON.stringify({ type: 'request-replay', tailOnly: true, chunks: 200 }))
} else if (!msg.isNew) { } else if (!msg.isNew) {
renderer.writeln('\x1b[36m[Reconnected to existing session]\x1b[0m') renderer.writeln('\x1b[36m[Reconnected to existing session]\x1b[0m')
} }