Skip to content

fix: update messaging in MigrationZeroBalanceModal for clarity and us…#380

Merged
onahprosper merged 4 commits intomainfrom
update-migration-zero-balance-modal-copy
Feb 23, 2026
Merged

fix: update messaging in MigrationZeroBalanceModal for clarity and us…#380
onahprosper merged 4 commits intomainfrom
update-migration-zero-balance-modal-copy

Conversation

@sundayonah
Copy link
Copy Markdown
Collaborator

@sundayonah sundayonah commented Feb 23, 2026

Description

This PR updates Noblocks wallet logic so that users without a smart account (e.g. after smart wallet creation is disabled in Privy) are consistently treated as EOA-only: the app uses and displays their embedded wallet (EOA) for nav, balance, and actions, and they never see any migration flow (banner or zero-balance modal).

Background: With smart wallet creation disabled in Privy, new users only receive an embedded EOA. The app should treat "no smart account" as "use EOA only" and not show migration UI. Existing users who already have a smart wallet continue to see the migration flow and behaviour unchanged.

Changes in app/hooks/useEIP7702Account.ts (useShouldUseEOA):

  1. No smart account → use EOA: When the user has no smart wallet in Privy (!hasSmartWallet), the hook now returns true (use EOA) instead of false, so EOA-only users get the correct experience.
  2. Single ready guard: When user == null (Privy still initialising), the hook returns lastValueRef.current ?? false without updating the ref. This avoids corrupting lastValueRef during init and prevents SCW users from briefly being treated as EOA until balances load. It also centralises init-phase handling in one place.
  3. Simplified !hasSmartWallet block: Because the rest of the hook runs only when user != null, the inner if (user != null) was removed; when !hasSmartWallet, we set lastValueRef.current = true and return true.

Impact:

  • Users with a smart account: Unchanged. They still follow the same migration-status and balance logic; migration banner, zero-balance modal, and migration flow behave as before. Init-phase flicker for SCW users is fixed by the ready guard.
  • Users without a smart account: They consistently use EOA only and never see migration UI (the existing early return in useWalletMigrationStatus already prevented banner/modal for this case).

Breaking changes: None.

Alternatives considered: Using a DB "user first seen" table to distinguish new vs existing was discussed; this approach relies on Privy configuration (disable smart wallet creation for new users) and a single code path: "no smart account → EOA only," with no new backend or schema.

References

No issue or external references.

Testing

  • Manual – EOA-only (new user): Log in as a user with no smart wallet in Privy (or an account created after disabling smart wallet creation). Confirm: (1) No migration banner or zero-balance modal; (2) Nav and balance show the embedded (EOA) address; (3) Create order / transfer use the EOA.

  • Manual – SCW (existing user): Log in as a user with a smart wallet. Confirm: migration banner / zero-balance modal and migration flow behave as before; after migration or with zero SCW balance, EOA is used; no brief EOA flicker during initial load (ready guard).

  • Regression: Refresh as both EOA-only and SCW users; confirm no console errors and that wallet/balance UI remains correct after load.

  • Environment: Node / Next.js; standard Noblocks setup.

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation and tests for new/changed functionality in this PR
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not main

By submitting a PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.

Summary by CodeRabbit

  • Documentation
    • Updated modal messaging: header now reads "One wallet - Import anywhere" and body clarifies the wallet is "successfully set up and is compatible with other on‑chain apps."
    • Adjusted note paragraph formatting and punctuation for clearer presentation. No functional behavior or APIs changed.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 23, 2026

📝 Walkthrough

Walkthrough

Updated UI copy in app/components/MigrationZeroBalanceModal.tsx: header changed to "One wallet - Import anywhere" and body text now states the wallet is set up and compatible with other on-chain apps. No functional, flow, or API changes.

Changes

Cohort / File(s) Summary
Modal Copy Update
app/components/MigrationZeroBalanceModal.tsx
Adjusted header text to "One wallet - Import anywhere" and revised body/note paragraphs to state the wallet is successfully set up and compatible with other on-chain apps. No logic, handlers, or API changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • chibie
  • 5ran6
  • onahprosper

Poem

🐰 I hopped into a modal bright,
I nudged its words to sound just right.
"One wallet — import anywhere" I cheer,
Share with ease, the path is clear. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: updating messaging in MigrationZeroBalanceModal for clarity.
Description check ✅ Passed The description is comprehensive with clear sections covering purpose, background, specific changes, impact, testing, and checklists aligned with the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-migration-zero-balance-modal-copy

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 and usage tips.

