Repository navigation
fix(bridging-widget): correct chain-aware bridge flow and history - #266
edehvictor wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Submission preparation can outlive account changes, and failed history refreshes can prevent subsequent polling results from updating pending entries.
3 open issues
What changed in this PR
Updates the bridging widget from #251 to address #257’s chain-aware amounts, wallet selection, quote freshness, and history requirements.
Changes:
- Uses chain-specific G$ decimals and displays buffered provider fees.
- Separates source selection from the wallet network and refreshes quotes before submission.
- Revises history polling and expands Storybook fixtures, flow checks, and screenshot capture.
| File | Description |
|---|---|
| tests/widgets/bridging-widget/states.spec.ts | Adds decimal and interactive-flow checks; improves screenshots. |
| packages/bridging-widget/tests/historyTransactions.test.mjs | Tests history pairing and status-failure handling. |
| packages/bridging-widget/src/widgetRuntimeContract.ts | Separates wallet and selected-source state. |
| packages/bridging-widget/src/components/shared.tsx | Lists supported chains in protocol labels. |
| packages/bridging-widget/src/components/ReviewScreen.tsx | Displays chain-aware amounts and charged fees. |
| packages/bridging-widget/src/components/HistoryTab.tsx | Formats history amounts and preserves entries on refresh errors. |
| packages/bridging-widget/src/components/FeeBreakdown.tsx | Uses destination decimals and buffered provider fees. |
| packages/bridging-widget/src/components/BridgingWidgetView.tsx | Keeps bridge UI visible and adds wallet controls. |
| packages/bridging-widget/src/components/BridgeTab.tsx | Adds source selection and clearer connection states. |
| packages/bridging-widget/src/components/BridgeHistoryDetailModal.tsx | Formats history-detail amounts by source chain. |
| packages/bridging-widget/src/components/AmountEntry.tsx | Updates balance formatting and disconnected display. |
| packages/bridging-widget/src/BridgingWidget.tsx | Supplies preview wallet identity overrides. |
| packages/bridging-widget/src/adapter/useBridgeSubmission.ts | Loads fresh quotes and guards submission callbacks. |
| packages/bridging-widget/src/adapter/useBridgeQuote.ts | Parses source decimals and hides stale quotes. |
| packages/bridging-widget/src/adapter/useBridgeHistory.ts | Separates pending-status polling from history scans. |
| packages/bridging-widget/src/adapter/useBridgeConfig.ts | Hides config from previous routes or accounts. |
| packages/bridging-widget/src/adapter/historyTransactions.ts | Extracts history normalization and retains unresolved entries. |
| packages/bridging-widget/src/adapter/chains.ts | Adds chain-decimal and native-fee helpers. |
| packages/bridging-widget/src/adapter.ts | Coordinates source selection, resets, and fresh-quote submission. |
| examples/storybook/src/stories/helpers/bridgingWidgetStories.tsx | Updates fixtures and adds decimal and interactive scenarios. |
| examples/storybook/src/stories/bridging-widget/BridgingWidgetQA.stories.tsx | Exposes the new QA stories. |
Review effort: Balanced
| setSelectedHistoryTransaction(null) | ||
| submission.reset() | ||
| }, [isReady]) | ||
| if (submission.step === 'idle' || submission.step === 'failed') submission.reset() |
| active = false | ||
| clearInterval(intervalId) | ||
| } | ||
| }, [sdk, address, state.transactions]) |
| test('BridgingWidget completes the interactive route-to-submit flow', async ({ page }) => { | ||
| await gotoStory(page, 'interactive-submit') |
|
@edehvictor A review can only be done when the following conditions are satisfied:
|
|
@pheobeayo, thank you. I'm still working on it. When I'm done. I'll let you know |
|
@edehvictor @pheobeayo lets try to keep hygiene around the stages of how we work on bounties.
Only when the initial checks are met, confirmed by bounty-lead, should turn this into a ready for review PR and the group of reviewers can be assigned. |


Summary
Follow-up to #251 for issue #257. This PR adds the bridge-flow correctness and UI fixes as one commit on top of the existing bridging-widget branch.
Verification
Remaining verification