Skip to content

fix(eid-wallet): make existing eName copyable in "Identity Already Registered" dialog#1066

Open
Bekiboo wants to merge 1 commit into
mainfrom
fix/eid-wallet-copyable-ename-on-duplicate-dialog
Open

fix(eid-wallet): make existing eName copyable in "Identity Already Registered" dialog#1066
Bekiboo wants to merge 1 commit into
mainfrom
fix/eid-wallet-copyable-ename-on-duplicate-dialog

Conversation

@Bekiboo

@Bekiboo Bekiboo commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Description of change

Makes the existing eVault eName copyable in the "Identity Already Registered" dialog — copy icon + inline "Copied!" feedback, same affordance as the home-screen eName. Users can now grab the eName to recover their eVault instead of hand-typing a UUID.

Issue Number

Closes #1061

Type of change

  • Fix (a change which fixes an issue)

How the change has been tested

  • iOS 26.5 simulator (iPhone 17 Pro) via tauri ios dev — copy + "Copied!" confirmed.
  • pnpm check clean.

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Design note

Extracted a shared CopyableEName component, used in all three dialogs that surface the eName (ePassport, legacy KycUpgradeOverlay, onboarding), so the behaviour is identical everywhere and the duplicated markup is gone.

Summary by CodeRabbit

  • New Features

    • Added a reusable eName display component with a copy-to-clipboard action and a brief “Copied!” confirmation.
    • Standardized eName presentation in duplicate-identity and KYC upgrade screens across the app.
  • Bug Fixes

    • Improved clipboard copy handling with error logging and cleanup after temporary status messages.

@Bekiboo Bekiboo self-assigned this Jul 1, 2026
@Bekiboo Bekiboo requested a review from coodos as a code owner July 1, 2026 06:57
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

A new CopyableEName Svelte component is added with clipboard-copy functionality and a temporary "Copied!" confirmation state, exported via component and UI barrel index files. Three route files (ePassport, KycUpgradeOverlay, onboarding) are updated to use this component in place of previous inline eName display markup.

Changes

Copyable eName Component

Layer / File(s) Summary
CopyableEName component and exports
infrastructure/eid-wallet/src/lib/ui/CopyableEName/CopyableEName.svelte, infrastructure/eid-wallet/src/lib/ui/CopyableEName/index.ts, infrastructure/eid-wallet/src/lib/ui/index.ts
New component with ename/label props, clipboard copy via navigator.clipboard.writeText, 2s "Copied!" confirmation with timeout cleanup on destroy, and error logging on failure; exported as default and via UI barrel.
Adoption in duplicate eName screens
infrastructure/eid-wallet/src/routes/(app)/ePassport/+page.svelte, infrastructure/eid-wallet/src/routes/(app)/main/legacy/KycUpgradeOverlay.svelte, infrastructure/eid-wallet/src/routes/(auth)/onboarding/+page.svelte
Each file imports CopyableEName and replaces inline eName display markup in duplicate-identity states with CopyableEName passing the respective eName value and a label.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CopyableEName
  participant ClipboardAPI

  User->>CopyableEName: click copy button
  CopyableEName->>ClipboardAPI: navigator.clipboard.writeText(ename)
  ClipboardAPI-->>CopyableEName: success or error
  CopyableEName-->>User: show "Copied!" for 2s (or log error)
Loading

Suggested reviewers: coodos

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The PR description matches the required template and includes the change, issue number, type, testing, and checklist sections.
Linked Issues check ✅ Passed The changes add a copyable eName component and apply it to the Identity Already Registered flow, satisfying #1061's copy-to-clipboard requirement.
Out of Scope Changes check ✅ Passed The shared component extraction and reuse across related eName dialogs stays aligned with the stated objective and is not unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly matches the main change: making the existing eName copyable in the Identity Already Registered dialog.
✨ 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 fix/eid-wallet-copyable-ename-on-duplicate-dialog

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
infrastructure/eid-wallet/src/routes/(auth)/onboarding/+page.svelte (1)

1362-1365: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Minor label wording inconsistency across dialogs.

