Skip to content

feat: add copy address functionality#2690

Merged
CharlVS merged 18 commits intodevfrom
ux/copy-address
Jun 20, 2025
Merged

feat: add copy address functionality#2690
CharlVS merged 18 commits intodevfrom
ux/copy-address

Conversation

@smk762
Copy link
Copy Markdown
Collaborator

@smk762 smk762 commented May 23, 2025

Closes #2582

🚀 New Features

Copy Address Functionality

  • Added copy address buttons to receive modals
    • Copy button now available in QR code dialogs
    • One-click address copying with visual feedback
    • Custom toast messages for different address types

Enhanced Copy Toast System

  • Improved clipboard feedback mechanism
    • Custom toast messages for specific copy actions
    • Overlay-based toasts that appear above modals and dialogs
    • Professional styling with success indicators

Copy Function Parameter Enhancement

  • Simplified copyToClipBoard function signature
    • After: Optional parameter with default value for toast message
    • Impact: Cleaner code, better developer experience

🎨 UI/UX Improvements

Mobile Responsive Design

  • Better address text handling
    • No more horizontal overflow on narrow screens
    • Consistent middle ellipsis for crypto addresses
    • Improved readability with beginning/end address visibility

Professional Toast Styling

  • Enhanced copy feedback
    • Success icon with checkmark
    • Professional Material Design styling
    • Auto-dismissing after 2 seconds
    • High elevation to appear above all content

✅ QA TEST CHECKLIST

🔍 Priority 1: Critical Functionality

Copy Address Functionality

  • Test copy address in receive modal
    • Open receive modal for any coin
    • Click copy button next to address
    • Verify toast appears with success message
    • Paste clipboard content - should match displayed address
    • Test on web, desktop and mobile

🔍 Priority 2: UI/UX Validation

Address Text Display

  • Mobile address overflow testing
    • Test on mobile screen sizes (390px, 375px, 320px)
    • Verify addresses show middle ellipsis format
    • Example: 0x1234...abcd not 0x1234567...
    • Check in QR dialogs specifically

QR Code Dialogs

  • Test QR code modal address display
    • Click QR button next to any address
    • Verify address text uses middle truncation
    • Verify copy button works in dialog
    • Check on different screen sizes

Toast/Snackbar Behavior

  • Copy feedback validation
    • Toast appears above ALL content (including dialogs)
    • Toast auto-dismisses after 2 seconds
    • Toast shows success checkmark icon
    • Toast message is contextual (e.g., "Copied BTC address")

🔍 Priority 3: Edge Cases

Long Addresses

  • Test with various address types
    • Bitcoin addresses (legacy, segwit)
    • Ethereum addresses (0x...)
    • Long token contract addresses
    • Verify all use middle ellipsis where overflowing otherwise

Error Scenarios

  • Clipboard permission testing
    • Test in browsers with clipboard restrictions
    • Verify graceful fallback behavior
    • Check error handling in console

Performance

  • Copy operation performance
    • Rapid clicking copy button
    • Multiple copy operations in sequence
    • Memory usage during toast operations

🔍 Priority 4: Regression Testing

Existing Functionality

  • Wallet operations still work
    • Send transactions
    • Receive functionality
    • Balance display
    • Transaction history

Address Management

  • Address selection still works
    • Dropdown address selection
    • Address generation
    • Multi-address wallets

🚨 Known Issues / Considerations

  1. Browser Compatibility: Some older browsers may have clipboard API limitations
  2. Mobile PWA: Copy functionality may behave differently in PWA vs browser
  3. Performance: Toast overlay operations should be monitored for memory usage

📊 Success Criteria

  • ✅ All address copying works without errors
  • ✅ No compilation or runtime errors in console
  • ✅ Mobile address display properly truncated
  • ✅ Professional copy feedback on all platforms
  • ✅ No regression in existing wallet features

- add address text to receive modal
- add copy address button to receive modal
- add explorer link button to receive modal
- add translation for 'explorerUnavailable'
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 23, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.

@smk762 smk762 linked an issue May 23, 2025 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 23, 2025

Visit the preview URL for this PR (updated for commit c9def8f):

https://walletrc--pull-2690-merge-3jagu22u.web.app

