tilt-dev / tilt

Define your dev environment as code. For microservice apps on Kubernetes.
https://tilt.dev/
Apache License 2.0
7.7k stars 303 forks source link

Log pane scrolls to top when truncating #6381

Open jnystad opened 5 months ago

jnystad commented 5 months ago

Expected Behavior

Scroll (line) position is preserved (if possible), even when truncating logs.

Current Behavior

When LogStore triggers ensureMaxLength, and the log size is larger than max allowed, the LogUpdateAction.truncate is invoked, causing a resetRender in OverviewLogPane. This also resets the scroll position to start of logs when browsing the logs.

Steps to Reproduce

  1. Have a log pane open for something producing a lot of logs
  2. Scroll somewhere in the log stream (other than end and start)
  3. Wait until max log size is reached

Context

tilt doctor Output

$ tilt doctor
Tilt: v0.33.14, built 2024-05-15
System: linux-amd64
...

About Your Use Case

This makes log inspecting in tilt dashboard quite frustrating, and somewhat useless for containers with high log output.

Might be the cause of or related to #6096

JarrodM-M commented 4 months ago

This behaviour is driving me nuts too!

I'll be reading through some logs and without warning the scroll position shoots straight to the top. It's like playing a game of Perfection with cmd+c when I need to copy some log data to share.