Copy link
Copy Markdown
Contributor

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/components/MigrationZeroBalanceModal.tsx`:
- Around line 171-173: Update the ambiguous copy in the
MigrationZeroBalanceModal component: replace "the latest one" in the paragraph
JSX (inside MigrationZeroBalanceModal) with an explicit reference to the new
embedded-wallet address (for example: "your new embedded-wallet address (the
current address displayed in this app)") so users migrating from a
smart-contract wallet know to use the newly generated/embedded wallet address
rather than their old SCW address.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 858c1c3 and 6f06fb9.

📒 Files selected for processing (1)
  • app/components/MigrationZeroBalanceModal.tsx

Comment thread app/components/MigrationZeroBalanceModal.tsx Outdated
Copy link
Copy Markdown
Collaborator

@Dprof-in-tech Dprof-in-tech left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@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.

♻️ Duplicate comments (1)
app/components/MigrationZeroBalanceModal.tsx (1)

171-172: Note copy now resolves the previously flagged ambiguity.

"your new wallet address" is unambiguous — users migrating from a smart-contract wallet clearly understand which address to update. This addresses the concern raised in the prior review about "the latest one."

The trailing blank line at Line 172 (before </p>) can also be cleaned up alongside the one at Line 162.

✏️ Remove trailing blank line
                                                    Note: If you've saved or shared your wallet address elsewhere, make sure to update it to your new wallet address.
-
                                                </p>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/components/MigrationZeroBalanceModal.tsx` around lines 171 - 172, Remove
the unnecessary trailing blank lines in the JSX markup within
MigrationZeroBalanceModal: delete the empty lines after the paragraph blocks
(the stray blank lines currently at the ends of the <p> elements referenced
around lines where the note "Note: If you've saved or shared your wallet address
elsewhere..." appears and the earlier paragraph near line 162) so the JSX has no
empty lines before the closing </p> tags in the MigrationZeroBalanceModal
component.
🧹 Nitpick comments (1)
app/components/MigrationZeroBalanceModal.tsx (1)

155-164: Header and body copy look good.

The updated heading and body message are clear and accurately describe the wallet's state post-migration.

The extra blank line at Line 162 (between the last JSX prop and >) is a harmless artifact but slightly noisy in the diff — consider removing it.

✏️ Remove extra blank line
                                                <p
                                                    className="font-[Inter] text-sm font-light leading-5 tracking-normal text-text-body dark:text-[`#FFFFFFCC`]"
-
                                                >
                                                    Your wallet has been successfully set up and is compatible with other on-chain apps.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/components/MigrationZeroBalanceModal.tsx` around lines 155 - 164, In
MigrationZeroBalanceModal (the JSX paragraph element inside the rounded-[20px]
container), remove the extra blank line between the last prop of the <p> tag and
its closing '>' so the opening tag is on one continuous block (i.e., collapse
the stray newline before '>') to clean up the JSX formatting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@app/components/MigrationZeroBalanceModal.tsx`:
- Around line 171-172: Remove the unnecessary trailing blank lines in the JSX
markup within MigrationZeroBalanceModal: delete the empty lines after the
paragraph blocks (the stray blank lines currently at the ends of the <p>
elements referenced around lines where the note "Note: If you've saved or shared
your wallet address elsewhere..." appears and the earlier paragraph near line
162) so the JSX has no empty lines before the closing </p> tags in the
MigrationZeroBalanceModal component.

---

Nitpick comments:
In `@app/components/MigrationZeroBalanceModal.tsx`:
- Around line 155-164: In MigrationZeroBalanceModal (the JSX paragraph element
inside the rounded-[20px] container), remove the extra blank line between the
last prop of the <p> tag and its closing '>' so the opening tag is on one
continuous block (i.e., collapse the stray newline before '>') to clean up the
JSX formatting.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 817b75a and b10ed1c.

📒 Files selected for processing (1)
  • app/components/MigrationZeroBalanceModal.tsx

Copy link
Copy Markdown
Collaborator

@Dprof-in-tech Dprof-in-tech left a comment

Choose a reason for hiding this comment

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

LGTM!

@onahprosper onahprosper merged commit de39188 into main Feb 23, 2026
1 check passed
@onahprosper onahprosper deleted the update-migration-zero-balance-modal-copy branch February 23, 2026 17:36
@coderabbitai coderabbitai bot mentioned this pull request Mar 4, 2026
4 tasks
@coderabbitai coderabbitai bot mentioned this pull request Apr 8, 2026
4 tasks
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.

3 participants