Skip to content

fix(trade): remove 'total fee' row from swap form - #7805

Merged
elena-zh merged 3 commits into
cowprotocol:developfrom
tenderdeve:fix/6693-remove-total-fee
Jul 10, 2026
Merged

elena-zh merged 3 commits into
cowprotocol:developfrom
tenderdeve:fix/6693-remove-total-fee

Conversation

@tenderdeve

@tenderdeve tenderdeve commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #6693.

The Total fee row in the swap form's price dropdown only showed up when a partner fee and a protocol fee were both present — in every other case it was absent. That inconsistency is confusing, so this removes the row from the swap form.

Changes

  • Drop showTotalRow from the swap-form TradeFeesAndCosts usage (the only place it was enabled).
  • Remove the now-unused showTotalRow/totalFeeUsd plumbing from TradeFeesAndCosts and TradeFees, and delete the orphaned TotalFeeRow component.

Individual protocol/partner fee rows are unchanged. The order-receipt modal's own "Total fee" line is separate and untouched.

Testing steps

  1. Open the app in a Safe wallet, specify a swap order.
  2. Expand the price dropdown.
  3. There is no longer a Total fee field — only the individual fee/cost rows.

Summary by CodeRabbit

  • Updates
    • Simplified fee and cost details by removing the separate total-fee row.
    • Fee details now focus on partner, protocol, and network costs.
    • Updated trade fee displays and related expanded rate details to reflect the streamlined layout.

The 'Total fee' row only appeared in the price dropdown when both a partner
fee and protocol fee were present, and nowhere else, making the swap form
inconsistent. Drop the row and the now-unused showTotalRow/totalFee plumbing
(TotalFeeRow component included). Individual protocol/partner fee rows are
unchanged, and the order receipt's own 'Total fee' is untouched.

Closes cowprotocol#6693
@vercel

vercel Bot commented Jul 2, 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 Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: dab7e3d1-42e2-47d8-8513-bd57190ef453

📥 Commits

Reviewing files that changed from the base of the PR and between 08e23be and e7efa99.

📒 Files selected for processing (5)
  • apps/cowswap-frontend/src/modules/trade/containers/TradeFeesAndCosts/index.tsx
  • apps/cowswap-frontend/src/modules/trade/index.ts
  • apps/cowswap-frontend/src/modules/trade/pure/TotalFeeRow/index.tsx
  • apps/cowswap-frontend/src/modules/trade/pure/TradeFees/index.tsx
  • apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/TradeRateDetails/index.tsx
💤 Files with no reviewable changes (4)
  • apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/TradeRateDetails/index.tsx
  • apps/cowswap-frontend/src/modules/trade/index.ts
  • apps/cowswap-frontend/src/modules/trade/pure/TotalFeeRow/index.tsx
  • apps/cowswap-frontend/src/modules/trade/pure/TradeFees/index.tsx

Walkthrough

The trade fee UI no longer calculates or displays a total fee row. Related props, rendering logic, component exports, and caller wiring were removed while partner, protocol, and network fee details remain.

Changes

Trade fee display removal

Layer / File(s) Summary
Remove total fee rendering
apps/cowswap-frontend/src/modules/trade/pure/TradeFees/index.tsx
TradeFees no longer accepts total-fee props or renders TotalFeeRow.
Update fee container integration
apps/cowswap-frontend/src/modules/trade/containers/TradeFeesAndCosts/index.tsx, apps/cowswap-frontend/src/modules/tradeWidgetAddons/containers/TradeRateDetails/index.tsx, apps/cowswap-frontend/src/modules/trade/index.ts
Total-fee calculation and caller wiring were removed, along with the TotalFeeRow barrel export.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: fairlighteth, elena-zh, limitofzero, kernelwhisperer

Poem

I’m a bunny with fees tucked away,
No total row hops into view today.
Partner and protocol still nibble the flow,
Network costs remain in their row.
Hop, hop—the trade details are neat!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely matches the main change: removing the Total fee row from the swap form.
Description check ✅ Passed The description includes the issue reference, summary, concrete changes, and testing steps, which fits the template well.
Linked Issues check ✅ Passed The changes remove the inconsistent Total fee row from the swap form as requested in #6693 and keep other fee rows unchanged.
Out of Scope Changes check ✅ Passed The export and prop cleanups are tied to deleting the Total fee row and do not appear unrelated to the issue.
✨ 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.

@vercel

vercel Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
swap-dev Ready Ready Preview Jul 2, 2026 3:09pm
widget-configurator Ready Ready Preview Jul 2, 2026 3:09pm

Request Review

@vercel
vercel Bot temporarily deployed to Preview – swap-dev July 2, 2026 14:50 Inactive
@vercel
vercel Bot temporarily deployed to Preview – widget-configurator July 2, 2026 15:09 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.

LGTM, thank you

@elena-zh
elena-zh enabled auto-merge (squash) July 10, 2026 10:03
@elena-zh
elena-zh merged commit 8ab088d into cowprotocol:develop Jul 10, 2026
11 of 19 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 10, 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.

Safe: remove ‘total fee’ from swap form

4 participants