Skip to content

Add bulk-select cancel/delete to the Offers page - #876

Open
judeallred wants to merge 3 commits into
xch-dev:mainfrom
judeallred:offers-bulk-select
Open

judeallred wants to merge 3 commits into
xch-dev:mainfrom
judeallred:offers-bulk-select

Conversation

@judeallred

@judeallred judeallred commented Sep 9, 2026

Copy link
Copy Markdown

Summary

  • Replaces the standalone "Cancel All Active" and "Delete All" buttons on the Offers page — which built a single unbounded transaction and could fail once the offer book grew large — with the same multi-select pattern already used on the NFTs page: toggle select mode, pick a subset of offers, then Cancel or Delete just that selection from a floating actions bar.
  • Extracts shared building blocks so this doesn't triplicate logic:
    • SelectableCard — click/keyboard/selection behavior shared by NFT cards and offer rows.
    • MultiSelectActionBar — the floating "N selected" bar shell, now shared by the NFT and offer multi-select action bars.
    • CancelOffersFlow — the fee → review → sign → submit cancel flow, shared by the single-offer row action and the new bulk action.
    • deleteOffers helper for the delete loop.
  • Adds a loading indicator to the cancel dialog's submit button (previously no feedback while the transaction was being built/signed).
  • Fixes the delete dialog's button, which said "Delete All" even when only a selection was being deleted.

Before

image

After

image image

Test plan

  • pnpm exec tsc -b --noEmit, pnpm exec eslint src, pnpm exec prettier --check (all passing locally)
  • Manually verify: toggle multi-select on Offers page, select a subset, Cancel Offers and Delete from the floating action bar
  • Manually verify single-offer row Cancel/Delete still work
  • Manually verify NFT page multi-select still works (Transfer/Assign/Burn/Add to Offer)

🤖 Generated with Claude Code

judeallred and others added 2 commits September 9, 2026 15:08
Replaces the standalone "Cancel All Active" and "Delete All" buttons,
which built a single unbounded transaction and could fail once the
offer book grew large, with the same multi-select pattern used on the
NFTs page: toggle select mode, pick a subset of offers, then Cancel or
Delete just that selection from a floating actions bar.

Extracts the shared select/navigate card behavior (SelectableCard),
the floating multi-select action bar shell (MultiSelectActionBar), and
the fee -> review -> sign -> submit cancel flow (CancelOffersFlow) so
the NFT panel, single-offer row actions, and bulk offer actions all
reuse the same building blocks instead of three copies of the same
logic. Also adds a loading state to the cancel dialog's submit button
and fixes the delete dialog's button label, which still said "Delete
All" even when only a selection was being deleted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The selection-toggle logic was inlined as a nested ternary/filter
expression directly inside the JSX map, unlike NftCardList's
equivalent handleSelection, which is a named callback. Extracting it
here makes the per-row selectionState prop legible at a glance.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@judeallred
judeallred marked this pull request as ready for review September 9, 2026 19:21
Maintainer feedback: this PR replaced "Delete All" with multi-select
bulk delete, but the standalone button (deletes every offer currently
matching the status filter, independent of any selection) should stay
alongside multi-select rather than being replaced by it. Restores the
original button and dialog wiring, reusing the deleteOffers() helper
extracted earlier in this branch instead of duplicating the loop.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@judeallred

Copy link
Copy Markdown
Author

Restored the standalone Delete All button (22f0fed) — it deletes every offer currently matching the status filter, independent of any multi-select. It now sits alongside the multi-select toggle rather than being replaced by it, and reuses the deleteOffers() helper extracted earlier in this branch instead of reintroducing a duplicate delete loop.

@judeallred

Copy link
Copy Markdown
Author

@Rigidity For your consideration

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