Skip to content

Improve Fee UX: Bidirectional Fee/Rate Input & Better Rebalance Button#447

Open
Legend101Zz wants to merge 4 commits intocaravan-bitcoin:mainfrom
Legend101Zz:feat/fees-based-change-in-tx
Open

Improve Fee UX: Bidirectional Fee/Rate Input & Better Rebalance Button#447
Legend101Zz wants to merge 4 commits intocaravan-bitcoin:mainfrom
Legend101Zz:feat/fees-based-change-in-tx

Conversation

@Legend101Zz
Copy link
Contributor

Problem

Users reported two major UX issues when building transactions:

  1. No way to specify exact fee amounts: Users could only set a fee rate and had to use trial-and-error, repeatedly adjusting the rate (4 → 5 → 4.5 → 4.6 sats/vB) until they achieved the desired total fee. This was frustrating when trying to pay exactly X satoshis in fees.

  2. Unintuitive rebalance button: The output amount rebalance feature used a small gray +/- icon button that users found difficult to discover and unclear in its purpose.

  3. Auto-spend mode limitations: In wallet auto-spend mode, the fee amount field was completely hidden, preventing any fee customization beyond the rate.

Changes Made

Screenshot 2026-01-13 at 20 39 03

Testing

Manual Testing Checklist:

  • Fee Rate → Fee Amount sync

    • Enter fee rate with inputs selected → fee amount updates
    • Enter fee rate without inputs → fee amount stays "0.0000"
    • Change fee rate → fee amount recalculates
  • Fee Amount → Fee Rate sync

    • Enter fee amount with inputs selected → rate updates
    • Enter fee amount without inputs → rate stays same
    • Helper text shows "Effective rate: X sats/vB"
  • Rebalance button

    • Button is visible and prominent (blue, labeled "Rebalance")
    • Shows correct action ("Increase to..." or "Decrease to...")
    • Clicking button adjusts output amount correctly
    • Only appears when balance error exists and is fixable
  • Auto-spend mode

    • Fee amount field is visible
    • Can enter exact fee amount
    • Auto coin selection uses exact fee when specified
    • Error shown if specified fee is too low
    • Effective fee rate updates correctly
  • Edge cases

    • Empty fee amount → graceful handling
    • Zero fee rate → no errors
    • Very large fees → validation works
    • Add/remove outputs → fee recalculates correctly

Test Transactions:

  1. Script Explorer (manual mode)
  2. Wallet spend (auto-spend mode)
  3. Multi-output transactions
  4. Transactions requiring change

Related Issues

Fixes #443


@changeset-bot
Copy link

changeset-bot bot commented Jan 13, 2026

⚠️ No Changeset found

Latest commit: 25577ac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
caravan-coordinator Ready Ready Preview, Comment Feb 24, 2026 3:25pm

Request Review

@Legend101Zz
Copy link
Contributor Author

@bucko13 let me know if we want to make the fees field editable in auto mode too , not a big change , just wanted to confirm once :)

@Legend101Zz Legend101Zz requested a review from bucko13 January 13, 2026 15:53
n,
feesPerByteInSatoshis: rate,
});
console.log("estimatedFees", estimatedFees);
Copy link
Contributor

Choose a reason for hiding this comment

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

cleanup

Copy link
Contributor

@bucko13 bucko13 left a comment

Choose a reason for hiding this comment

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

a couple of console.logs to cleanup. will validate functionality as well.

setFeeRate(estimatedFeeRate);
}
}
console.log("fee", { setFee, setFeeRate, inputs, outputs });
Copy link
Contributor

Choose a reason for hiding this comment

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

cleanup

@bucko13
Copy link
Contributor

bucko13 commented Jan 21, 2026

The UX still feels a little funny to me and I wonder if maybe there are some regressions. First, to be clear, this is just in the manual mode right?

Screenshot 2026-01-21 at 4 34 26 PM

Second, there's some weird state management thing going on. When i clicked back and forth on the manual toggle. I got stuck with this error that inputs must be positive. Toggling the input on and off fixed that.

Screenshot 2026-01-21 at 4 35 38 PM

Lastly the "rebalance" is missing now for the change. Note in the second screenshot below when I add a second output for change the grey + shows up, but I don't see that in the new version for some reason.
Screenshot 2026-01-21 at 4 36 53 PM

Screenshot 2026-01-21 at 4 37 26 PM

Last thought: I wonder if fees should be in sats. The fee rate is of course in sats and I feel like thinking in sats for fees is a little more intuitive. It's certainly easier to type in with the number field.

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.

Alternative way of choosing fees when building transactions

2 participants