Skip to content

fix: show remaining/total instead of used/remaining in status bar#11

Closed
DimazzzZ wants to merge 0 commit into
mainfrom
fix/status-bar-format-order
Closed

fix: show remaining/total instead of used/remaining in status bar#11
DimazzzZ wants to merge 0 commit into
mainfrom
fix/status-bar-format-order

Conversation

@DimazzzZ

Copy link
Copy Markdown
Owner

What

Fixes the status bar format order for "Used / Remaining" option to show "remaining / total" instead of "used / remaining".

Why

Users expected to see "$57 / $1443" (remaining / total) but were seeing "$1443 / $57" (used / remaining). The format should show how much is remaining out of the total balance.

Changes

  • Modified formatUsedOfRemaining in BalanceFormatter.kt to prefer "remaining / total" format when total is available
  • Added fallback to "used / remaining" when total is not provided
  • Updated tests to match new format

Files Modified

  • src/main/kotlin/org/zhavoronkov/tokenpulse/ui/BalanceFormatter.kt
  • src/test/kotlin/org/zhavoronkov/tokenpulse/ui/BalanceFormatterTest.kt

Verification

  • All tests pass ✓
  • Detekt clean ✓

if (remaining != null && total != null) {
return when (format) {
StatusBarFormat.COMPACT -> "${formatShortDollars(remaining)} / ${formatShortDollars(total)}"
StatusBarFormat.DESCRIPTIVE -> "${formatShortDollars(remaining)} of ${formatShortDollars(total)} remaining"
if (remaining != null && total != null) {
return when (format) {
StatusBarFormat.COMPACT -> "${formatShortDollars(remaining)} / ${formatShortDollars(total)}"
StatusBarFormat.DESCRIPTIVE -> "${formatShortDollars(remaining)} of ${formatShortDollars(total)} remaining"
if (remaining != null && total != null) {
return when (format) {
StatusBarFormat.COMPACT -> "${formatShortDollars(remaining)} / ${formatShortDollars(total)}"
StatusBarFormat.DESCRIPTIVE -> "${formatShortDollars(remaining)} of ${formatShortDollars(total)} remaining"
if (remaining != null && total != null) {
return when (format) {
StatusBarFormat.COMPACT -> "${formatShortDollars(remaining)} / ${formatShortDollars(total)}"
StatusBarFormat.DESCRIPTIVE -> "${formatShortDollars(remaining)} of ${formatShortDollars(total)} remaining"
if (remaining != null && total != null) {
return when (format) {
StatusBarFormat.COMPACT -> "${formatShortDollars(remaining)} / ${formatShortDollars(total)}"
StatusBarFormat.DESCRIPTIVE -> "${formatShortDollars(remaining)} of ${formatShortDollars(total)} remaining"
if (remaining != null && total != null) {
return when (format) {
StatusBarFormat.COMPACT -> "${formatShortDollars(remaining)} / ${formatShortDollars(total)}"
StatusBarFormat.DESCRIPTIVE -> "${formatShortDollars(remaining)} of ${formatShortDollars(total)} remaining"
@DimazzzZ DimazzzZ closed this Jun 22, 2026
@DimazzzZ DimazzzZ force-pushed the fix/status-bar-format-order branch from b068064 to 21a2a03 Compare June 22, 2026 15:28
@DimazzzZ DimazzzZ deleted the fix/status-bar-format-order branch June 22, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants