Skip to content

fix: minor ux changes in contacts flow#826

Merged
kushagrasarathe merged 3 commits intopeanut-wallet-devfrom
fix/contact-bugs
May 1, 2025
Merged

fix: minor ux changes in contacts flow#826
kushagrasarathe merged 3 commits intopeanut-wallet-devfrom
fix/contact-bugs

Conversation

@kushagrasarathe
Copy link
Copy Markdown
Contributor

@kushagrasarathe kushagrasarathe commented Apr 30, 2025

contributes to TASK-10790 and also fixes TASK-10924

Summary by CodeRabbit

  • New Features

    • Updated the share button in the profile header to display "Share Profile link" and use the username instead of the full URL.
    • Added dynamic verification status display across user headers and profiles based on KYC approval.
  • Style

    • Changed profile menu item background feedback from hover to active (click) state for clearer interaction cues.
  • Refactor

    • Replaced the avatar with a button featuring a chevron icon in the user search interface, allowing users to close the search portal more intuitively.
    • Enhanced username display format in user headers to show a URL path style.
    • Simplified the transaction success view by removing the transaction link and adjusting text styles for a cleaner appearance.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
peanut-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2025 6:58pm

@notion-workspace
Copy link
Copy Markdown

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 30, 2025

Walkthrough

This set of changes updates UI components related to user profiles, search functionality, and verification status display. The profile header's share button now uses the username instead of the full URL and updates its label. The profile menu item's visual feedback changes from hover to active state. The search users component replaces the avatar with badge with a chevron-up button that closes the portal. Several components including UserHeader, PublicProfile, and ProfileHeader now conditionally display verification status based on the user's KYC approval. The UserHeader component interface and display format are also updated. Additionally, transaction hash and chain ID props were removed from direct send success views, simplifying the UI.

Changes

File(s) Change Summary
src/components/Profile/components/ProfileHeader.tsx Updates share button to use username as url prop, changes label to "Share Profile link", and adjusts button size and layout.
src/components/Profile/components/ProfileMenuItem.tsx Changes card CSS class from hover:bg-grey-4 to active:bg-grey-4 for active-state visual feedback.
src/components/SearchUsers/index.tsx Removes AvatarWithBadge, replaces avatar with a chevron-up button that triggers closePortal on click.
src/app/(mobile-ui)/home/page.tsx Adds isVerified prop to UserHeader based on user's KYC status.
src/app/[...recipient]/client.tsx Updates isVerified prop passed to PublicProfile to reflect user's KYC approval status dynamically.
src/components/Profile/index.tsx Changes ProfileHeader's isVerified prop from constant true to dynamic KYC status check.
src/components/Profile/views/ProfileEdit.view.tsx Changes ProfileHeader's isVerified prop from constant true to dynamic KYC status check.
src/components/UserHeader/index.tsx Extends UserHeaderProps with optional isVerified; updates component to accept and use isVerified; changes username display to formatted URL path.
src/components/Send/direct-send/views/Initial.direct.send.view.tsx Removes txHash and chainId props passed to DirectSendSuccessView.
src/components/Send/direct-send/views/Success.direct.send.view.tsx Removes txHash and chainId props and related logic from DirectSendSuccessView; adjusts UI text styles and removes transaction link.

Possibly related PRs

Suggested reviewers

  • jjramirezn
  • Hugo0

Poem

A button now shares with a link so neat,
While menus glow when you tap, not greet.
The search shed its badge for a chevron's cheer,
Click to close—the path is clear!
Verified or not, the badges show,
Bunny hops where data flows.
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@notion-workspace
Copy link
Copy Markdown

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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ffd907 and 60f43d0.

📒 Files selected for processing (3)
  • src/components/Profile/components/ProfileHeader.tsx (1 hunks)
  • src/components/Profile/components/ProfileMenuItem.tsx (1 hunks)
  • src/components/SearchUsers/index.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/components/SearchUsers/index.tsx (2)
src/components/0_Bruddle/Button.tsx (1)
  • Button (63-91)
src/components/Global/Icons/Icon.tsx (1)
  • Icon (99-108)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Deploy-Preview
🔇 Additional comments (2)
src/components/Profile/components/ProfileMenuItem.tsx (1)

58-58: Improved interaction feedback!

Changed from hover to active state for better visual feedback when clicking a menu item. This provides more clear user interaction indication.

src/components/SearchUsers/index.tsx (1)

46-49: Improved navigation with explicit back button

Replacing the avatar with a clear back button improves usability by making the navigation action more explicit and discoverable. The chevron icon provides a familiar visual cue for "back" functionality.

The Button styling with stroke variant and the rotated chevron icon creates a standard back button pattern that users will immediately understand, enhancing the overall UX of the search interface.

Comment on lines +62 to 64
<ShareButton url={username} title="Share your profile">
Share Profile link
</ShareButton>
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.

💡 Verification agent

🧩 Analysis chain

Verify ShareButton implementation with username parameter

