Repository navigation
Add visible cost scale labels to cost charts - #1898
Conversation
…teipete#1854) Show dollar-scale y-axis labels on the cost history chart so the range is visible at a glance without hovering. Replace the hand-rolled full-width HStack x-axis with Swift Charts' built-in chartXAxis so labels align with the plot area, not the container edge. Y-axis: - AxisMarks(position: .leading) with currency-formatted labels - Compact whole-dollar formatting (, 57, ,515) for values >= ; cents preserved for nonzero sub-dollar values (.50) to avoid duplicate ticks - Empty ticks for flat/no data - yAxisTickValues: [] for <=0, [0, max] for <, [0, mid, max] for >= X-axis: - Built-in chartXAxis with AxisMarks(values: model.axisDates) - Edge anchors: first label .topLeading, last label .topTrailing - Prevents right-side label clipping that the old HStack caused Tests: 4 new focused tests covering tick value selection and compact formatter behavior.
|
Codex review: needs real behavior proof before merge. Reviewed July 5, 2026, 12:56 AM ET / 04:56 UTC. Summary Reproducibility: yes. for the review finding from source inspection: the PR adds the inline max-cost label as a conditional row, while live dashboard layout compatibility still ignores point values and label visibility. For the requested enhancement, current main source confirms the scale labels are missing. Review metrics: 3 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Track or reserve the inline scale-label layout state, add redacted real-build proof for detailed, inline, and widget chart labels including the widget mixed-data fallback, then land if maintainers accept compact max labels on the smaller chart surfaces. Do we have a high-confidence way to reproduce the issue? Yes for the review finding from source inspection: the PR adds the inline max-cost label as a conditional row, while live dashboard layout compatibility still ignores point values and label visibility. For the requested enhancement, current main source confirms the scale labels are missing. Is this the best way to solve the issue? No, not yet: the implementation direction is narrow and well tested, but it should first make the inline label layout state stable or tracked and add widget proof. Maintainer UX acceptance of compact max labels on mini renderers remains the final product call. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 71a768b58e47. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (10 earlier review cycles; latest 8 shown)
|
Wake up crab! |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Expanding, ETA: ~1 hour |
Extend the cost-chart scale work from steipete#1898 to the two remaining custom bar renderers: - InlineUsageDashboardModel gains an optional currencyCode field; the four currency dashboard builders (costHistory, claudeAdminAPI, crossModel, openRouter) populate it, token/points dashboards stay nil. - MiniUsageBars overlays a compact max-cost label at topTrailing when currencyCode is set and max cost > 0, mirroring CostHistoryChartMenuView. - Widget UsageHistoryChart now picks one explicit mode per chart via UsageHistoryChartMode.isCostMode (true only when every point has costUSD), fixing a latent mixed-unit bug where bars could mix dollars and tokens. Adds a max-cost label in cost mode. - Three widget call sites pass currencyCode through. - Tests cover currencyCode propagation and the cost-mode predicate.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
# Conflicts: # Sources/CodexBarWidget/CodexBarWidgetViews.swift
|
Exact-head proof for
Native pixel capture was unavailable after the desktop session locked; deterministic production-view renders and fresh-bundle runtime proof cover the changed surfaces without claiming a locked-session screenshot. |
Add compact cost scale labels to detailed history charts, inline usage bars, and widgets. Keep labels truthful to the plotted domain, reserve layout space to avoid peak-bar overlap, and use consistent currency formatting across surfaces. Co-authored-by: FND <fndevve@proton.me>
Summary
Adds visible, honest cost scales to every cost-chart surface while keeping token-only and partially populated widget histories unit-safe.
Closes #1854.
Maintainer improvements
$0.50maximum now renders as a full-height$0.50bar instead of using a hidden$1domain.Proof
make check: SwiftFormat clean; SwiftLint 0 violations; repository checks clean.make test: all 47 shards passed on the exact head below../Scripts/compile_and_run.sh: release bundle packaged, relaunched, and remained running.Exact head:
bc5777e53ab9ecd840eb7a29172870604b238c3eScreenshots
Detailed cost chart before the maintainer scale/gutter refinements:
Inline and widget coverage supplied by the contributor:
Contributor
Thanks @FNDEVVE for the feature direction, implementation, and visual proof.