Skip to content

Show complementary amount instead of block number in transaction rows - #553

Merged
praveenperera merged 4 commits into
masterfrom
fiat-value-wallet-screen
Feb 4, 2026
Merged

praveenperera merged 4 commits into
masterfrom
fiat-value-wallet-screen

Conversation

@praveenperera

@praveenperera praveenperera commented Feb 3, 2026 •

Copy link
Copy Markdown
Member

Display fiat amount when in BTC mode, and BTC/sats amount when in fiat mode as the secondary line in transaction rows on both platforms

Summary by CodeRabbit

  • New Features

    • Transaction cards show a secondary amount (BTC or fiat) beneath the primary amount for confirmed, unconfirmed, and unsigned transactions; confirmed items use this secondary currency in place of block height. Privacy masking preserved.
    • Amounts now display direction-aware formatting (sent/received) for both BTC and fiat secondary values.
  • Bug Fixes

    • Deleting an unsigned transaction surfaces a user-facing alert when it fails.

@coderabbitai

coderabbitai Bot commented Feb 3, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds a computed secondaryAmount (alternate-currency display) across Android and iOS transaction views, updates widget signatures/call sites to pass/render it, adds direction-aware display helpers in Rust and Kotlin FFI bindings, and surfaces an alert on unsigned-transaction deletion failure. Build config updated.

Changes

Cohort / File(s) Summary
Android Transactions View
android/app/src/main/java/org/bitcoinppl/cove/flows/SelectedWalletFlow/TransactionsCardView.kt
Compute secondaryAmount per TransactionItem; pass to widgets. ConfirmedTransactionWidget signature: blockHeight → secondaryAmount. UnconfirmedTransactionWidget now accepts secondaryAmount. UnsignedTransactionWidget computes local secondaryAmount. Call sites updated and delete-error alerts surfaced.
Android Rust FFI / WalletManager (Kotlin)
android/app/src/main/java/org/bitcoinppl/cove_core/cove.kt
Added FFI bindings and Kotlin overrides: displayAmountWithDirection, displayFiatAmountWithDirection, and displaySentAndReceivedAmount to call new Rust FFI methods and return direction-prefixed formatted strings.
iOS Transactions View
ios/Cove/Flows/SelectedWalletFlow/TransactionsCardView.swift
Added AppManager binding for alerts; compute and render secondaryAmount in Confirmed/Unconfirmed/Unsigned views beneath primary amount with privacy masking preserved; delete-error alert shown on failure.
Rust Wallet Manager
rust/src/manager/wallet_manager.rs
Added display_amount_with_direction, display_fiat_amount_with_direction, and clarified display_amount behavior; import TransactionDirection.
Build Config
build.gradle
Project/Gradle adjustments accompanying Android changes.

Sequence Diagram(s)

sequenceDiagram
    participant UI as Mobile UI (Android/iOS)
    participant Kotlin as RustWalletManager (Kotlin)
    participant FFI as Uniffi FFI Bridge
    participant Rust as Rust WalletManager

    UI->>Kotlin: request displayAmountWithDirection / displayFiatAmountWithDirection
    Kotlin->>FFI: call corresponding uniffi_*_with_direction(...)
    FFI->>Rust: invoke Rust formatting helper (amount with direction)
    Rust-->>FFI: formatted string (with +/- or direction)
    FFI-->>Kotlin: RustBuffer result
    Kotlin-->>UI: lifted String (secondaryAmount) for rendering
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Hopping through the ledger in a flash,
I split one sum into a two-line splash.
BTC above, fiat below in view,
A little hop to show both sides true. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: replacing block number display with complementary amount in transaction rows across both platforms.
Docstring Coverage ✅ Passed Docstring coverage is 84.21% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fiat-value-wallet-screen

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 87ef2088b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +149 to +153
private var secondaryAmount: String {
if case .btc = metadata.fiatOrBtc {
// primary is BTC, secondary is fiat
guard let fiatAmount = txn.fiatAmount() else { return privateShow("---") }
return privateShow(manager.rust.displayFiatAmount(amount: fiatAmount.amount))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Prefix outgoing fiat secondary amounts with a minus sign

When metadata.fiatOrBtc == .btc, the secondary amount is built with displayFiatAmount, which formats the absolute fiat value without any sign (see display_fiat_amount in rust/src/manager/wallet_manager.rs). That means outgoing transactions will show a positive fiat secondary line even though the primary BTC line is negative, which is misleading for spends. Consider adding a - prefix when txn.sentAndReceived().direction() == .outgoing (this same pattern is repeated in the unconfirmed/unsigned views).

Useful? React with 👍 / 👎.

@greptile-apps

greptile-apps Bot commented Feb 3, 2026 •

Copy link
Copy Markdown

Greptile Overview

Greptile Summary

This PR enhances transaction list UX by replacing block height with complementary amount (fiat when in BTC mode, BTC when in fiat mode) and improves error handling for unsigned transaction deletion.

Key Changes:

  • Added displayAmountWithDirection() and displayFiatAmountWithDirection() in Rust for consistent direction prefix handling ("-" for outgoing, none for incoming)
  • Updated all three transaction types (confirmed, unconfirmed, unsigned) on both platforms to show secondary amounts
  • Unified amount formatting logic - all transaction types now use the Rust methods consistently
  • Added user-facing error alerts when deleting unsigned transactions fails on both Android and iOS

Implementation Quality:

  • Cross-platform consistency achieved - both Android and iOS use identical Rust methods
  • Clean separation of concerns - formatting logic centralized in Rust layer
  • Proper error handling with user feedback
  • Well-documented new methods with clear usage guidance

Confidence Score: 5/5

  • This PR is safe to merge with no identified issues
  • Clean implementation with excellent cross-platform consistency, proper error handling, well-documented code, and no logic errors detected
  • No files require special attention

Important Files Changed

Filename Overview
rust/src/manager/wallet_manager.rs Added two new display methods with direction prefixes for BTC and fiat amounts - clean implementation with proper documentation
android/app/src/main/java/org/bitcoinppl/cove/flows/SelectedWalletFlow/TransactionsCardView.kt Replaced block height with secondary amount in transaction rows, unified amount formatting across transaction types, added error alert for delete failures
ios/Cove/Flows/SelectedWalletFlow/TransactionsCardView.swift Replaced block height with secondary amount in transaction rows, unified amount formatting across transaction types, added error alert for delete failures

Sequence Diagram

sequenceDiagram
    participant UI as Transaction UI<br/>(Android/iOS)
    participant WM as WalletManager
    participant Rust as RustWalletManager
    
    Note over UI,Rust: Displaying Transaction Row
    
    UI->>UI: Determine fiatOrBtc mode
    
    alt Primary Amount (BTC mode)
        UI->>Rust: displaySentAndReceivedAmount(sentAndReceived)
        Rust->>Rust: Check sensitive_visible
        Rust->>Rust: Apply direction prefix (- for outgoing)
        Rust-->>UI: "-0.00050000 BTC"
    else Primary Amount (Fiat mode)
        UI->>Rust: displayFiatAmountWithDirection(amount, direction)
        Rust->>Rust: Check sensitive_visible
        Rust->>Rust: Apply direction prefix (- for outgoing)
        Rust-->>UI: "-$50.00"
    end
    
    alt Secondary Amount (BTC mode → show fiat)
        UI->>Rust: displayFiatAmountWithDirection(fiatAmount, direction)
        Rust-->>UI: "-$50.00"
    else Secondary Amount (Fiat mode → show BTC)
        UI->>Rust: displaySentAndReceivedAmount(sentAndReceived)
        Rust-->>UI: "-0.00050000 BTC"
    end
    
    UI->>UI: Render primary + secondary amounts
    
    Note over UI,Rust: Delete Unsigned Transaction
    
    UI->>UI: User long-press/context menu
    UI->>Rust: deleteUnsignedTransaction(txId)
    
    alt Success
        Rust-->>UI: Transaction deleted
        UI->>UI: Refresh list
    else Error
        Rust-->>UI: Exception
        UI->>WM: Set alertState
        UI->>UI: Show error alert to user
    end
Loading

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +693 to +710
val secondaryAmount =
manager?.let {
when (fiatOrBtc) {
FiatOrBtc.BTC -> {
// primary is BTC, secondary is fiat
val amount = fiatAmount
if (amount != null) {
it.rust.displayFiatAmount(amount)
} else {
"---"
}
}
FiatOrBtc.FIAT -> {
// primary is fiat, secondary is BTC
it.displayAmount(txn.spendingAmount(), showUnit = true)
}
}
} ?: "---"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unsigned transactions don't add prefix (+ or -) to secondaryAmount, while confirmed and unconfirmed transactions do (lines 318, 392). This creates inconsistent display behavior.

Suggested change
val secondaryAmount =
manager?.let {
when (fiatOrBtc) {
FiatOrBtc.BTC -> {
// primary is BTC, secondary is fiat
val amount = fiatAmount
if (amount != null) {
it.rust.displayFiatAmount(amount)
} else {
"---"
}
}
FiatOrBtc.FIAT -> {
// primary is fiat, secondary is BTC
it.displayAmount(txn.spendingAmount(), showUnit = true)
}
}
} ?: "---"
val secondaryAmount =
manager?.let {
val prefix = "-"
when (fiatOrBtc) {
FiatOrBtc.BTC -> {
// primary is BTC, secondary is fiat
val amount = fiatAmount
if (amount != null) {
prefix + it.rust.displayFiatAmount(amount)
} else {
"---"
}
}
FiatOrBtc.FIAT -> {
// primary is fiat, secondary is BTC
prefix + it.displayAmount(txn.spendingAmount(), showUnit = true)
}
}
} ?: "---"
Prompt To Fix With AI
This is a comment left during a code review.
Path: android/app/src/main/java/org/bitcoinppl/cove/flows/SelectedWalletFlow/TransactionsCardView.kt
Line: 693:710

Comment:
Unsigned transactions don't add prefix (+ or -) to `secondaryAmount`, while confirmed and unconfirmed transactions do (lines 318, 392). This creates inconsistent display behavior.

```suggestion
    val secondaryAmount =
        manager?.let {
            val prefix = "-"
            when (fiatOrBtc) {
                FiatOrBtc.BTC -> {
                    // primary is BTC, secondary is fiat
                    val amount = fiatAmount
                    if (amount != null) {
                        prefix + it.rust.displayFiatAmount(amount)
                    } else {
                        "---"
                    }
                }
                FiatOrBtc.FIAT -> {
                    // primary is fiat, secondary is BTC
                    prefix + it.displayAmount(txn.spendingAmount(), showUnit = true)
                }
            }
        } ?: "---"
```

How can I resolve this? If you propose a fix, please make it concise.

@praveenperera
praveenperera force-pushed the fiat-value-wallet-screen branch from 87ef208 to 7364836 Compare February 3, 2026 21:02
@praveenperera

Copy link
Copy Markdown
Member Author

@greptile-apps re-review

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +318 to +331
val prefix = if (direction == TransactionDirection.OUTGOING) "-" else ""
when (fiatOrBtc) {
FiatOrBtc.BTC -> {
// primary is BTC, secondary is fiat
val fiatAmount = txn.v1.fiatAmount()
if (fiatAmount != null) {
prefix + it.rust.displayFiatAmount(fiatAmount.amount)
} else {
"---"
}
}
FiatOrBtc.FIAT -> {
// primary is fiat, secondary is BTC
prefix + it.displayAmount(amount, showUnit = true)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Manual prefix addition causes double-prefix when displaying amounts. The displayAmount() method is meant for raw amounts without direction indicators, but here you're adding a prefix. In iOS (lines 157-159), displaySentAndReceivedAmount() is used which already includes the prefix via Rust's SentAndReceived::amount_fmt(). This inconsistency means Android adds prefix manually while iOS relies on the Rust method.

Suggested change
val prefix = if (direction == TransactionDirection.OUTGOING) "-" else ""
when (fiatOrBtc) {
FiatOrBtc.BTC -> {
// primary is BTC, secondary is fiat
val fiatAmount = txn.v1.fiatAmount()
if (fiatAmount != null) {
prefix + it.rust.displayFiatAmount(fiatAmount.amount)
} else {
"---"
}
}
FiatOrBtc.FIAT -> {
// primary is fiat, secondary is BTC
prefix + it.displayAmount(amount, showUnit = true)
when (fiatOrBtc) {
FiatOrBtc.BTC -> {
// primary is BTC, secondary is fiat
val fiatAmount = txn.v1.fiatAmount()
if (fiatAmount != null) {
prefix + it.rust.displayFiatAmount(fiatAmount.amount)
} else {
"---"
}
}
FiatOrBtc.FIAT -> {
// primary is fiat, secondary is BTC
it.rust.displaySentAndReceivedAmount(txn.v1.sentAndReceived())
}
}
Prompt To Fix With AI
This is a comment left during a code review.
Path: android/app/src/main/java/org/bitcoinppl/cove/flows/SelectedWalletFlow/TransactionsCardView.kt
Line: 318:331

Comment:
Manual prefix addition causes double-prefix when displaying amounts. The `displayAmount()` method is meant for raw amounts without direction indicators, but here you're adding a prefix. In iOS (lines 157-159), `displaySentAndReceivedAmount()` is used which already includes the prefix via Rust's `SentAndReceived::amount_fmt()`. This inconsistency means Android adds prefix manually while iOS relies on the Rust method.

```suggestion
                    when (fiatOrBtc) {
                        FiatOrBtc.BTC -> {
                            // primary is BTC, secondary is fiat
                            val fiatAmount = txn.v1.fiatAmount()
                            if (fiatAmount != null) {
                                prefix + it.rust.displayFiatAmount(fiatAmount.amount)
                            } else {
                                "---"
                            }
                        }
                        FiatOrBtc.FIAT -> {
                            // primary is fiat, secondary is BTC
                            it.rust.displaySentAndReceivedAmount(txn.v1.sentAndReceived())
                        }
                    }
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +392 to +405
val prefix = if (direction == TransactionDirection.OUTGOING) "-" else ""
when (fiatOrBtc) {
FiatOrBtc.BTC -> {
// primary is BTC, secondary is fiat
val fiatAmount = txn.v1.fiatAmount()
if (fiatAmount != null) {
prefix + it.rust.displayFiatAmount(fiatAmount.amount)
} else {
"---"
}
}
FiatOrBtc.FIAT -> {
// primary is fiat, secondary is BTC
prefix + it.displayAmount(amount, showUnit = true)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same issue as confirmed transactions - use displaySentAndReceivedAmount() for consistency with iOS.

Suggested change
val prefix = if (direction == TransactionDirection.OUTGOING) "-" else ""
when (fiatOrBtc) {
FiatOrBtc.BTC -> {
// primary is BTC, secondary is fiat
val fiatAmount = txn.v1.fiatAmount()
if (fiatAmount != null) {
prefix + it.rust.displayFiatAmount(fiatAmount.amount)
} else {
"---"
}
}
FiatOrBtc.FIAT -> {
// primary is fiat, secondary is BTC
prefix + it.displayAmount(amount, showUnit = true)
when (fiatOrBtc) {
FiatOrBtc.BTC -> {
// primary is BTC, secondary is fiat
val fiatAmount = txn.v1.fiatAmount()
if (fiatAmount != null) {
prefix + it.rust.displayFiatAmount(fiatAmount.amount)
} else {
"---"
}
}
FiatOrBtc.FIAT -> {
// primary is fiat, secondary is BTC
it.rust.displaySentAndReceivedAmount(txn.v1.sentAndReceived())
}
}

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: android/app/src/main/java/org/bitcoinppl/cove/flows/SelectedWalletFlow/TransactionsCardView.kt
Line: 392:405

Comment:
Same issue as confirmed transactions - use `displaySentAndReceivedAmount()` for consistency with iOS.

```suggestion
                    when (fiatOrBtc) {
                        FiatOrBtc.BTC -> {
                            // primary is BTC, secondary is fiat
                            val fiatAmount = txn.v1.fiatAmount()
                            if (fiatAmount != null) {
                                prefix + it.rust.displayFiatAmount(fiatAmount.amount)
                            } else {
                                "---"
                            }
                        }
                        FiatOrBtc.FIAT -> {
                            // primary is fiat, secondary is BTC
                            it.rust.displaySentAndReceivedAmount(txn.v1.sentAndReceived())
                        }
                    }
```

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

Display fiat amount when in BTC mode, and BTC/sats amount when in
fiat mode as the secondary line in transaction rows on both platforms
@praveenperera
praveenperera force-pushed the fiat-value-wallet-screen branch from 7364836 to d14183a Compare February 4, 2026 02:36
@praveenperera

Copy link
Copy Markdown
Member Author

@greptile-apps re-review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@ios/Cove/Flows/SelectedWalletFlow/TransactionsCardView.swift`:
- Around line 355-364: The secondaryAmount getter currently formats amounts
without a minus for unsigned (always outgoing) transactions; update it to prefix
"-" for unsigned transactions so it matches Android. In the secondaryAmount
logic (property name secondaryAmount) check the unsigned flag on the transaction
metadata (e.g., metadata.isUnsigned or equivalent field on metadata/txn) and,
when true, prepend "-" to the string returned by
privateShow(manager.rust.displayFiatAmount(amount: fiatAmount)) for the fiat
branch and to privateShow(manager.amountFmtUnit(txn.spendingAmount())) for the
fiat-primary branch; ensure you only add the prefix when unsigned and preserve
existing privateShow wrapping and formatting calls.
🧹 Nitpick comments (1)
android/app/src/main/java/org/bitcoinppl/cove/flows/SelectedWalletFlow/TransactionsCardView.kt (1)

298-331: Consider extracting duplicated amount formatting logic.

The formattedAmount and secondaryAmount computation for confirmed transactions (lines 298-331) is nearly identical to unconfirmed transactions (lines 369-402). This could be extracted to a helper function to reduce duplication.

Suggested helper function
private data class FormattedAmounts(val primary: String, val secondary: String)

`@Composable`
private fun formatTransactionAmounts(
    direction: TransactionDirection,
    fiatOrBtc: FiatOrBtc,
    fiatAmount: FiatAmount?,
    sentAndReceived: SentAndReceived,
    manager: WalletManager?,
): FormattedAmounts {
    val fiatPrefix = if (direction == TransactionDirection.OUTGOING) "-" else ""
    
    val primary = manager?.let {
        when (fiatOrBtc) {
            FiatOrBtc.BTC -> it.rust.displaySentAndReceivedAmount(sentAndReceived)
            FiatOrBtc.FIAT -> fiatAmount?.let { fa ->
                fiatPrefix + it.rust.displayFiatAmount(fa.amount)
            } ?: "---"
        }
    } ?: sentAndReceived.label()
    
    val secondary = manager?.let {
        when (fiatOrBtc) {
            FiatOrBtc.BTC -> fiatAmount?.let { fa ->
                fiatPrefix + it.rust.displayFiatAmount(fa.amount)
            } ?: "---"
            FiatOrBtc.FIAT -> it.rust.displaySentAndReceivedAmount(sentAndReceived)
        }
    } ?: "---"
    
    return FormattedAmounts(primary, secondary)
}

Also applies to: 369-402

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

3 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

if case .btc = metadata.fiatOrBtc {
// primary is BTC, secondary is fiat
guard let fiatAmount else { return privateShow("---") }
return privateShow(manager.rust.displayFiatAmount(amount: fiatAmount))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

secondary fiat amounts don't include "-" prefix, creating inconsistency with Android (line 694)

Suggested change
return privateShow(manager.rust.displayFiatAmount(amount: fiatAmount))
return privateShow("-" + manager.rust.displayFiatAmount(amount: fiatAmount))
Prompt To Fix With AI
This is a comment left during a code review.
Path: ios/Cove/Flows/SelectedWalletFlow/TransactionsCardView.swift
Line: 359:359

Comment:
secondary fiat amounts don't include "-" prefix, creating inconsistency with Android (line 694)

```suggestion
            return privateShow("-" + manager.rust.displayFiatAmount(amount: fiatAmount))
```

How can I resolve this? If you propose a fix, please make it concise.

@greptile-apps

greptile-apps Bot commented Feb 4, 2026

Copy link
Copy Markdown
Additional Comments (1)

ios/Cove/Flows/SelectedWalletFlow/TransactionsCardView.swift
unsigned transactions don't include "-" prefix for outgoing amounts, unlike Android (line 675) which explicitly adds it

            return privateShow("-" + manager.amountFmtUnit(txn.spendingAmount()))
Prompt To Fix With AI
This is a comment left during a code review.
Path: ios/Cove/Flows/SelectedWalletFlow/TransactionsCardView.swift
Line: 347:347

Comment:
unsigned transactions don't include "-" prefix for outgoing amounts, unlike Android (line 675) which explicitly adds it

```suggestion
            return privateShow("-" + manager.amountFmtUnit(txn.spendingAmount()))
```

How can I resolve this? If you propose a fix, please make it concise.

Move fiat prefix logic ("-" for outgoing) from iOS/Android into Rust,
mirroring how displaySentAndReceivedAmount handles BTC amounts.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@rust/src/manager/wallet_manager.rs`:
- Around line 723-739: The function display_fiat_amount_with_direction currently
prepends a "-" for outgoing transactions even when display_fiat_amount returns
the masked sensitive string (e.g., "**************"), producing
"-**************"; change it to check the output of display_fiat_amount (or the
sensitive_visible state) and only prepend the direction prefix when the
formatted result is not the masked/sensitive placeholder so masked outputs
remain unprefixed like display_sent_and_received_amount; reference
display_fiat_amount_with_direction and display_fiat_amount and implement the
conditional check to skip adding the prefix when the returned string starts with
"*" or equals the known mask.

Comment thread rust/src/manager/wallet_manager.rs Resolved
@praveenperera

Copy link
Copy Markdown
Member Author

@greptile-apps re-review

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

3 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Unsigned transactions were manually adding "-" prefix for BTC amounts while
fiat used the Rust method. This adds a matching Rust method for BTC amounts
to keep formatting consistent across both platforms.
Replace silent try? with proper error handling that logs the error
and shows an alert to the user on both iOS and Android.
@praveenperera
praveenperera force-pushed the fiat-value-wallet-screen branch from fbc702e to 00988d5 Compare February 4, 2026 15:32

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@android/app/src/main/java/org/bitcoinppl/cove/flows/SelectedWalletFlow/TransactionsCardView.kt`:
- Around line 811-819: Replace the hardcoded delete-failure strings in
TransactionsCardView (where app?.let { it.alertState =
TaggedItem(AppAlertState.General(...)) }) with localized string resources: add
delete_failed_title, delete_failed_message, and unknown_error to
res/values/strings.xml and use context.getString(R.string.delete_failed_title)
and context.getString(R.string.delete_failed_message, errorText) (formatting the
message) and fallback to context.getString(R.string.unknown_error) for the
unknown case; update the TaggedItem/AppAlertState.General instantiation to
reference these string resources instead of the literal text.
🧹 Nitpick comments (1)
android/app/src/main/java/org/bitcoinppl/cove_core/cove.kt (1)

18157-18182: Clarify KDoc to reference Kotlin method names and new direction helpers.
The doc currently points to the snake_case Rust name, which can mislead Kotlin callers. Consider updating both the interface and override KDocs to reference the Kotlin APIs.

✏️ Suggested KDoc update (apply to both interface + override)
-     * Does NOT include direction prefix - use `display_sent_and_received_amount`
-     * for transaction amounts that need +/- indicators.
+     * Does NOT include direction prefix; for transaction amounts that need +/- indicators,
+     * use `displayAmountWithDirection`, `displayFiatAmountWithDirection`,
+     * or `displaySentAndReceivedAmount`.

Also applies to: 18621-18627

@praveenperera

Copy link
Copy Markdown
Member Author

@greptile-apps re-review

@praveenperera
praveenperera merged commit 2204ecd into master Feb 4, 2026
10 checks passed
@praveenperera
praveenperera deleted the fiat-value-wallet-screen branch February 4, 2026 15:47
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.

1 participant