Commit Graph
13 Commits
Author SHA1 Message Date
Stefan HallerandClaude Opus 4.8 2420fc7b76 Lock the status list when reading it
GetStatusString and HasStatus read the statuses slice without holding
the mutex that addStatus and removeStatus take when they mutate it. The
readers run on the spinner-render worker (which polls GetStatusString
every frame) while removeStatus fires from the waiting-status and
toast-expiry goroutines, so the unguarded reads race the concurrent
writes. Take the mutex in the readers too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 18:24:18 +02:00
Stefan Haller 196e0a3c17 Copy gocui files into lazygit repo under pkg/gocui
I copied all files except dot files (.github and .gitignore), the _examples
folder, and go.mod/go.sum.

At some point we may want to copy the files back to the gocui repo when other
clients (e.g. lazydocker) want to use the newer versions of them.
2026-04-30 14:29:08 +02:00
Stefan Haller 252dda5220 Move Loader to presentation package
It is very gui specific and shouldn't be in a low-level utils package.
2025-05-06 09:52:53 +02:00
Stefan Haller 5396a70661 Clean up error handling of WithWaitingStatus and WithWaitingStatusSync 2024-04-18 10:10:30 +02:00
Artem BelyakovandStefan Haller f3dba743f0 Add SpinnerConfig
This new config section allows to customize frames and rate of
thespinner
2024-04-06 13:46:15 +02:00
Stefan Haller f133224683 Double the duration of error toasts
This gives users more time to read them.
2024-01-14 17:45:35 +01:00
Stefan Haller 99a3ccde71 Add ErrorToast function 2024-01-14 17:45:35 +01:00
Stefan Haller 23befdd13a Pass "now" into utils.Loader
This makes it possible to write deterministic tests for views that use it.
2023-10-16 09:03:07 +02:00
Stefan Haller 1359fa14c1 When pausing a task during a waiting status, hide the status while paused
We do this for two reasons:
- when popping up a credentials prompt, it looks distracting if the waiting
  status keeps spinning while the user is typing the password
- the task that updates the waiting status periodically would keep the program
  busy, so integration tests would wait forever for the program to become idle
  again
2023-09-20 13:29:30 +02:00
Stefan Haller c222a618a8 Extract WaitingStatusHandle 2023-09-20 13:29:11 +02:00
Stefan Haller 05c32e292e Extract StatusManager.addStatus method
Avoids a bit of code duplication.
2023-09-20 11:27:50 +02:00
Jesse Duffield e33fe37a99 Standardise on using lo for slice functions
We've been sometimes using lo and sometimes using my slices package, and we need to pick one
for consistency. Lo is more extensive and better maintained so we're going with that.

My slices package was a superset of go's own slices package so in some places I've just used
the official one (the methods were just wrappers anyway).

I've also moved the remaining methods into the utils package.
2023-07-30 18:51:23 +10:00
Jesse Duffield db12853bbe lots of changes 2023-04-30 13:19:53 +10:00