The change passes just the username instead of the full profileUrl to the ShareButton component. This might affect functionality if ShareButton expects a complete URL.

Also, the button text has been updated to be more action-oriented, which improves clarity for users.


🏁 Script executed:

#!/bin/bash
# Check if ShareButton component expects a full URL or just a username
rg -A 5 "ShareButton" --type ts --type tsx | grep -A 5 "url="

Length of output: 87


🏁 Script executed:

#!/bin/bash
# Locate files defining the ShareButton component
echo "Searching for ShareButton definitions..."
rg -l "export (default )?function ShareButton" -g "src/**/*.{ts,tsx}"
rg -l "const ShareButton" -g "src/**/*.{ts,tsx}"

# If found, inspect the first definition for prop types and usage
FILE=$(rg -l "export (default )?function ShareButton" -g "src/**/*.{ts,tsx}" | head -n1)
if [ -n "$FILE" ]; then
  echo "Inspecting props and usage in $FILE"
  rg -n "interface ShareButtonProps" -A10 "$FILE" || true
  rg -n "function ShareButton" -A10 "$FILE" || true
  rg -n "url:" -A5 "$FILE" || true
else
  echo "No ShareButton export found; searching all occurrences..."
  FILE=$(rg -l "ShareButton" -g "src/**/*.{ts,tsx}" | head -n1)
  echo "Inspecting first occurrence in $FILE"
  rg -n "url:" -A5 "$FILE" || true
fi

Length of output: 881


#!/bin/bash
# Inspect ShareButton implementation to determine expected url prop format
FILE="src/components/Global/ShareButton/index.tsx"
echo "Displaying top 200 lines of $FILE for context:"
sed -n '1,200p' "$FILE"

echo -e "\nSearching for url prop usage in component:"
rg -n "url[: ]" -A5 "$FILE"

#!/bin/bash
# Inspect ShareButton implementation to determine expected url prop format
FILE="src/components/Global/ShareButton/index.tsx"

echo "=== Props Interface ==="
rg -n "interface ShareButtonProps" -A5 "$FILE" || true

echo -e "\n=== Component Definition ==="
rg -n "const ShareButton" -A10 "$FILE" || true

echo -e "\n=== url Prop Usage in JSX ==="
rg -n "url=" -A3 "$FILE" || true

#!/usr/bin/env bash
# Inspect ShareButton implementation to confirm expected url prop format
FILE="src/components/Global/ShareButton/index.tsx"

echo "=== ShareButtonProps Interface ==="
rg -n "interface ShareButtonProps" -A5 "$FILE" || true

echo -e "\n=== ShareButton Component Definition ==="
rg -n -A10 "const ShareButton" "$FILE" || true

echo -e "\n=== url Prop Usage in JSX/Logic ==="
rg -n -C3 "url" "$FILE" || true

🏁 Script executed:

#!/usr/bin/env bash
# Find and inspect the ShareButton component implementation
FILE=$(rg -l "const ShareButton" -g "src/**/*.{ts,tsx}" | grep "Global/ShareButton/index.tsx" | head -n1)
if [ -z "$FILE" ]; then
  echo "ShareButton file not found."
  exit 1
fi

echo ">> Inspecting props interface in $FILE"
rg -n "interface ShareButtonProps" -A5 "$FILE" || true

echo -e "\n>> Inspecting component definition in $FILE"
rg -n "const ShareButton" -A10 "$FILE" || true

echo -e "\n>> Searching for url prop usage/transform in $FILE"
rg -n "url[:=]" -A5 "$FILE" || true

Length of output: 1548


#!/usr/bin/env bash
# Extract the ShareButton component implementation to inspect url usage
FILE="src/components/Global/ShareButton/index.tsx"
echo "=== ShareButton Component (first 300 lines) ==="
sed -n '1,300p' "$FILE"

Ensure ShareButton receives a full URL, not just the username

It looks like ShareButtonProps.url is defined as a string and used directly within the share logic, so passing only username will produce an incomplete share link. Please update the prop to use the full profile URL. For example, if you have a helper or constant like profileUrl, use:

- <ShareButton url={username} title="Share your profile">
+ <ShareButton url={profileUrl(username)} title="Share your profile">
    Share Profile link
</ShareButton>

Points to address:

  • src/components/Profile/components/ProfileHeader.tsx (Lines 62–64): replace url={username} with the complete URL.
  • Verify you’re constructing the URL consistently (e.g. using window.location.origin or a router helper).

Committable suggestion skipped: line range outside the PR's diff.

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: 0

🧹 Nitpick comments (1)
src/components/UserHeader/index.tsx (1)

32-32: Username format now displays the full profile URL path

The username display was changed to show the full URL path (without the protocol) instead of just the username. This provides more context but could potentially lead to display issues for very long usernames on smaller screens.

Consider implementing text truncation or responsive handling for long usernames:

