Skip to content

fix(account): show Unfillable warning for swap-and-bridge orders - #7701

Merged
fairlighteth merged 9 commits into
cowprotocol:developfrom
tenderdeve:fix/6803-bridge-unfillable-warning
Jun 26, 2026
Merged

fairlighteth merged 9 commits into
cowprotocol:developfrom
tenderdeve:fix/6803-bridge-unfillable-warning

Conversation

@tenderdeve

@tenderdeve tenderdeve commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #6803.

In ActivityDetails, the OrderFillabilityWarning (the "Unfillable" row that surfaces insufficient balance/allowance on a pending order) was rendered only inside the regular-order branch. When isBridgeOrder was true the component routed to BridgeActivitySummary and the warning block was skipped entirely — even though usePendingOrdersFillability() already produced the same fillability info for bridge orders, so the data was there but never displayed.

Hoist the warning into a shared fillabilityWarning node and render it after both layouts so swap-and-bridge orders show the same insufficient balance / insufficient allowance state as regular orders.

Test plan

  • Place a swap-and-bridge order in a Safe wallet against a not-yet-approved sell token, sign the Safe TX with an approval lower than the sell amount
  • Open the Account modal and confirm the "Unfillable" row appears with the insufficient allowance warning
  • Repeat with a balance lower than the sell amount and confirm the insufficient balance warning appears
  • Regression check on a regular (non-bridge) order — warning still appears in the same place

Summary by CodeRabbit

  • Bug Fixes
    • Fillability warning now consistently displayed for all order types, including bridge orders.

The OrderFillabilityWarning was rendered only inside the regular-order
branch of ActivityDetails, so bridge orders with insufficient allowance
or balance had no warning in the Account modal even though their
fillability state was already computed.

Hoist the warning into a shared node and render it after both branches
(BridgeActivitySummary and the regular layout) so bridge orders surface
the same insufficient balance/allowance state as regular orders.

Resolves cowprotocol#6803.
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

@tenderdeve is attempting to deploy a commit to the cow-dev Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@fairlighteth, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 12 minutes and 36 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e2e088d7-34cd-46dc-92ca-35fa4b195840

📥 Commits

Reviewing files that changed from the base of the PR and between 918475e and 51f6002.

📒 Files selected for processing (1)
  • apps/cowswap-frontend/src/modules/account/containers/Transaction/ActivityDetails.tsx

Walkthrough

ActivityDetails now extracts the fillability warning into a single shared fillabilityWarning JSX variable. This variable is injected into the bridge-order rendering branch (alongside BridgeActivitySummary) and replaces the previously inlined warning block in the regular-order layout branch.

Changes

Fillability Warning Shared Across Order Types

Layer / File(s) Summary
Shared fillabilityWarning variable and both render paths
apps/cowswap-frontend/src/modules/account/containers/Transaction/ActivityDetails.tsx
Computes a single fillabilityWarning element from fillability, showWarning, and orderSummary.inputAmount; injects it into the bridge-order branch via BridgeActivitySummary children and replaces the inlined block in the regular-order layout.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • fairlighteth
  • shoom3301

Poem

🐇 A warning once hidden from bridges so wide,
Now hops to both branches with nowhere to hide!
One fillabilityWarning to rule them all,
Shared neatly in code — no inline sprawl.
The bunny refactored and fixed up the gap,
Now swap and bridge orders stay right on the map! 🌉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding the Unfillable warning for swap-and-bridge orders.
Description check ✅ Passed The description comprehensively covers the issue, solution, and test plan. It follows the repository template with Summary, Test plan, and Background sections.
Linked Issues check ✅ Passed The PR directly addresses issue #6803 by hoisting the fillability warning to render for both regular and bridge orders, implementing the expected behavior described in the linked issue.
Out of Scope Changes check ✅ Passed All changes are focused on the ActivityDetails component refactoring to display fillability warnings for bridge orders, which is entirely within scope of issue #6803.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@elena-zh elena-zh added the trigger-preview Add to a fork PR to trigger CF-pages preview. See https://github.com/cowprotocol/cowswap/pull/7615 label Jun 23, 2026
@github-actions

