fix(ui): daily cost trend chart not rendering bars#426
Merged
Conversation
Two issues prevented the chart from displaying: 1. CSS: .day-col lacked explicit height, so percentage-based bar heights resolved to auto (0px). Fix: give .day-col height:100% and justify-content:flex-end, switch bars to pixel heights calculated server-side (max 90px) for reliability. 2. Data: live sessions with cost > 0 were correctly bucketed to today but the guard was missing, adding zero-cost entries. Add cost > 0 check and improve the comment explaining why live sessions are always bucketed to today (historical estimates skip them).
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.
Summary
Follow-up fix for #418 — the daily cost trend chart was rendering but bars had zero height, making them invisible.
Root Causes
CSS layout bug:
.day-colhad no explicit height, so percentage-basedheight: X%on.day-barresolved toauto(effectively 0px, leaving onlymin-height: 2px). The parent.daily-charthadheight: 120pxbut it didn't propagate through the flex column.Zero-cost live sessions: The live session loop added entries with
cost: 0to today's bucket, inflating session count without contributing cost.Fix
.day-colexplicitheight: 100%andjustify-content: flex-endso bars anchor to the bottombarMaxPx = 90, leaving room for the date label)cost > 0guard when bucketing live sessionsflex-shrink: 0on bar and label to prevent compression