Skip to content

💄 app: improve freeze card ui#995

Draft
dieguezguille wants to merge 6 commits intomainfrom
freeze
Draft

💄 app: improve freeze card ui#995
dieguezguille wants to merge 6 commits intomainfrom
freeze

Conversation

@dieguezguille
Copy link
Copy Markdown
Member

@dieguezguille dieguezguille commented Apr 30, 2026

Summary by CodeRabbit

  • New Features

    • Card freeze/unfreeze flow with confirmation prompt
    • Visual frozen card overlay with icon indicator
    • Haptic feedback on card interactions and status changes
    • Updated home card controls for freeze management
  • Internationalization

    • Added Spanish and Portuguese translations for card freeze flows

@dieguezguille dieguezguille self-assigned this Apr 30, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Walkthrough

A patch release for the @exactly/mobile package introduces card freeze functionality including a confirmation sheet component, optimistic freeze state handling with haptic feedback, a new shared Switch component, frozen card overlay visualization, home screen freeze controls, and i18n translations.

Changes

Cohort / File(s) Summary
Changesets
.changeset/cool-rockets-raise.md, .changeset/frank-snails-move.md, .changeset/six-breads-shout.md, .changeset/social-icons-retire.md, .changeset/spotty-rules-camp.md, .changeset/tangy-deer-design.md
Metadata entries marking patch releases documenting card freeze confirmation sheet, frozen overlay visualization, home card freeze controls, shared switch component, and haptic feedback additions.
Card Components
src/components/card/Card.tsx, src/components/card/CardFreezeSheet.tsx, src/components/card/exa-card/CardContents.tsx
Card.tsx integrates haptic feedback, optimistic freeze state, and opens CardFreezeSheet confirmation. New CardFreezeSheet component displays freeze prompt and confirmation/cancel buttons. CardContents now renders a separate frozen overlay with dimming layer and snowflake icon.
Shared Switch
src/components/shared/Switch.tsx
New Tamagui-based switch component with styled frame and thumb using context-driven checked state and position animations.
Home Freeze Control
src/components/home/CardStatus.tsx
Integrates card status mutation and optimistic state to show frozen overlay, replace pay-mode toggle with unfreeze button during frozen state, and conditionally hide limit paginator.
Translations
src/i18n/es.json, src/i18n/pt.json
Adds Spanish and Portuguese strings for cancel action, freeze confirmation prompt, and temporary card pause message; removes "Unfreeze card" label.
Test Flow
.maestro/subflows/activateCard.yaml
Updates activation flow to verify freeze prompt visibility, confirm freeze action with animation wait, and retry freeze before PIN viewing.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Card as Card Component
    participant Sheet as CardFreezeSheet
    participant API as Card API
    participant CardStatus as CardStatus Component
    participant Overlay as Card Overlay

    User->>Card: Tap freeze toggle
    Card->>Card: Haptic feedback
    Card->>Sheet: Open with onConfirm callback
    Sheet->>User: Display freeze confirmation
    User->>Sheet: Tap confirm
    Sheet->>API: changeCardStatus("FROZEN")
    API->>API: Optimistic state update
    Card->>Card: Update displayStatus
    CardStatus->>CardStatus: Derive frozen flag
    Overlay->>Overlay: Show dimming + snowflake
    CardStatus->>User: Display unfreeze button
    API-->>Card: Mutation settled
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • cruzdanilo
  • franm91
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'improve freeze card ui' clearly and concisely summarizes the main objective of the pull request, which involves UI enhancements to the card freeze feature across multiple components.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch freeze

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 30, 2026

🦋 Changeset detected

Latest commit: 7082d26

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a card freeze confirmation flow, a new shared Switch component, and UI updates to display a frozen state overlay on the card. Key changes include the addition of the CardFreezeSheet component, haptic feedback on card actions, and the integration of freeze controls into the home card status view. Feedback focuses on potential layout overflow in the new Switch component, optimizing the frozen overlay structure for better performance, and ensuring smooth animation transitions for the logo when the card status changes.

Comment thread src/components/shared/Switch.tsx
Comment thread src/components/card/exa-card/CardContents.tsx
Comment on lines +114 to +121
{frozen ? null : (
<Exa
width={50}
height={20}
style={styles.exa}
{...(Platform.OS === "web" ? undefined : { shouldRasterizeIOS: true })}
/>
)}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The Exa logo is placed inside AnimatePresence but lacks animation properties (enterStyle, exitStyle). Consequently, it will abruptly appear or disappear instead of performing a smooth transition. Wrapping it in an animated View with appropriate styles will ensure a consistent user experience.

