Skip to content

feat(history): fold a swap's settlement rows under the swap row - #3223

Open
mgrabina wants to merge 7 commits into
swaps-via-backendfrom
history-swap-legs-accordion
Open

mgrabina wants to merge 7 commits into
swaps-via-backendfrom
history-swap-legs-accordion

Conversation

@mgrabina

@mgrabina mgrabina commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Context: a position swap's settlement tx also emits Supply/Borrow/Repay events, which history listed next to the swap. Stacked on #3201.

Now: rows whose tx hash matches a swap's settlement hash fold under that swap, behind a chevron. CSV/JSON export matches the screen.

Decisions:

  • Join on the settlement tx hash, over all loaded rows.
    • Why: a page boundary can split a swap from its legs; they rejoin when the next page lands.
  • Filters keep a swap row when it or one of its legs matches.
  • Export: one row per swap, legs in a steps cell, swap actions as names.
    • Rejected: separate rows with a partOfSwap column.

Checked: origin staging, one account: 34 chevrons, 34 export rows with 57 steps, matching the API.

No API or DB schema changes.

Review in order (?w=1):

  1. helpers.ts: foldSwapLegs, formatTransactionData.
  2. HistoryWrapper.tsx, TransactionRowItem.tsx.
  3. Skip: generated src/locales/*.

Part of SDK-1119

A position swap settles in one transaction that also emits ordinary
Supply/Borrow/Repay events, so the history listed those as separate rows
next to the swap. Rows whose tx hash matches a swap's settlement hash now
sit under that swap, behind a chevron that expands them.
@mgrabina

mgrabina commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
interface Ready Ready Preview Dec 3, 2026 7:30pm UTC

Request Review

@linear-code

linear-code Bot commented Dec 2, 2026

Copy link
Copy Markdown

SDK-1119

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T13:15:34.839196Z 4b6c696 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 797cb32e3a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

… filter

A Borrow filter or a search hit on a leg dropped the swap and the leg with it, while the export still listed the leg.
…story-swap-legs-accordion

# Conflicts:
#	src/locales/el/messages.js
#	src/locales/en/messages.js
#	src/locales/es/messages.js
#	src/locales/fr/messages.js
The export listed a swap and its Supply/Borrow/Repay rows as unrelated entries and printed swap actions as enum numbers. It now uses the screen's fold and filter, gives swap rows their settlement tx hash, names their action, and nests the legs in a steps field.
@mgrabina
mgrabina marked this pull request as ready for review December 3, 2026 13:13

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b6c696849

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/modules/history/helpers.ts Resolved
…re the hash

Two swaps settled in one CoW batch can't tell their Supply/Borrow/Repay rows apart, so folding them under the first swap mislabelled the second swap's legs.
…story-swap-legs-accordion

# Conflicts:
#	src/locales/el/messages.js
#	src/locales/en/messages.js
#	src/locales/es/messages.js
#	src/locales/fr/messages.js
…story-swap-legs-accordion

# Conflicts:
#	src/locales/el/messages.js
#	src/locales/en/messages.js
#	src/locales/es/messages.js
#	src/locales/fr/messages.js

This branch was successfully deployed

1 active deployment
Preview — 2c480873 Deployed Dec 3, 2026 by vercel[bot]
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.

1 participant