INJIWEB-1681 Added the user profile and name to avoid confusion in passcode screen#495
INJIWEB-1681 Added the user profile and name to avoid confusion in passcode screen#495iamlokanath wants to merge 2 commits intoinji:developfrom
Conversation
…sscode screen Signed-off-by: Lkanath Panda <lokanthpanda128@gmai.com>
WalkthroughAdds optional user profile rendering to the PasscodePage template and extends PasscodePage with wallet state, multi-status handling, and improved error flows; the useUser hook now returns user data consumed by the template. (50 words) Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant P as PasscodePage (UI)
participant A as Wallet API
participant H as useUser Hook
participant T as PasscodePageTemplate
U->>P: Enter passcode / submit
P->>A: call unlockWallet/createWallet (passcode, walletPin)
activate A
A-->>P: reply (success or status/error)
deactivate A
alt unlock/create success
P->>H: request user & saveWalletId
H-->>P: returns user + saveWalletId
P->>T: render with user prop
T-->>U: display profile (picture or initials + name)
else wallet status (PERMANENTLY_LOCKED / LAST_ATTEMPT...)
P->>P: set status UI (disable unlock, show messages)
P->>P: reset passcode inputs as needed
else network / HTTP error
P->>P: handleCommonErrors -> set error state and feedback
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@inji-web/src/components/PageTemplate/PasscodePage/PasscodePageTemplate.tsx`:
- Around line 42-65: Update the accessible labeling for the profile
picture/initials in PasscodePageTemplate: for the <img> element (class
userProfilePicture) set a descriptive alt that includes the user's displayName
(e.g., "<displayName>’s profile picture") with a safe fallback when displayName
is missing, and for the initials container (class userProfileInitials) add
role="img" and an aria-label that likewise contains the user's name (or a
fallback like "User profile") so screen readers announce the initials as the
user's profile image; ensure conversions/usage rely on
convertStringIntoPascalCase(user.displayName) or a safe null/empty check to
build the labels.
inji-web/src/components/PageTemplate/PasscodePage/PasscodePageTemplate.tsx
Show resolved
Hide resolved
|
@iamlokanath please address coderabbit comments and unit test failures @sanchi-singh24 please confirm on the UI design for the enhancement. |
|
Signed-off-by: Lkanath Panda <lokanathpanda128@gmail.com>



Changes Made:
Get user information from the useUser hook
Pass the user object to PasscodePageTemplate
Accept an optional user prop
Display user profile picture (or initials if no picture)
Display user name in PascalCase
Show the profile above the title
User profile container
Profile picture (circular with border)
Profile initials fallback
User name text styling
Demo Video : https://github.com/user-attachments/assets/ee2606fb-4e3d-4a8a-8c36-f3abf661953c
Summary by CodeRabbit
New Features
Bug Fixes
Style
Tests
✏️ Tip: You can customize this high-level summary in your review settings.