Skip to content

fix(bridging-widget): correct chain-aware bridge flow and history - #266

Draft
edehvictor wants to merge 1 commit into
GoodDollar:feat/gw243-bridging-widgetfrom
edehvictor:fix/bridging-correctness-257
Draft

edehvictor wants to merge 1 commit into
GoodDollar:feat/gw243-bridging-widgetfrom
edehvictor:fix/bridging-correctness-257

Conversation

@edehvictor

Copy link
Copy Markdown
Collaborator

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.

  • Apply chain-specific G$ decimals throughout the bridge flow and history, including 2-decimal Fuse amounts.
  • Improve wallet and source-chain selection, fee display, stale-quote retry, and approval-to-bridge states.
  • Make loading, error, and history-detail states clearer, including account-change resets.
  • Expand Storybook and Playwright coverage; refresh screenshots and fix light-theme contrast and modal captures.

Verification

  • Bridging-widget lint and build passed.
  • Playwright: 21/21 bridge tests passed.
  • Updated desktop, mobile, light-theme, and modal screenshots were inspected.

Remaining verification

  • Real-wallet signing, network switching, fees, and delivery have not been tested.
  • Full-workspace lint is blocked by a pre-existing unused import in the unrelated governance widget; bridging-widget lint passes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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])
Comment on lines +275 to +276
test('BridgingWidget completes the interactive route-to-submit flow', async ({ page }) => {
await gotoStory(page, 'interactive-submit')
@pheobeayo

Copy link
Copy Markdown

@edehvictor A review can only be done when the following conditions are satisfied:

  • You have tested with proof. (some proof/evidence, a video is usually the easiest to verify manual testing)
  • the UI/UX was compared against the reference.
  • Automated QA passes.
  • UI/UX related PRs include reference-vs-result screenshots + happy-path video.
  • Known limitations or untested areas are stated.

@edehvictor

Copy link
Copy Markdown
Collaborator Author

@pheobeayo, thank you. I'm still working on it. When I'm done. I'll let you know

@L03TJ3
L03TJ3 marked this pull request as draft October 23, 2026 05:45
@L03TJ3

L03TJ3 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

@edehvictor @pheobeayo lets try to keep hygiene around the stages of how we work on bounties.
what I think works is:

  • Initial pull-request always opened as draft
  • await at least copilot reviews and follow up on them with questions, fixes or counter-points
  • We will going forward have a 'bounty-lead' and that is the one assigned to the [Feature] issue. Contributor should wait before claiming 'ready for review'. like @pheobeayo shared, there are some things that a contributor needs to confirm and take care off.
  • in the middle review can be requested, but it should be a focused review request. things you are unsure about, things that might have 3 solutions and you need to pick one. or just a larger task and you want to make sure that you are on track with the bounty.

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.

This branch is waiting to be deployed

1 waiting deployment
external — cda1d378 Waiting Oct 22, 2026 by edehvictor via authorize-tests #117
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.

4 participants