FIX: prioritize fuel gauge in short cards - #36
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The behavior change is narrowly scoped, matches the stated intent, and is covered by targeted tests for the constrained-height cases.
Pull request overview
This PR adjusts the Fuel Tank meter’s height-constrained rendering so the primary “fuel row” is preserved at minimal heights, and secondary labels (range readout, then Empty/Full endpoints) are only shown when more vertical space is available—matching the Bars view’s prioritization behavior under vertical pressure.
Changes:
- Update
renderFuelTankSizedto prioritize the tank row at 1-row height, add the range readout at 2 rows, and add Empty/Full endpoints at 3+ rows. - Preserve default Fuel Tank sizing behavior when no explicit height is provided.
- Add focused tests covering 1-, 2-, and 3-row tanks and a minimum-height Fuel meter area to ensure secondary telemetry drops before the tank.
File summaries
| File | Description |
|---|---|
| internal/ui/meters.go | Changes Fuel Tank height prioritization so the tank row remains visible first, then restores secondary labels as height increases. |
| internal/ui/meters_test.go | Adds regression tests for short-height tank rendering and verifies minimum-height meter layout drops telemetry before the tank. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This addresses #35
When horizontal quota cards become very short, the Bars view preserves its primary gauge and drops secondary telemetry first. Fuel Tank did the opposite at its minimum visual height: it replaced the fuel row with the
RANGElabel, and a two-row allocation could show only tank borders.What changed
Impact
Fuel Tank now behaves like Bars under vertical pressure: the main quota signal remains visible while low-intensity labels and the reset timeline disappear first. Normal-height Fuel Tank cards retain their existing appearance and reverse-gauge direction.
Validation
go test ./internal/uigo test -race -cover ./...go vet ./...git diff --check