github-actions Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Cloudflare Pages preview mirror

Preview branch URL: https://github.com/cowprotocol/cowswap/tree/cf-preview/pr-7701
Mirror PR: #7705
Cloudflare Pages preview links will be posted on the mirror PR by the Cloudflare Pages GitHub integration once builds complete.

Source fork branch: tenderdeve/cowswap:fix/6803-bridge-unfillable-warning
Approval target SHA: 51f60020af50
Last mirrored SHA: 789600456e52
Last comment update: @fairlighteth at 2026-06-26T17:01:25.327Z

  • Sync Cloudflare preview to approval target commit

@github-actions github-actions Bot removed the trigger-preview Add to a fork PR to trigger CF-pages preview. See https://github.com/cowprotocol/cowswap/pull/7615 label Jun 23, 2026
@vercel
vercel Bot temporarily deployed to Preview – storybook June 23, 2026 08:13 Inactive
@vercel
vercel Bot temporarily deployed to Preview – widget-configurator June 23, 2026 08:13 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cowfi June 23, 2026 08:14 Inactive
@vercel
vercel Bot temporarily deployed to Preview – storybook June 23, 2026 10:07 Inactive
@vercel
vercel Bot temporarily deployed to Preview – widget-configurator June 23, 2026 10:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cowfi June 23, 2026 10:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – storybook June 24, 2026 11:14 Inactive
@vercel
vercel Bot temporarily deployed to Preview – widget-configurator June 24, 2026 11:14 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cowfi June 24, 2026 11:15 Inactive
@vercel
vercel Bot temporarily deployed to Preview – storybook June 25, 2026 13:28 Inactive
@vercel
vercel Bot temporarily deployed to Preview – widget-configurator June 25, 2026 13:28 Inactive
@vercel
vercel Bot temporarily deployed to Preview – sdk-tools June 25, 2026 13:29 Inactive
@vercel
vercel Bot temporarily deployed to Preview – cowfi June 25, 2026 13:29 Inactive

@elena-zh elena-zh 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.

Thank you, works fine

@elena-zh
elena-zh requested a review from limitofzero June 25, 2026 14:05

@fairlighteth fairlighteth 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.

✅ AI Review (Codex GPT-5, worked 4m): no new findings

Review completed. I found no new non-duplicate comments worth posting.

Related context checked

  • Current head: 9b433b8829bd.
  • Diff scope: one-file change in apps/cowswap-frontend/src/modules/account/containers/Transaction/ActivityDetails.tsx.
  • The fix reuses the existing OrderFillabilityWarning node for both regular and bridge order layouts; the regular-order path keeps the same warning rendering.
  • Linked issue #6803 asks for the missing swap-and-bridge insufficient balance/allowance row, and the existing human review says this works.
  • No review threads were collected, and CodeRabbit had no actionable comments.

Generated using the pr-review skill from the CoW Protocol skills repo.

@fairlighteth

Copy link
Copy Markdown
Contributor
🧪 Scoped browser QA passed: mocked unfillable-warning matrix; live Safe/RPC not exercised

Outcome

  • Mocked app-integration browser matrix passed for PR head 9b433b8829bd.
  • Swap-and-bridge orders rendered exactly one Unfillable row for insufficient allowance and insufficient balance.
  • Balance-low cases showed the balance warning; allowance-low cases showed the approve action; enough-balance/allowance and valid-permit cases showed no warning.
  • Regular order and expired-bridge fallback layouts still rendered a single allowance warning.

