Skip to content

Transaction flow#394

Open
jbrauck-unchained wants to merge 21 commits intocaravan-bitcoin:mainfrom
jbrauck-unchained:transaction-flow
Open

Transaction flow#394
jbrauck-unchained wants to merge 21 commits intocaravan-bitcoin:mainfrom
jbrauck-unchained:transaction-flow

Conversation

@jbrauck-unchained
Copy link
Contributor

What kind of change does this PR introduce?

This introduces a new tranasction flow diagram feature

Issue Number:

Fixes #393 #393

Snapshots/Videos:

Screenshot 2025-10-05 at 10 54 04 PM

If relevant, did you update the documentation?

Summary

I like what sparrow does to try and give a user a sense of understanding their own transaction. I think this is a small lift to gain feature parity in a place that makes caravan more educational.

Does this PR introduce a breaking change?

Checklist

  • I have tested my changes thoroughly.
  • I have added or updated tests to cover my changes (if applicable).
  • I have verified that test coverage meets or exceeds 95% (if applicable).
  • I have run the test suite locally, and all tests pass.
  • I have written tests for all new changes/features
  • I have followed the project's coding style and conventions.
  • I have created a changeset to document my changes (npm run changeset)

Other information

Have you read the contributing guide?

For information on creating and using changesets, please refer to our documentation on changesets.

@changeset-bot
Copy link

changeset-bot bot commented Oct 8, 2025

⚠️ No Changeset found

Latest commit: 1f76f55

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 Oct 8, 2025

@jbrauck-unchained is attempting to deploy a commit to the Unchained Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Oct 8, 2025

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

Project Deployment Review Updated (UTC)
caravan-coordinator Ready Ready Preview, Comment Jan 22, 2026 2:33am

Request Review

@Legend101Zz
Copy link
Contributor

Screenshot 2025-10-23 at 19 43 39 @jbrauck-unchained maybe you'll have do the formatting ( run the linter ) and get the unsed imports out for the ci to pass :)

@Legend101Zz
Copy link
Contributor

One small nit: maybe we can add ~ 0.00% total so we can tell the user we are rounding up here and they don't think of this as a bug
Screenshot 2025-10-23 at 19 46 56

@Legend101Zz
Copy link
Contributor

Legend101Zz commented Oct 23, 2025

Screenshot 2025-10-23 at 19 50 13

maybe we can remove one of the Edit Transaction Button

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the stale label Dec 17, 2025
Copy link
Contributor

@Legend101Zz Legend101Zz left a comment

Choose a reason for hiding this comment

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

@jbrauck-unchained thanks for the awesome work , I tested it and it looks super good to me , now I guess we can move towards the code changes , the main concern I have is over modularity and an IIFE used in rendering of the flow status

Screenshot 2026-01-06 at 07 22 52

return `${address.slice(0, 10)}...${address.slice(-8)}`;
};

const getStatusDisplay = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

this can go in the utils file then

};

// Format script type for display
const formatScriptType = (scriptType?: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add this and formatAddress in the general utils file as they can be used by other components too :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a different general utils file you are talking about? For now I added to the TransactionFlowUtils.ts file

Copy link
Contributor

Choose a reason for hiding this comment

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

that works perfectly for me :)

- Create TransactionFlowDiagram directory structure with separate files:
  - index.tsx: Main component file (cleaner, more focused)
  - hooks.ts: Custom useFlowPaths hook for SVG path calculations
  - utils.ts: Utility functions (buildCurvePath, formatAddress, formatScriptType, getScriptTypeColor, getStatusDisplay)
  - FlowDrawers.tsx: Input and output drawer components
  - FlowSummary.tsx: Summary section with legend and transaction totals
- Move formatSats and formatAddress to transactionFlowUtils.ts for reuse
- Remove old 1704-line monolithic TransactionFlowDiagram.tsx file

This addresses code review feedback to improve maintainability and readability.
- Remove unused variables in TransactionPreview.jsx render method
- Fix prettier formatting in TransactionsTable.tsx
- Fix prettier formatting in useTransactionDetails.ts
- Remove unused blockHeight variable in transactionFlowUtils.ts
Copy link
Contributor

@Legend101Zz Legend101Zz left a comment

Choose a reason for hiding this comment

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

Thanks alot for the changes , it's looking really good now , nothing from my end now :)

@bucko13 can you please review it when you get the chance ...

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transaction flow diagram

3 participants