This screen uses label="Existing eVault eName" while ePassport/+page.svelte and KycUpgradeOverlay.svelte both use "Your existing eVault eName". Not functionally significant, but worth aligning wording for consistency across the three duplicate-identity dialogs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@infrastructure/eid-wallet/src/routes/`(auth)/onboarding/+page.svelte around
lines 1362 - 1365, The duplicate-identity dialog label in CopyableEName is
inconsistent with the same UI used in ePassport/+page.svelte and
KycUpgradeOverlay.svelte. Update the label in the onboarding page’s
CopyableEName usage to match the shared wording “Your existing eVault eName” so
the three dialogs stay consistent.
infrastructure/eid-wallet/src/lib/ui/CopyableEName/CopyableEName.svelte (1)

22-33: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Silent failure on copy error — no user feedback.

Defines an async eName copy handler using navigator.clipboard.writeText inside try/catch and reports success/failure via a toast callback. in the established ENameCard.svelte pattern. This new copy() only logs console.error on failure — the user sees no indication the copy didn't work (the "Copied!" confirmation simply never appears, which is indistinguishable from a slow UI). Since this component is explicitly used in "Identity Already Registered" recovery flows where accuracy matters, a silent failure could leave users unable to recover their eVault without knowing why.

Consider surfacing failure state (e.g., a brief inline "Couldn't copy" message using the same copied-style pattern) rather than only logging to console.

💡 Proposed fix
 let copied = $state(false);
+let copyFailed = $state(false);
 let resetTimer: ReturnType<typeof setTimeout> | undefined;

 async function copy() {
     try {
         await navigator.clipboard.writeText(ename);
         copied = true;
+        copyFailed = false;
         clearTimeout(resetTimer);
         resetTimer = setTimeout(() => {
             copied = false;
         }, 2000);
     } catch (error) {
         console.error("Failed to copy eName:", error);
+        copyFailed = true;
+        clearTimeout(resetTimer);
+        resetTimer = setTimeout(() => {
+            copyFailed = false;
+        }, 2000);
     }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@infrastructure/eid-wallet/src/lib/ui/CopyableEName/CopyableEName.svelte`
around lines 22 - 33, The CopyableEName copy handler only logs clipboard
failures, so users get no visible feedback when `navigator.clipboard.writeText`
fails. Update `copy()` in `CopyableEName.svelte` to surface a user-facing
failure state, following the `ENameCard.svelte` toast/feedback pattern or an
inline message similar to the existing `copied` flag, and clear it after a short
timeout so the UI clearly distinguishes success from failure.
infrastructure/eid-wallet/src/lib/ui/CopyableEName/index.ts (1)

1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the unused nested barrel

infrastructure/eid-wallet/src/lib/ui/CopyableEName/index.ts isn’t referenced anywhere in src; all current uses import CopyableEName from $lib/ui. Delete it unless you want to support direct $lib/ui/CopyableEName imports.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@infrastructure/eid-wallet/src/lib/ui/CopyableEName/index.ts` at line 1, The
nested barrel at CopyableEName/index.ts is unused and should be removed unless
you intentionally want to support direct $lib/ui/CopyableEName imports. Delete
the re-export from CopyableEName/index.ts and make sure all references continue
to use the existing $lib/ui entrypoint or the Svelte component directly, so
there is no orphaned barrel left behind.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@infrastructure/eid-wallet/src/lib/ui/CopyableEName/CopyableEName.svelte`:
- Around line 22-33: The CopyableEName copy handler only logs clipboard
failures, so users get no visible feedback when `navigator.clipboard.writeText`
fails. Update `copy()` in `CopyableEName.svelte` to surface a user-facing
failure state, following the `ENameCard.svelte` toast/feedback pattern or an
inline message similar to the existing `copied` flag, and clear it after a short
timeout so the UI clearly distinguishes success from failure.

In `@infrastructure/eid-wallet/src/lib/ui/CopyableEName/index.ts`:
- Line 1: The nested barrel at CopyableEName/index.ts is unused and should be
removed unless you intentionally want to support direct $lib/ui/CopyableEName
imports. Delete the re-export from CopyableEName/index.ts and make sure all
references continue to use the existing $lib/ui entrypoint or the Svelte
component directly, so there is no orphaned barrel left behind.

In `@infrastructure/eid-wallet/src/routes/`(auth)/onboarding/+page.svelte:
- Around line 1362-1365: The duplicate-identity dialog label in CopyableEName is
inconsistent with the same UI used in ePassport/+page.svelte and
KycUpgradeOverlay.svelte. Update the label in the onboarding page’s
CopyableEName usage to match the shared wording “Your existing eVault eName” so
the three dialogs stay consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6e02b3b4-c9fb-41b5-afc1-4a82257f16f0

📥 Commits

Reviewing files that changed from the base of the PR and between c6f8c3e and b53bca4.

📒 Files selected for processing (6)
  • infrastructure/eid-wallet/src/lib/ui/CopyableEName/CopyableEName.svelte
  • infrastructure/eid-wallet/src/lib/ui/CopyableEName/index.ts
  • infrastructure/eid-wallet/src/lib/ui/index.ts
  • infrastructure/eid-wallet/src/routes/(app)/ePassport/+page.svelte
  • infrastructure/eid-wallet/src/routes/(app)/main/legacy/KycUpgradeOverlay.svelte
  • infrastructure/eid-wallet/src/routes/(auth)/onboarding/+page.svelte

@Bekiboo Bekiboo changed the title make existing eName copyable in "Identity Already Registered" dialog fix(eid-wallet): make existing eName copyable in "Identity Already Registered" dialog Jul 1, 2026
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.

eVault eName not copyable on "Identity Already Registered" dialog after re-verification

1 participant