fix(eid-wallet): make existing eName copyable in "Identity Already Registered" dialog#1066
fix(eid-wallet): make existing eName copyable in "Identity Already Registered" dialog#1066Bekiboo wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughA new ChangesCopyable eName Component
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)
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
infrastructure/eid-wallet/src/routes/(auth)/onboarding/+page.svelte (1)
1362-1365: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMinor label wording inconsistency across dialogs.
This screen uses
label="Existing eVault eName"whileePassport/+page.svelteandKycUpgradeOverlay.svelteboth 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 winSilent 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.sveltepattern. This newcopy()only logsconsole.erroron 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 valueRemove the unused nested barrel
infrastructure/eid-wallet/src/lib/ui/CopyableEName/index.tsisn’t referenced anywhere insrc; all current uses importCopyableENamefrom$lib/ui. Delete it unless you want to support direct$lib/ui/CopyableENameimports.🤖 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
📒 Files selected for processing (6)
infrastructure/eid-wallet/src/lib/ui/CopyableEName/CopyableEName.svelteinfrastructure/eid-wallet/src/lib/ui/CopyableEName/index.tsinfrastructure/eid-wallet/src/lib/ui/index.tsinfrastructure/eid-wallet/src/routes/(app)/ePassport/+page.svelteinfrastructure/eid-wallet/src/routes/(app)/main/legacy/KycUpgradeOverlay.svelteinfrastructure/eid-wallet/src/routes/(auth)/onboarding/+page.svelte
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
How the change has been tested
tauri ios dev— copy + "Copied!" confirmed.pnpm checkclean.Change checklist
Design note
Extracted a shared
CopyableENamecomponent, 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
Bug Fixes