Skip to content

fix(gain): stop printing a hardcoded minus on recent savings - #4879

Open
alexrain wants to merge 1 commit into
rtk-ai:developfrom
alexrain:fix/gain-recent-positive-pct
Open

alexrain wants to merge 1 commit into
rtk-ai:developfrom
alexrain:fix/gain-recent-positive-pct

Conversation

@alexrain

Copy link
Copy Markdown

Fixes #2815.

rtk gain -H printed every recent command as -94% because the format string hardcoded a minus. The stored percentage is already signed, so print it directly: positive savings show without a prefix and a genuinely negative row keeps its own minus.

Tests: formatting-only change; cargo check.

@CLAassistant

CLAassistant commented Oct 31, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@rtk-wshm-sync-bot rtk-wshm-sync-bot Bot added analytics bug Something isn't working cli labels Oct 31, 2026
@rtk-wshm-sync-bot

Copy link
Copy Markdown

wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟢 Risk low

Summary

Fixes a display bug in rtk gain -H where the Recent Commands list always showed a hardcoded minus sign before the percentage, making every row appear as a negative saving (e.g. -94%) regardless of actual sign. The format string now prints the already-signed stored percentage directly.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #2815


Analyzed automatically by wshm · This is an automated analysis, not a human review.

@KuSh KuSh added the needs-cla label Oct 31, 2026
@KuSh KuSh removed the needs-cla label Nov 8, 2026

@pszymkowiak pszymkowiak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Built and checked locally: rtk gain -H now prints the stored percentage as is (64% instead of -64%), which matches the database and the rest of rtk gain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(gain): Recent Commands displays hardcoded negative sign on savings percentage

4 participants