feat(bridge): show approximate bridging time while order is pending#7803
feat(bridge): show approximate bridging time while order is pending#7803tenderdeve wants to merge 1 commit into
Conversation
The 'Est. bridge time' row was suppressed during the pending Bridging state because the quote's estimated fill time was never persisted and estimatedTime was hardcoded to null. Carry expectedFillTimeSeconds on the persisted bridge quote amounts and surface it in the pending context, falling back to the live bridge status estimate when available. Closes cowprotocol#6459
|
@tenderdeve is attempting to deploy a commit to the cow-dev Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughAdds an optional ChangesBridge ETA propagation
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant BridgeQuote
participant useBridgeQuoteAmounts
participant Serializer as bridgeOrdersStateSerializer
participant useSwapAndBridgeContext
BridgeQuote->>useBridgeQuoteAmounts: expectedFillTimeSeconds
useBridgeQuoteAmounts->>Serializer: serializeQuoteAmounts(expectedFillTimeSeconds)
Serializer->>Serializer: deserializeQuoteAmounts(expectedFillTimeSeconds)
Serializer->>useSwapAndBridgeContext: bridgeQuoteAmounts.expectedFillTimeSeconds
useSwapAndBridgeContext->>useSwapAndBridgeContext: estimatedTime = expectedFillTimeSeconds || fillTimeInSeconds || null
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary
Fixes #6459.
When a swap+bridge order is in the Bridging state there was no indication of how long bridging might take (it can be 18–20 min). The UI already has an "Est. bridge time" row (
QuoteBridgeContent), but it stayed hidden during pending becauseestimatedTimewas hardcoded tonullwhen building the pending context — the quote'sexpectedFillTimeSecondswas never persisted with the order.Changes
expectedFillTimeSecondstoBridgeQuoteAmountsand capture it inuseBridgeQuoteAmountsfrom the bridge quote. It then rides along with every persisted bridge order (alladdBridgeOrdercall sites already storequoteAmounts), so no per-flow plumbing is needed.useSwapAndBridgeContext, set the pendingestimatedTimefrom the persisted quote ETA, falling back to the livestatusResult.fillTimeInSecondswhen present.The rendering component is unchanged — it already displays the row once
estimatedTimeis non-null.Testing steps
~ X mininstead of being hidden.Summary by CodeRabbit