"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: tog: todo item #2 respond to key presses while "loading..."
To:
Mark Jamsek <mark@jamsek.com>, Game of Trees <gameoftrees@openbsd.org>
Date:
Sat, 13 Aug 2022 12:01:56 +0200

Download raw body.

Thread
On Sat, Aug 13, 2022 at 11:39:17AM +0200, Stefan Sperling wrote:
> On Fri, Aug 12, 2022 at 11:36:46PM +0200, Stefan Sperling wrote:
> > Here is a case where movement doesn't seem to work while loading:
> > 
> > 	tog log path
> > 
> > Where path is any file in a deep history that has seen few changes.
> > The top-level Makefile in OpenBSD src.git is one such file.
> 
> This can be fixed by... well, simply not waiting for the log thread.
> 
> In hindsight, the articicial blocking behaviour was probably a bad idea.
> If we remove related code, the tog log view remains responsive at all times.

This patch causes an issue when the cursor is on the last loaded and displayed
commit sits at the bottom of the terminal, and the user scrolls down one step.
The log view no longer loads _and_ scrolls with a single key press. Instead,
the first key press loads a commit but the cursor remains at its position.
A second key press is needed to scroll the window. The previous behaviour made
more sense in this particular case. However, we can probably emulate it somehow
without blocking any other action (which is bad in case the next commit takes,
say, 30 seconds to load). Instead, could we somehow trigger a scroll event in
case a commit has been loaded off-screen after a scroll-down request, and the
cursor has not been moved since... ?