fix(sight): drop hardcoded minus on savings - #2754
Merged
Merged
Conversation
The ATIF viewer savings card prefixes a hardcoded minus to total_compounded_saved, which is already positive (original minus actual), so the UI showed negative savings and clashed with TokenSavingsPage. Drop the prefix; styling untouched. Residue next to the #2732 rate rescale on the same line. Closes #2749 Assisted-by: Qoder Signed-off-by: Jiangtian Feng <jiangtianf97@163.com>
chengshuyi
approved these changes
Aug 22, 2026
chengshuyi
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. Verified: total_compounded_saved is positive by construction (Σ(before−after)×turns), TokenSavingsPage displays it without prefix, and the render guard > 0 already ensures the card only appears for positive savings. One-char display fix, no risk.
9 tasks
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
The ATIF viewer "Token Savings Comparison" card renders
total_compounded_savedwith a hardcoded-prefix in JSX. The value is already positive (total_original_tokens - total_actual_tokens), so the UI read as negative savings — the same data shows11on the Token Savings page and-11here. Reported in #2749.What changed
src/agentsight/dashboard/src/pages/AtifViewerPage.tsx: dropped the hardcoded-beforefmtTokens(savingsDetail.total_compounded_saved). Styling (green, size, rate suffix) untouched; the leftover sat next to the fix(sight): return savings rates as fractions #2732 rate rescale on the same line.Related issue
closes #2749
User / Agent impact
The "Saved" value on the ATIF viewer savings card now displays as a positive number, matching the Token Savings page and the API contract.
Risk and compatibility
Low risk: one-line display-only change; no API, data, or i18n changes.
Validation
Mirrors #2732's dashboard validation (no component-render test harness exists in
dashboard/; display changes there are covered by typecheck + regression scripts, per that precedent):npm run typecheck— passnpm run test:api-client— 24/24 passnpm run test:i18n— 5/5 passnpm run build— webpack compiled successfullyEnvironment: node v22.22.0 / npm 10.9.4 on the ECS test machine; source synced via rsync (md5-verified).
Documentation and rollback
No docs describe this display detail. Rollback: revert the single commit.