(expires Fri, 27 Jun 2025 17:44:21 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc

Copy link
Copy Markdown
Collaborator

@CharlVS CharlVS left a comment

Choose a reason for hiding this comment

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

TYSM. Will have a closer look during office hours, but the one thing that stands out is that you should always reference theme values instead of hard-coded values since it ensures consistency/accessibility.

@ShantanuSharma9873
Copy link
Copy Markdown

Functionality-wise, everything is working fine. However, the following observations were noted:

Highlight Placement: When clicking the Copy button, the highlight appears from behind the button's bar instead of on the button itself. This looks slightly misaligned and visually inconsistent.

Message Visibility: Upon clicking the Copy button, the "Copied to Clipboard" message appears at the bottom-left corner, which lies in a blurred/dark zone. It would be better if the message is displayed more prominently for better visibility.

Multiple Click Behavior: If the Copy button is clicked multiple times in quick succession, the "Copied to Clipboard" message appears repeatedly even after the Receive Coin tab is closed. A suggestion would be to implement a cooldown or timer to limit repeated message display

Attachment:
https://github.com/user-attachments/assets/4281a1f0-8a9d-49ec-aef6-726ab4ae0eab

Copy link
Copy Markdown

@AndrewDelaney AndrewDelaney left a comment

Choose a reason for hiding this comment

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

I ran into the same issues @ShantanuSharma9873 mentioned above. Functionally everything works well, just the UX items that should be fixed.

Additionally, on mobile screen sizes, the address gets cut off. I don't necessarilly think this is an issue, but figured it'd be best to make note of it in any case. One cannot manually scroll to view the end of the address. Then again, I don't think there are many cases where one needs to be able to do that when they can just press the copy button.

@CharlVS CharlVS added the QA Ready for QA Testing label May 29, 2025
@CharlVS
Copy link
Copy Markdown
Collaborator

CharlVS commented May 29, 2025

@smk762 please tag me when QA gives their stamp of approval.

@smk762 smk762 requested a review from AndrewDelaney June 1, 2025 09:42
Copy link
Copy Markdown

@AndrewDelaney AndrewDelaney left a comment

Choose a reason for hiding this comment

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

Nice! All seems to be working well.

Copy link
Copy Markdown

@ShantanuSharma9873 ShantanuSharma9873 left a comment

Choose a reason for hiding this comment

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

The functionality works fine, nothing major. Although, one UI related issue was observed where the Address dropdown remains stuck on the screen on scrolling the page down.

Attachment:
https://github.com/user-attachments/assets/e630a5f0-00f9-4cb4-bc4c-c2eb03e913ab

@smk762
Copy link
Copy Markdown
Collaborator Author

smk762 commented Jun 3, 2025

The functionality works fine, nothing major. Although, one UI related issue was observed where the Address dropdown remains stuck on the screen on scrolling the page down.

Attachment: https://github.com/user-attachments/assets/e630a5f0-00f9-4cb4-bc4c-c2eb03e913ab

Please create a new issue for this.

Copy link
Copy Markdown
Contributor

@takenagain takenagain left a comment

Choose a reason for hiding this comment

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

Thank you, @smk762! LGTM overall, apart from the one style issue in lib/shared/utils/utils.dart.

Could you (or our benevolent AI overlords) also please run dart format on the modified files? E.g. dart format lib/shared/utils/utils.dart

Comment thread lib/shared/utils/utils.dart Outdated
Comment thread lib/shared/utils/utils.dart Outdated
Comment thread lib/views/wallet/coin_details/coin_details_info/coin_addresses.dart Outdated
Comment thread lib/views/wallet/coin_details/coin_details_info/coin_addresses.dart Outdated
@smk762 smk762 requested review from CharlVS and takenagain June 11, 2025 10:37
@smk762
Copy link
Copy Markdown
Collaborator Author

smk762 commented Jun 11, 2025

Thank you, @smk762! LGTM overall, apart from the one style issue in lib/shared/utils/utils.dart.

Could you (or our benevolent AI overlords) also please run dart format on the modified files? E.g. dart format lib/shared/utils/utils.dart

Thanks for the feedback! I've updated the colors, and formatted the files. AI helped with the async, but lacked the return so I added that. Ready for re-review.

takenagain
takenagain previously approved these changes Jun 12, 2025
Copy link
Copy Markdown
Contributor

@takenagain takenagain left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Could we remove the duplicate import before merging? Otherwise, it can be included in the clean-up of the existing flutter analyze issues at a later stage.

Comment thread lib/shared/utils/utils.dart Outdated
Co-authored-by: Francois <takenagain@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@CharlVS CharlVS left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution. Congrats on your first major contribution to KW's codebase!

I've made some minor changes as discussed. Prefer using Flutter's built-in widgets/systems where possible.

My changes also make the styling for the copy confirmation consistent with other places using Flutter snackbars (most popups/toasts/snackbars are custom non-Flutter tho)

@CharlVS CharlVS merged commit a63c71f into dev Jun 20, 2025
9 of 13 checks passed
@CharlVS CharlVS deleted the ux/copy-address branch June 20, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA Ready for QA Testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve address copy UX

5 participants