-<div className="text-sm font-bold">{`${BASE_URL.replace('https://', '')}/${username}`}</div>
+<div className="text-sm font-bold truncate max-w-[160px]">{`${BASE_URL.replace('https://', '')}/${username}`}</div>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 60f43d0 and 90ab6f1.

📒 Files selected for processing (6)
  • src/app/(mobile-ui)/home/page.tsx (1 hunks)
  • src/app/[...recipient]/client.tsx (1 hunks)
  • src/components/Profile/components/ProfileHeader.tsx (2 hunks)
  • src/components/Profile/index.tsx (1 hunks)
  • src/components/Profile/views/ProfileEdit.view.tsx (1 hunks)
  • src/components/UserHeader/index.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/Profile/components/ProfileHeader.tsx
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/app/(mobile-ui)/home/page.tsx (1)
src/components/UserHeader/index.tsx (1)
  • UserHeader (14-37)
src/components/UserHeader/index.tsx (1)
src/components/Global/DirectSendQR/utils.ts (1)
  • BASE_URL (70-70)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Deploy-Preview
🔇 Additional comments (7)
src/components/UserHeader/index.tsx (3)

11-11: Good addition of the isVerified parameter to the interface

Adding the optional boolean parameter allows for dynamic verification status display based on the user's actual KYC status rather than using hardcoded values.


14-14: Properly updated function signature

The component parameter list has been correctly updated to accept and destructure the new isVerified prop.


26-31: Correctly passing dynamic verification status

The AvatarWithBadge component now receives the isVerified prop explicitly instead of a hardcoded value, which aligns with the updated verification status handling throughout the application.

src/components/Profile/index.tsx (1)

38-43: Correctly implemented dynamic verification status

The isVerified prop now uses a dynamic expression based on the user's KYC status rather than a hardcoded value. This ensures that the verification badge accurately reflects the user's actual verification status.

src/app/[...recipient]/client.tsx (1)

192-192: Consistent implementation of dynamic verification status

The isVerified prop is now correctly passed to the PublicProfile component based on the user's KYC status. This change maintains consistency with the verification status handling across the application.

src/components/Profile/views/ProfileEdit.view.tsx (1)

117-122: Properly implemented dynamic verification status

The ProfileHeader component now receives the isVerified prop based on the user's KYC status. This change aligns with the verification status handling updates throughout the application.

src/app/(mobile-ui)/home/page.tsx (1)

70-74: Great implementation of dynamic verification status!

The update properly passes the verification status based on the user's KYC approval status to the UserHeader component. This aligns with the broader pattern of dynamically displaying verification status across the application, improving consistency in the UI.

The optional chaining in user?.user.kycStatus provides a safe way to handle cases where the user object might not be fully loaded yet, and the check for 'approved' specifically ensures that only fully-verified users show as verified.

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: 0

🧹 Nitpick comments (1)
src/components/Send/direct-send/views/Success.direct.send.view.tsx (1)

19-40: Consider adding success state animation for better feedback.

While the UI changes improve readability, adding a subtle animation for the success state could enhance the user experience by providing more visual feedback that the transaction completed successfully.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 90ab6f1 and 2eeebd5.

📒 Files selected for processing (2)
  • src/components/Send/direct-send/views/Initial.direct.send.view.tsx (0 hunks)
  • src/components/Send/direct-send/views/Success.direct.send.view.tsx (2 hunks)
💤 Files with no reviewable changes (1)
  • src/components/Send/direct-send/views/Initial.direct.send.view.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/components/Send/direct-send/views/Success.direct.send.view.tsx (1)
src/services/users.ts (1)
  • ApiUser (10-17)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Deploy-Preview
🔇 Additional comments (5)
src/components/Send/direct-send/views/Success.direct.send.view.tsx (5)

7-7: Simple import organization change.

The getInitialsFromName utility import was either moved or added. This is properly used to generate initials from the user's name at line 17.


9-14: Props interface simplified by removing transaction-related properties.

The interface no longer includes txHash and chainId props, which aligns with the UI simplification mentioned in the PR objectives. This is a good cleanup that removes unnecessary properties.


16-16: Component signature simplified to match interface changes.

The component parameters have been updated to match the simplified interface, removing the transaction-related properties.


25-28: UI text styling updates for improved readability.

The text styling has been adjusted with more appropriate font sizes:

  1. Heading now uses a smaller text-lg size with font-bold weight
  2. Amount now uses text-3xl with font-extrabold for emphasis
  3. Message now uses text-sm with font-medium for secondary information

These adjustments create better visual hierarchy and improve the overall user experience.


32-39: Transaction link section removed to simplify the UI.

The "View transaction" link section has been completely removed, which aligns with the PR objective of simplifying the UX in the contacts flow. Users typically don't need to see transaction details in a direct send flow, so this change improves focus on the essential information.

@kushagrasarathe kushagrasarathe merged commit 0867de8 into peanut-wallet-dev May 1, 2025
5 checks passed
@Hugo0 Hugo0 deleted the fix/contact-bugs branch July 3, 2025 18:24
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