chore: merge branch 'master' into v2-exp

This commit is contained in:
Ayman Bagabas
2024-10-21 14:16:22 -04:00
18 changed files with 140 additions and 88 deletions
+3 -10
View File
@@ -4,7 +4,7 @@ import (
"fmt"
"math"
"strings"
"sync"
"sync/atomic"
"time"
tea "github.com/charmbracelet/bubbletea/v2"
@@ -17,17 +17,10 @@ import (
// Internal ID management. Used during animating to assure that frame messages
// can only be received by progress components that sent them.
var (
lastID int
idMtx sync.Mutex
)
var lastID int64
// Return the next ID we should use on the model.
func nextID() int {
idMtx.Lock()
defer idMtx.Unlock()
lastID++
return lastID
return int(atomic.AddInt64(&lastID, 1))
}
const (