Skip to content

feat(tui): improve header, op box layout, and fix RPM freeze bug - #31

Merged
maansaake merged 2 commits into
mainfrom
feat/tui-improvements
May 24, 2026
Merged

feat(tui): improve header, op box layout, and fix RPM freeze bug#31
maansaake merged 2 commits into
mainfrom
feat/tui-improvements

Conversation

@maansaake

Copy link
Copy Markdown
Owner

Summary

A polish pass on the interactive TUI reporter.

Header

  • Styled title block with wider padding (3 spaces each side)
  • State-coloured status box showing test status RUNNING/DONE/ERROR on one line (green/yellow/red border + text)
  • Dynamic progress bar width — at least 50% of remaining space after title and status boxes
  • Time remaining centered beneath the bar, styled in the same dim gray as disabled operations

Module sections

  • Each module is now wrapped in a rounded border box (blue border) with a Module: prefix on the header

Operation boxes

  • Three side-by-side columns: Rate | Calls | Timing
  • Rate header bold-blue; configured rate appended in plain white
  • Column values aligned (labels padded like gofumpt struct fields)
  • Timing labels include colons (avg:, min:, max:)
  • Operation name prefixed with Operation:
  • Blank line between operation name and columns

Bug fixes

  • RPM freeze: observedRPM now receives a frozen elapsed duration when trafficDoneMsg is received — the actual rate no longer declines after the test ends
  • Nil-pointer guard: renderOp now safely skips stats for ops that haven't received any calls yet

- Add styled title block with wider padding (3 spaces each side)
- Add state-coloured status box (RUNNING/DONE/ERROR) in header
- Dynamic progress bar width (≥50% of remaining space), centered time text
- Module sections wrapped in rounded border boxes with 'Module:' prefix
- Op boxes: three-column layout (Rate|Calls|Timing) with bold headers,
  aligned values, 'Operation:' prefix, blank line before columns
- Fix: freeze observedRPM when trafficDoneMsg received so actual rate
  stops declining after the test ends
- Fix: nil-pointer guard when an op has not yet received any calls

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread pkg/report/interactive/model.go Fixed
Rename inner ok to opOK to avoid shadowing the outer ok
from the modStats lookup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@maansaake
maansaake merged commit 3c94c34 into main May 24, 2026
14 checks passed
@maansaake
maansaake deleted the feat/tui-improvements branch May 24, 2026 13:26
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