agent tracker + tmux update

This commit is contained in:
David Chen 2026-03-25 12:13:26 -07:00
parent cd9c92b1c2
commit 5064629d61
68 changed files with 15041 additions and 3483 deletions

View file

@ -0,0 +1,17 @@
package main
func stableListOffset(currentOffset, selectedIndex, visibleRows, totalRows int) int {
if totalRows <= 0 || visibleRows <= 0 {
return 0
}
maxOffset := maxInt(0, totalRows-visibleRows)
offset := clampInt(currentOffset, 0, maxOffset)
selected := clampInt(selectedIndex, 0, totalRows-1)
if selected < offset {
offset = selected
}
if selected >= offset+visibleRows {
offset = selected - visibleRows + 1
}
return clampInt(offset, 0, maxOffset)
}