Skip to content

Refine responsive interface and click surfaces - #6

Merged
merefield merged 9 commits into
mainfrom
agent/fix-responsive-click-surfaces
Aug 11, 2026
Merged

merefield merged 9 commits into
mainfrom
agent/fix-responsive-click-surfaces

Conversation

@merefield

@merefield merefield commented Aug 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

This PR makes Codexometer's interactive layouts reliably responsive and hardens the Benchmark runner so its results fail closed instead of presenting uncertain telemetry as trustworthy data.

Interface and interaction

  • integrates block titles into their top borders so they no longer resemble buttons
  • makes Benchmark panels and controls responsive across narrow, short, and wide terminals
  • collapses the Benchmark view safely when fewer than three table rows are available
  • keeps Monitor readouts, button labels, meter cards, pie legends, and footer controls inside their assigned bounds
  • aligns rendered controls with their mouse hit regions, including Benchmark selectors, filters, sortable headings, Monitor controls, tabs, and footer buttons
  • prevents clipped, hidden, and disabled controls from remaining clickable
  • adds rendered-position and exhaustive compact-height click tests, including terminal heights 1–12

Benchmark correctness and resilience

  • records exact per-response token usage when Codex app-server raw-response telemetry is available
  • uses validated cumulative thread usage only as a compatibility fallback
  • validates negative values, component sums, overflow, cumulative regressions, duplicate responses, and disagreement between telemetry sources
  • distinguishes missing or invalid telemetry from a genuine observed zero and reports unavailable usage or API-equivalent cost as N/A with a reason
  • tracks usage and cost availability separately
  • detects prohibited tool calls, forces the trial to FAIL, and suppresses an untrustworthy cost estimate
  • gives each trial a five-minute deadline; a timed-out trial is interrupted, drained to its matching completion event, marked FAIL, and the remaining model/reasoning combinations continue
  • still stops the suite when cancellation, transport failure, or failed timeout cleanup means app-server state is no longer known to be safe
  • expands the README with the accounting disclaimer, current hardening guarantees, remaining limitations, and future improvement guidance
  • adds intro-post.md with concise, ready-to-publish OpenAI Developers Forum copy

Version

  • bumps the maintained source version to v0.2.1

Why

The original title-layout change exposed stale click coordinates and compact layouts could render beyond their allocated space, leaving visible controls inactive or invisible controls active.

The Benchmark runner also needed stricter accounting semantics: absent telemetry could be mistaken for zero usage, cumulative counters needed validation, forbidden tool use could contaminate comparisons, and one context deadline could terminate every remaining trial. This PR makes those states explicit and recoverable where the Codex app-server protocol can prove cleanup completed.

Review notes

  • API-equivalent cost remains an estimate based on observed token telemetry and configured API pricing; it is not a ChatGPT billing statement.
  • Exact per-response accounting depends on experimental raw-response events. The cumulative fallback is accepted only when its invariants hold.
  • Timeout recovery proceeds only after turn/interrupt succeeds and the matching turn/completed event is observed.

Validation

  • go test -race -cover ./...
  • go vet ./...
  • go build -o codexometer .
  • local binary reports codexometer v0.2.1
  • GitHub Actions passes on Ubuntu, macOS, and Windows

@merefield
merefield requested a lite review from Copilot August 11, 2026 20:35
@merefield
merefield marked this pull request as ready for review August 11, 2026 20:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines Codexometer’s TUI responsiveness and input hit-testing so rendered geometry and click surfaces stay aligned across narrow → wide terminals, while also hardening Benchmark token/cost accounting (including tool-use protocol enforcement) and bumping the maintained version to v0.2.1.

Changes:

  • Reworked framed panel titles to render inside the top border (no longer resembling button brackets) and adjusted layouts to prevent overflow in compact terminals.
  • Updated Benchmark/Monitor hit-testing and added rendered-position click tests across multiple terminal sizes.
  • Added fail-closed Benchmark telemetry accounting (raw-response vs cumulative fallback), tool-use detection, and expanded documentation of measurement limitations.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
README.md Expands documentation on token/API-equivalent interpretation and bumps referenced version to v0.2.1.
main_test.go Updates version output expectation to v0.2.1.
internal/version/version.go Updates maintained fallback version to 0.2.1.
internal/version/version_test.go Updates fallback version test to 0.2.1.
internal/ui/view.go Integrates frame titles into borders via a new title renderer.
internal/ui/view_test.go Extends reflow tests and asserts new border-integrated title rendering.
internal/ui/tabs_test.go Adds click-surface coverage across widths for rendered tabs.
internal/ui/monitor.go Prevents overflow in compact layouts and makes disabled buttons non-interactive.
internal/ui/monitor_test.go Expands hit-surface tests across sizes/states for Monitor buttons.
internal/ui/model.go Adjusts dashboard geometry to match new frame title height.
internal/ui/model_test.go Strengthens footer hit-testing assertions across rendered label cells.
internal/ui/meters.go Prevents meter/pie legend overflow and adapts rendering for small heights/widths.
internal/ui/benchmark.go Reworks Benchmark layout, segments rendering, hit-testing, and measurement-status messaging.
internal/ui/benchmark_test.go Adds rendered-position click tests and coverage for N/A measurement reporting and sorting.
internal/codex/benchmark.go Adds validated telemetry ledgering (raw vs cumulative), tool-use detection, and cost issues.
internal/codex/benchmark_test.go Adds comprehensive tests for fail-closed telemetry, overflow, fallback behavior, and tool-use rejection.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/ui/benchmark.go Resolved
@merefield
merefield merged commit f91f6ac into main Aug 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants