Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,14 @@ The other top-level views are:
releases its per-thread writer lock and clears every attention badge.
A session already included in the current Monitor recording can remain as an
`IDLE` historical row so its completed metrics and graph are not discarded.
Click the themed `[×]` in a session metrics box to hide that row for the
current run without closing or altering the Codex session. Codexometer keeps
collecting its telemetry while hidden and restores the row automatically
when tokens, model calls, turn timing, durable activity, or attention moves
forward, or when an inactive session becomes active again. An alert already
visible when `[×]` is clicked is dismissed with its row; a later new or
changed alert restores it. Starting a new Monitor recording also restores
every dismissed row.
When the terminal cannot fit every root, use Page Up, Page Down, or the mouse
wheel to page through the rows. Stop performs an immediate final local read
instead of relying on the latest graph sample.
Expand Down Expand Up @@ -1016,9 +1024,9 @@ need Go or Codexometer's source dependencies.
## Versioning

Codexometer follows semantic versioning; the current source version is
`v0.7.5`. The Git tag is the release source of truth. Go automatically embeds
`v0.7.6`. The Git tag is the release source of truth. Go automatically embeds
that tag in binaries built with
`go install github.com/merefield/codexometer@v0.7.5`; direct source builds fall
`go install github.com/merefield/codexometer@v0.7.6`; direct source builds fall
back to the maintained value in `internal/version/version.go`.

Both forms report the embedded version and exit without starting the interface:
Expand All @@ -1031,7 +1039,7 @@ codexometer --version
Release automation can override the source-build fallback without editing code:

```sh
go build -ldflags="-s -w -X github.com/merefield/codexometer/internal/version.Fallback=0.7.5" .
go build -ldflags="-s -w -X github.com/merefield/codexometer/internal/version.Fallback=0.7.6" .
```

## How refresh works
Expand Down Expand Up @@ -1126,8 +1134,8 @@ go test -cover ./...
Codexometer uses:

- Go 1.26.6+
- Bubble Tea for the terminal event loop
- Lip Gloss for adaptive ANSI styling
- Bubble Tea v2 for the terminal event loop and declarative terminal modes
- Lip Gloss v2 for adaptive ANSI styling and layout
- Starlark for deterministic, hermetic benchmark-code evaluation
- Codex app-server JSON-RPC for authenticated quota data
- Local Codex rollout `token_count` records for live Monitor telemetry
Expand Down
30 changes: 15 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ module github.com/merefield/codexometer
go 1.26.6

require (
github.com/charmbracelet/bubbletea v1.2.4
github.com/charmbracelet/lipgloss v1.0.0
github.com/charmbracelet/x/ansi v0.4.5
charm.land/bubbletea/v2 v2.0.8
charm.land/lipgloss/v2 v2.0.6
github.com/charmbracelet/x/ansi v0.11.8
github.com/gorilla/websocket v1.5.3
go.starlark.net v0.0.0-20260708150628-5395d018f003
golang.org/x/sys v0.42.0
golang.org/x/sys v0.47.0
)