Run details

  • Browser QA was executed with Playwright; this was not a manual human QA pass.
  • Browser: Chromium 140.0.7339.16.
  • Source: PR head 9b433b8829bd via local checkout.
  • Mode: mocked app integration. The run used the real ActivityDetails.tsx component and real useOrdersFillability() hook, with mocked pending orders, balances, allowances, bridge context, permit validity, and connected account/chain.
  • AI usage: Codex orchestrated the Playwright run, collected artifacts, and drafted this summary from the observed assertions and artifacts.

Coverage matrix

Claim / surface Status Evidence Gap
Bridge order, allowance below sell amount 🧪 Scoped One Unfillable allowance warning and approve action observed Live allowance read not exercised
Bridge order, balance below sell amount 🧪 Scoped One Unfillable balance warning observed Live balance read not exercised
Bridge order, both balance and allowance low 🧪 Scoped Balance warning takes precedence; no approve action Live account state not exercised
Bridge order, enough balance and allowance 🧪 Scoped No Unfillable row observed Live bridge order not exercised
Bridge order, allowance low but valid permit 🧪 Scoped No Unfillable row observed Real permit flow not exercised
Regular order allowance warning regression 🧪 Scoped Regular order still shows one allowance warning and approve action Live regular order not exercised
Expired bridge regular-fallback layout 🧪 Scoped Fallback layout still shows one allowance warning Live expired bridge order not exercised

Artifacts

Matrix screenshot:

Chromium mocked app-integration matrix for PR 7701 unfillable bridge warnings

How to retest

  • Use PR head 9b433b8829bd.
  • Render Account activity details with mocked pending bridge and regular orders, then set sellAmount = 100 with the balance/allowance/permit matrix shown above.
  • Assert one Unfillable row in low-balance or low-allowance states, no warning in enough-balance/allowance or valid-permit states, and approve action only in allowance-low states.

Not checked / follow-up

  • Real Safe signing was not exercised.
  • Live chain allowance/balance reads were not exercised.
  • Backend bridge-order responses were not exercised.
  • Real approval transaction behavior was not exercised.

Generated using the pr-qa skill from the CoW Protocol skills repo.

@fairlighteth

fairlighteth commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor
✅ Security Review (Codex GPT-5, worked 13m): no verified security findings

Review completed. I found no verified security findings worth posting.

Review scope and related context
  • Checked: PR head 9b433b8829bd856f9d0bbcef50a873bfa8782304; ActivityDetails.tsx warning hoist; bridge-order fillability warning rendering; adjacent activity-row link, hook-detail, custom-recipient, and approval-button paths inspected by DeepSec.
  • Harness used: DeepSec PR mode.
  • Source: DeepSec PR-mode output, verified against current code.
  • DeepSec status: DeepSec run.
  • Harness/scanner context: pnpm dlx deepsec process --diff 63400254fd631349b6215735eb8254e05e14d6d9 --comment-out comment.md; exit code 0; run 20260626104942-8b1abcf891bd22be; no comment artifact written because DeepSec produced no findings.
  • Lifecycle: no verified-vulnerability findings.
  • Existing comments: prior code-inspection security-review comment and scoped browser QA comment checked.
  • Confidence limits: live Safe signing, live allowance/balance reads, and real approval transaction execution were not exercised in this DeepSec-backed pass.

Generated using the security-review skill from the CoW Protocol skills repo.

@fairlighteth
fairlighteth self-requested a review June 26, 2026 10:59
Resolve the Account activity conflict by keeping the shared fillability warning for bridge and regular orders while preserving the new approve-modal output amount from develop.
@fairlighteth
fairlighteth force-pushed the fix/6803-bridge-unfillable-warning branch from d310086 to d72433a Compare June 26, 2026 17:00
@fairlighteth
fairlighteth enabled auto-merge (squash) June 26, 2026 17:02
@fairlighteth
fairlighteth merged commit 3cfde0e into cowprotocol:develop Jun 26, 2026
12 of 18 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No 'insufficient balance/allowance' warnings for swap and bridge orders

4 participants