Skip to content

add gift cards#758

Merged
jbojcic1 merged 26 commits intomasterfrom
gift-cards-2
Jan 30, 2026
Merged

add gift cards#758
jbojcic1 merged 26 commits intomasterfrom
gift-cards-2

Conversation

@gudnuf
Copy link
Contributor

@gudnuf gudnuf commented Jan 6, 2026

Gift Cards Feature

Screen.Recording.2026-01-06.at.2.31.25.PM.mov

Overview

Implements a gift cards page that displays cashu accounts from closed-loop mints as "gift cards" with a stacked card UI and expand/collapse animations.

Animations

I might have gotten a little too excited about making these animations, but I think it looks good. I tried to at least document the idea of what each piece of the animation is doing, but I don't fully understand how the details of the CSS work. High-level is something like:

When a card is clicked, it goes from an idle state to entering where it slides up and the rest of the stacked card view disappears. When the card reaches the settled state its rendering a new component that is overlaid on the collapsed view.

The flow:

  • Tap card → StackView captures the card's position, hides cards, ExpandedView mounts and animates clones from that position to the top
  • Collapse → ExpandedView animates clones back to the original positions (read from cardRefs), then unmounts, StackView shows cards again

Other Notable Changes

  • Transaction filtering: Added accountId param to useTransactions and list_transactions RPC to show per-card transaction history
  • Closed-loop detection: Added isClosedLoop getter to ExtendedCashuWallet to identify gift card mints
  • Initialize specific account for send/receive: I made the send and receive inputs optionally get initialized with an accountId query param. This is used when a user clicks "Add" or "Send" from a selected card

@vercel
Copy link

vercel bot commented Jan 6, 2026

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

Project Deployment Actions Updated (UTC)
agicash Ready Ready Preview, Comment Jan 30, 2026 4:11am

Request Review

@gudnuf gudnuf requested a review from jbojcic1 January 6, 2026 22:49
@gudnuf gudnuf self-assigned this Jan 6, 2026
@jbojcic1
Copy link
Collaborator

jbojcic1 commented Jan 7, 2026

opening a gift card page and clicking add, opens the receive page but then when I close it it takes me to home page instead of back to card page. that seems wrong

Copy link
Contributor Author

@gudnuf gudnuf left a comment

Choose a reason for hiding this comment

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

@jbojcic1 I addressed your comments and also removed the conditional rendering from the lazy loaded images (e1f6a6e). This way its all css and looks the same as before. The conditional rendering was making the images flash because on first render isLoaded would be false even if it was already cached (I only noticed this behavior on mobile).

Last thing I'm trying to improve is that the view transitions for selecting gift cards is a bit glitchy on mobile for some reason (looks good on desktop)

1. AirDrop or email the `certs/rootCA.pem` file to your device and open it
2. Go to **Settings → General → VPN & Device Management** and install the downloaded profile
3. Go to **Settings → General → About → Certificate Trust Settings** and enable full trust for the root certificate
**Installing the root certificate on iOS:** Mobile browsers require the root CA to be trusted. Find your mkcert root CA
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Originally claude copied my rootCa to my agicash/certs dir, so then that's what these previous docs were pointing to. I had to go through this again, and realized this is wrong because that's not where the cert actually lives

gudnuf and others added 22 commits January 29, 2026 19:55
* Refactor to use view transitions for card animations

* Cleanup

* Add back fade in/out transition for gift card item overlay
Convert gift card images from PNG to WebP format for better compression.
Add WalletCardBackgroundImage component that shows a skeleton placeholder
while images load, then fades them in smoothly.

- Replace WalletCardBackground with WalletCardBackgroundImage across gift card components
- Add convert-to-webp.sh script for converting PNG assets to WebP
- Document WebP conversion workflow in README

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gudnuf
Copy link
Contributor Author

gudnuf commented Jan 30, 2026

I commented on commit diff but don't see those comments here now so here it is again.

Screenshot 2026-01-29 at 13 15 01 can you explain what happened here?

Claude added the translate classes, I just changed those here d48c306 because there was a bug on desktop where the cards that slide down would expand to the full width of the desktop screen. The way it was before was a way to center the cards, but I changed to center differently and apply max width of CARD_WIDTH so the width doesn't change.

The real change I was going for there was changing the absolute positioning to fixed because with the absolute positioning you could see the cards when you scrolled to the bottom of the details page. Fixed positioning keeps it off screen

Screenshot 2026-01-29 at 13 15 08 and also here?

Not sure why it was absolute inset before, but the problem that I was fixing is that having inset-0 made it so that the header didn't use the padding on the Page component. So there wasn't enough padding. I could have just added more padding, but this was cleaner and doesn't seem like those other styles are needed.

@jbojcic1
Copy link
Collaborator

27f4499

I opened draft PR with it here so we can just merge when/if OS is ready.

@jbojcic1 jbojcic1 merged commit 2c3ff60 into master Jan 30, 2026
5 checks passed
@jbojcic1 jbojcic1 deleted the gift-cards-2 branch January 30, 2026 10:45
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.

2 participants