require (
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/charmbracelet/x/term v0.2.1 // indirect
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/charmbracelet/colorprofile v0.4.3 // indirect
github.com/charmbracelet/ultraviolet v0.0.0-20260811164956-006e29f97886 // indirect
github.com/charmbracelet/x/term v0.2.2 // indirect
github.com/charmbracelet/x/termios v0.1.1 // indirect
github.com/charmbracelet/x/windows v0.2.2 // indirect
github.com/clipperhouse/displaywidth v0.11.0 // indirect
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/lucasb-eyer/go-colorful v1.4.1 // indirect
github.com/mattn/go-runewidth v0.0.24 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/text v0.3.8 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
golang.org/x/sync v0.22.0 // indirect
)
69 changes: 36 additions & 33 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/charmbracelet/bubbletea v1.2.4 h1:KN8aCViA0eps9SCOThb2/XPIlea3ANJLUkv3KnQRNCE=
github.com/charmbracelet/bubbletea v1.2.4/go.mod h1:Qr6fVQw+wX7JkWWkVyXYk/ZUQ92a6XNekLXa3rR18MM=
github.com/charmbracelet/lipgloss v1.0.0 h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O2qFMQNg=
github.com/charmbracelet/lipgloss v1.0.0/go.mod h1:U5fy9Z+C38obMs+T+tJqst9VGzlOYGj4ri9reL3qUlo=
github.com/charmbracelet/x/ansi v0.4.5 h1:LqK4vwBNaXw2AyGIICa5/29Sbdq58GbGdFngSexTdRM=
github.com/charmbracelet/x/ansi v0.4.5/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw=
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4=
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=
charm.land/bubbletea/v2 v2.0.8 h1:SxTJMhCAI3lbPmy4SgX5LWZ24AdINr4I6UEqzZvYJuY=
charm.land/bubbletea/v2 v2.0.8/go.mod h1:2SkdgoTXluXJHOUwAoRlRXF/28vklb1rFl6GcgV1/ss=
charm.land/lipgloss/v2 v2.0.6 h1:EaGKeuA8FvF+v2BT5VmZd2LoYLaMZJXA5n34th8nCIQ=
charm.land/lipgloss/v2 v2.0.6/go.mod h1:ipDDJNSGa1hlwDtSfW1s2/xR8Vdhbut4PXh2zEKZd0Q=
github.com/aymanbagabas/go-udiff v0.4.1 h1:OEIrQ8maEeDBXQDoGCbbTTXYJMYRCRO1fnodZ12Gv5o=
github.com/aymanbagabas/go-udiff v0.4.1/go.mod h1:0L9PGwj20lrtmEMeyw4WKJ/TMyDtvAoK9bf2u/mNo3w=
github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex9t5KX76i20Q=
github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q=
github.com/charmbracelet/ultraviolet v0.0.0-20260811164956-006e29f97886 h1:rdnVWKgJpTVXKuKuJyxDJ+NFJdUaUqGvyGy61OcvlbA=
github.com/charmbracelet/ultraviolet v0.0.0-20260811164956-006e29f97886/go.mod h1:nAw0d9PhFp1qdzi2xhQU5YOu5sVpDIHWlaW2Uz/bCro=
github.com/charmbracelet/x/ansi v0.11.8 h1:JMFwp0CgDC2+jcOB162HH5k7I3FVbgFSMMYg7dSPBQQ=
github.com/charmbracelet/x/ansi v0.11.8/go.mod h1:ZNN+3mXny/516oTQPLMPIBeSINvNJJQ8uQXDgbeJxY0=
github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f h1:pk6gmGpCE7F3FcjaOEKYriCvpmIN4+6OS/RD0vm4uIA=
github.com/charmbracelet/x/exp/golden v0.0.0-20250806222409-83e3a29d542f/go.mod h1:IfZAMTHB6XkZSeXUqriemErjAWCCzT0LwjKFYCZyw0I=
github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk=
github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI=
github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8JawjaNZY=
github.com/charmbracelet/x/termios v0.1.1/go.mod h1:rB7fnv1TgOPOyyKRJ9o+AsTU/vK5WHJ2ivHeut/Pcwo=
github.com/charmbracelet/x/windows v0.2.2 h1:IofanmuvaxnKHuV04sC0eBy/smG6kIKrWG2/jYn2GuM=
github.com/charmbracelet/x/windows v0.2.2/go.mod h1:/8XtdKZzedat74NQFn0NGlGL4soHB0YQZrETF96h75k=
github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8=
github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0=
github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk=
github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
github.com/lucasb-eyer/go-colorful v1.4.1 h1:1EO+WB73+EH8EVbzlrG3KLAfEypQWVHIBqlTf+2hNss=
github.com/lucasb-eyer/go-colorful v1.4.1/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-runewidth v0.0.24 h1:cpokDiIn0MGnhdHwuWnJBITySJ20QyNGnY2kR/ay2DU=
github.com/mattn/go-runewidth v0.0.24/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
go.starlark.net v0.0.0-20260708150628-5395d018f003 h1:cAxcqHgW8fnmT0cEBU3TzvVYHIFt8IIGDMWUF6rImk4=
go.starlark.net v0.0.0-20260708150628-5395d018f003/go.mod h1:Iue6g6iirlfLoVi/DYCi5/x0h/bAOuWF3dULTKpt2Vo=
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
2 changes: 1 addition & 1 deletion internal/ui/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"time"