Suggested change
{frozen ? null : (
<Exa
width={50}
height={20}
style={styles.exa}
{...(Platform.OS === "web" ? undefined : { shouldRasterizeIOS: true })}
/>
)}
{frozen ? null : (
<View
key="exa-logo"
style={styles.exa}
animation="default"
enterStyle={{ opacity: 0 }}
exitStyle={{ opacity: 0 }}
>
<Exa
width={50}
height={20}
{...(Platform.OS === "web" ? undefined : { shouldRasterizeIOS: true })}
/>
</View>
)}

@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 30, 2026

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
699 1 698 1
View the top 1 failed test(s) by shortest run time
web::web
Stack Traces | 414s run time
Element not found: Text matching regex: Close

To view more test analytics, go to the Prevent Tests Dashboard

@dieguezguille
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/card/Card.tsx (1)

205-215: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Freeze/unfreeze failures are silent.

setCardStatus errors are only reported to telemetry from the call sites, so a failed freeze/unfreeze request snaps the optimistic UI back with no user-facing feedback. For a card-control action, that is easy to misread as success. Add an onError toast/haptic here and then drop the per-call .catch(reportError) handlers to avoid double-reporting. This same mutation pattern is mirrored in src/components/home/CardStatus.tsx.

💡 Suggested mutation-level handling
   const {
     mutateAsync: changeCardStatus,
     isPending: isSettingCardStatus,
     variables: optimisticCardStatus,
   } = useMutation({
     mutationKey: ["card", "status"],
     mutationFn: setCardStatus,
+    onError: (error) => {
+      reportError(error);
+      toast.show(t("An error occurred. Please try again later."), {
+        native: true,
+        duration: 1000,
+        burntOptions: { haptic: "error", preset: "error" },
+      });
+    },
     onSettled: async () => {
       await queryClient.invalidateQueries({ queryKey: ["card", "details"] });
     },
   });

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cbe1d518-1666-4e69-9670-44accbf7d070

📥 Commits

Reviewing files that changed from the base of the PR and between dfbd4de and 7082d26.

📒 Files selected for processing (14)
  • .changeset/cool-rockets-raise.md
  • .changeset/frank-snails-move.md
  • .changeset/six-breads-shout.md
  • .changeset/social-icons-retire.md
  • .changeset/spotty-rules-camp.md
  • .changeset/tangy-deer-design.md
  • .maestro/subflows/activateCard.yaml
  • src/components/card/Card.tsx
  • src/components/card/CardFreezeSheet.tsx
  • src/components/card/exa-card/CardContents.tsx
  • src/components/home/CardStatus.tsx
  • src/components/shared/Switch.tsx
  • src/i18n/es.json
  • src/i18n/pt.json

Comment on lines +14 to +18
- assertVisible: Freeze your card?
- tapOn: Freeze card
- assertNotVisible: Freeze your card?
- waitForAnimationToEnd
- tapOn: Freeze card
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Make freeze/unfreeze assertions deterministic to avoid false positives.

tapOn: Freeze card is reused for both the sheet CTA and the card row, and the second tap can be ignored if isSettingCardStatus is still true (src/components/card/Card.tsx, onPress guard). This can pass the flow without actually validating unfreeze.

Proposed flow hardening
 - assertVisible: Freeze your card?
-- tapOn: Freeze card
+- tapOn:
+    text: Freeze card
+    below: Freeze your card?
 - assertNotVisible: Freeze your card?
 - waitForAnimationToEnd
 - tapOn: Freeze card
+- waitForAnimationToEnd
+- tapOn: Freeze card
+- assertVisible: Freeze your card?
+- tapOn: Cancel
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- assertVisible: Freeze your card?
- tapOn: Freeze card
- assertNotVisible: Freeze your card?
- waitForAnimationToEnd
- tapOn: Freeze card
- assertVisible: Freeze your card?
- tapOn:
text: Freeze card
below: Freeze your card?
- assertNotVisible: Freeze your card?
- waitForAnimationToEnd
- tapOn: Freeze card
- waitForAnimationToEnd
- tapOn: Freeze card
- assertVisible: Freeze your card?
- tapOn: Cancel

Comment thread src/components/home/CardStatus.tsx
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