Improve Fee UX: Bidirectional Fee/Rate Input & Better Rebalance Button - #447
Improve Fee UX: Bidirectional Fee/Rate Input & Better Rebalance Button#447Legend101Zz wants to merge 15 commits into
Conversation
🦋 Changeset detectedLatest commit: a61f963 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@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 :) |
bucko13
left a comment
There was a problem hiding this comment.
a couple of console.logs to cleanup. will validate functionality as well.
|
@bucko13 sorry for the huge delay on this , finally I have fixed all the issues and also I decided not have the fees edit field on auto mode as it was getting far to complicated and logic was being fragile and inaccurate to calculate the fees before hand without knowing the inputs , can you check the UI , I am happy to iterate as we are taking time so any new fresh and better UX would be very nice
|
|
@bucko13 @tomunchained how do these look ?
|
|
Ugh, bummer. Still having e2e failures! https://github.com/caravan-bitcoin/caravan/actions/runs/23207942129/job/67448546087?pr=447 |
|
Ah, i think this is a legitimate e2e failure! |
| ) | ||
| rate = "0"; | ||
| setFeeRate(rate); | ||
| setFeeRate(rate === "" ? "0" : rate); // Reducer handles fee calculation and validation |
There was a problem hiding this comment.
Can also do:
Math.round(num * 100) / 100
bucko13
left a comment
There was a problem hiding this comment.
couple small questions/comments. Need to fix e2e as well. I'll test functionally next but the screenshots look good
| let feeRateString = action.value; | ||
|
|
||
| // Limit to 2 decimal places | ||
| if (feeRateString && feeRateString.includes(".")) { |
There was a problem hiding this comment.
Same
Math.round((num + Number.EPSILON) * 100) / 100
(or similar)
I yes I suspected that as I made changes to the transcation creation flow so would need to make changes to selectors in the Page model in. e2e , glad it's working fine :) |
…c runs bitcoinsToSatoshis returns a string, not a BigNumber. updateFee was storing that string in feeSats and then guarding the back-calculation with BigNumber.isBigNumber(feeSats), which always returned false. The fee field updated, but feeRate silently stayed at its previous value — the symptom Buck and the maintainer both saw in the form and Preview modal. Wrap the result in new BigNumber(...) so the guards behave like numbers and the back-calc actually fires. Add a regression test that mirrors the reported scenario (1 input of 6.25 BTC, two outputs, fee=0.001 BTC) and asserts the rate climbs well above the previous value of 1 sat/vB.
…nge-in-tx # Conflicts: # apps/coordinator/e2e/tests/03-transaction_flow.spec.ts
bf1b0f3 to
c2a983a
Compare
|
Sorry for the delay. I will give this one more review ASAP. could you help cleanup the e2e as well when you get a chance? |
yes sure let me fix that :) |
|
When I try to test via vercel "view deployment," I'm seeing no sign of the new feature. I load in a wallet, try to build a withdrawal transaction, and there's only the ability to adjust the fee rate without the absolute fee as shown in the screenshots. I asked another user to try it and he had the same experience. @bucko13 what are we doing wrong? |
|
@tomunchained what do you see in the bottom right hand corner for the version? And the URL? https://caravan-coordinator-denrj7idh-unchained.vercel.app/#/wallet
|
|
@tomunchained @jpcummins this is only exposed in manual coin selection mode. it's a little unintuitive (I ran into the same confusion in an earlier review) but that's because bitcoin fees are kind of unintuitive. In auto mode, the coin selection happens based on how much you're sending and your target fee rate. You can't know the absolute fee until your coins have been selected. You could probably design a UX where a user puts in a target, the coins are selected and then adjustments are made, but it adds a lot more complexity. and also from a usability point of view, you don't know how much you should even be paying until you know the size of the transaction (which is dependent on the inputs selected). With manual mode, you know both the inputs and outputs at any given time. This makes setting the fee by rate or absolute number trivial.
|
|
This pull request has been inactive for 30 days and has been marked as stale. It will be closed in 7 days if no further activity occurs. To keep this PR open, add the "long-lived" label or comment on it. |
|
This pull request has been automatically closed due to inactivity for 7 days after being marked as stale. Feel free to reopen if needed! |
Shadouts
left a comment
There was a problem hiding this comment.
The code is okay.
Some notes on manual testing:
I found a few bad-state bugs with the automatic<->manual transaction toggle that completely break manual mode. It really is only usable if you toggle it on and never switch back. I know this is outside the scope of your change, but I thought I'd comment on it.
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "caravan-coordinator": patch | |||
There was a problem hiding this comment.
nit: This should be a minor bump since it's a new feature and does change how rebalance looks.
| {showRebalance && ( | ||
| <Box> | ||
| <Button | ||
| data-testid="rebalance-button" |
There was a problem hiding this comment.
nit: data-testid props aren't great because they will render into an attribute on the html element.
| fullWidth | ||
| name="fee_total" | ||
| value={feeRate} | ||
| variant="outlined" |
There was a problem hiding this comment.
nit: This input looks disabled to me on Chrome with a gray background. That's confusing as I didn't think it was editable until I clicked it.
|
This pull request has been inactive for 30 days and has been marked as stale. It will be closed in 7 days if no further activity occurs. To keep this PR open, add the "long-lived" label or comment on it. |

























Problem
Users reported two major UX issues when building transactions:
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.
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.
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
Testing
Manual Testing Checklist:
Fee Rate → Fee Amount sync
Fee Amount → Fee Rate sync
Rebalance button
Auto-spend mode
Edge cases
Test Transactions:
Related Issues
Fixes #443