"github.com/charmbracelet/lipgloss"
"charm.land/lipgloss/v2"
"github.com/charmbracelet/x/ansi"

"github.com/merefield/codexometer/internal/codex"
Expand Down
41 changes: 20 additions & 21 deletions internal/ui/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"testing"
"time"

tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
tea "charm.land/bubbletea/v2"
"charm.land/lipgloss/v2"
"github.com/charmbracelet/x/ansi"

"github.com/merefield/codexometer/internal/codex"
Expand Down Expand Up @@ -216,15 +216,14 @@ func TestBenchmarkButtonSupportsHoverAndClick(t *testing.T) {
model.width, model.height = 100, 30
model.meterView = viewBenchmark
x, y := benchmarkControlCoordinates(t, model, footerButtonBenchmarkSelected)
mouse := tea.MouseMsg{X: x, Y: y, Action: tea.MouseActionMotion}
mouse := tea.MouseMotionMsg{X: x, Y: y}
updated, command := model.Update(mouse)
model = updated.(Model)
if command != nil || model.hoveredButton != footerButtonBenchmarkSelected {
t.Fatal("benchmark button hover was not recorded")
}
mouse.Action = tea.MouseActionPress
mouse.Button = tea.MouseButtonLeft
updated, command = model.Update(mouse)
mouse.Button = tea.MouseLeft
updated, command = model.Update(tea.MouseClickMsg(mouse))
model = updated.(Model)
if command == nil || model.benchmarkState != benchmarkRunning {
t.Fatal("benchmark button click did not start suite")
Expand Down Expand Up @@ -254,17 +253,17 @@ func TestBenchmarkPageKeysAndMouseWheelScrollResults(t *testing.T) {
for index := 0; index < 30; index++ {
model.benchmarkResults = append(model.benchmarkResults, codex.BenchmarkResult{DisplayName: "Model", Effort: "low"})
}
updated, command := model.Update(tea.KeyMsg{Type: tea.KeyPgUp})
updated, command := model.Update(specialKey(tea.KeyPgUp))
model = updated.(Model)
if command != nil || model.benchmarkScroll == 0 {
t.Fatalf("Page Up did not scroll: offset=%d command=%v", model.benchmarkScroll, command != nil)
}
updated, _ = model.Update(tea.KeyMsg{Type: tea.KeyPgDown})
updated, _ = model.Update(specialKey(tea.KeyPgDown))
model = updated.(Model)
if model.benchmarkScroll != 0 {
t.Fatalf("Page Down offset = %d, want 0", model.benchmarkScroll)
}
updated, _ = model.Update(tea.MouseMsg{Button: tea.MouseButtonWheelUp})
updated, _ = model.Update(tea.MouseWheelMsg{Button: tea.MouseWheelUp})
model = updated.(Model)
if model.benchmarkScroll != 3 {
t.Fatalf("mouse-wheel offset = %d, want 3", model.benchmarkScroll)
Expand All @@ -282,18 +281,18 @@ func TestBenchmarkHeadingButtonsSortAndReverse(t *testing.T) {
dashboard := model.dashboardLayout()
geometry := layoutBenchmarkArea(dashboard.contentWidth, dashboard.meterHeight)
headerX, headerY := renderedTextCoordinates(t, model, "[MODEL]")
mouse := tea.MouseMsg{
X: headerX,
Y: headerY,
Action: tea.MouseActionMotion,
mouse := tea.MouseMotionMsg{
X: headerX,
Y: headerY,
}
updated, command := model.Update(mouse)
model = updated.(Model)
if command != nil || !model.benchmarkSortHovered || model.benchmarkHoveredSort != benchmarkSortModel {
t.Fatal("model heading did not highlight on hover")
}
mouse.Button, mouse.Action = tea.MouseButtonLeft, tea.MouseActionPress
updated, command = model.Update(mouse)
mouse.Button = tea.MouseLeft
click := tea.MouseClickMsg(mouse)
updated, command = model.Update(click)
model = updated.(Model)
if command != nil || model.benchmarkSort != benchmarkSortModel || model.benchmarkSortDescending {
t.Fatalf("first heading click did not select ascending model sort: %#v", model)
Expand All @@ -302,7 +301,7 @@ func TestBenchmarkHeadingButtonsSortAndReverse(t *testing.T) {
if ordered[0].DisplayName != "Alpha" {
t.Fatalf("ascending model order = %q first, want Alpha", ordered[0].DisplayName)
}
updated, _ = model.Update(mouse)
updated, _ = model.Update(click)
model = updated.(Model)
ordered = sortedBenchmarkResults(model.benchmarkResults, model.benchmarkSort, model.benchmarkSortDescending)
if !model.benchmarkSortDescending || ordered[0].DisplayName != "Zulu" {
Expand Down Expand Up @@ -566,7 +565,7 @@ func TestBenchmarkTaskSelectorRunAllGuardAndExactTurnCount(t *testing.T) {
model.meterView = viewBenchmark
model.benchmarkCombinations = 33

updated, _ := model.Update(tea.KeyMsg{Type: tea.KeyRight})
updated, _ := model.Update(specialKey(tea.KeyRight))
model = updated.(Model)
if model.benchmarkSelectedTask != 1 {
t.Fatalf("right arrow selected task %d, want 1", model.benchmarkSelectedTask)
Expand Down Expand Up @@ -688,7 +687,7 @@ func TestBenchmarkPassFailFilterButtonsAndHotkey(t *testing.T) {
},
}
x, y := benchmarkControlCoordinates(t, model, footerButtonBenchmarkFilterFail)
updated, command := model.Update(tea.MouseMsg{X: x, Y: y, Button: tea.MouseButtonLeft, Action: tea.MouseActionPress})
updated, command := model.Update(tea.MouseClickMsg{X: x, Y: y, Button: tea.MouseLeft})
model = updated.(Model)
if command == nil || model.benchmarkFilter != benchmarkFilterFail {
t.Fatal("FAIL filter button did not activate")
Expand All @@ -714,7 +713,7 @@ func TestBenchmarkRankWeightButtonsAndHotkeyRecomputeImmediately(t *testing.T) {
},
}
x, y := benchmarkControlCoordinates(t, model, footerButtonBenchmarkRankCost)
updated, command := model.Update(tea.MouseMsg{X: x, Y: y, Button: tea.MouseButtonLeft, Action: tea.MouseActionPress})
updated, command := model.Update(tea.MouseClickMsg{X: x, Y: y, Button: tea.MouseLeft})
model = updated.(Model)
if command == nil || model.benchmarkRankMode != benchmarkRankCost || model.flashedButton != footerButtonBenchmarkRankCost {
t.Fatalf("Cost rank button did not activate and flash: mode=%d flash=%d", model.benchmarkRankMode, model.flashedButton)
Expand All @@ -738,7 +737,7 @@ func TestBenchmarkRankWeightButtonsAndHotkeyRecomputeImmediately(t *testing.T) {
}

x, y = benchmarkControlCoordinates(t, model, footerButtonBenchmarkRankBalanced)
updated, _ = model.Update(tea.MouseMsg{X: x, Y: y, Button: tea.MouseButtonLeft, Action: tea.MouseActionPress})
updated, _ = model.Update(tea.MouseClickMsg{X: x, Y: y, Button: tea.MouseLeft})
model = updated.(Model)
if model.benchmarkRankMode != benchmarkRankBalanced {
t.Fatalf("Balanced rank button selected mode %d", model.benchmarkRankMode)
Expand Down Expand Up @@ -773,7 +772,7 @@ func renderedTextCoordinates(t *testing.T, model Model, text string) (int, int)

func renderedTextStart(t *testing.T, model Model, text string) (int, int) {
t.Helper()
for y, line := range strings.Split(ansi.Strip(model.View()), "\n") {
for y, line := range strings.Split(ansi.Strip(model.render()), "\n") {
if byteX := strings.Index(line, text); byteX >= 0 {
return lipgloss.Width(line[:byteX]), y
}
Expand Down
Loading
Loading