Skip to content

Conversation

iamenochlee
Copy link
Contributor

@iamenochlee iamenochlee commented Sep 29, 2025

Description and Related Issue(s)

This pull request enables the copy button for transaction hash in transaction lists by default while ensuring it is only displayed in relevant pages/tabs mostly user specific ones such as:
https://eth.blockscout.com/address/0x5AbFEc25f74Cd88437631a7731906932776356f9?tab=txs
https://eth.blockscout.com/address/0x5AbFEc25f74Cd88437631a7731906932776356f9?tab=internal_txns

Previously, users could not easily copy transaction hashes from list views, requiring them to navigate to individual transaction pages.

*Resolves #2592 *

Proposed Changes

  • Enhanced transaction hash copy functionality: Modified TxEntity.tsx and other similar TxEntityXXX.tsxcomponent to display copy buttons by default for transaction hashes, improving user experience when interacting with transaction data
  • Updated default behavior: Changed the Copy component logic to set noCopy={ props.noCopy}, making copy buttons for tx hash visible unless explicitly disabled
  • User-centric vs system-wide distinction:
    • Enabled copy buttons on user-specific pages where transaction hashes are most relevant:
      • Address transaction lists (ui/address/[0x]/txs)
      • Address internal transactions (ui/address/[0x]/internalTxs)
      • Address token transfers (ui/address/[0x]/tokenTransfers)
      • Other address-specific transaction views
    • Explicitly disabled copy buttons (noCopy prop) on system-wide pages where copy functionality may be less relevant or could clutter the interface
  • Comprehensive component updates: Modified multiple transaction entity components to adopt the new default behavior while maintaining appropriate UX for different contexts
  • Cleaned up redundant props: Removed unnecessary noCopy={false} props from user-focused components where copy buttons should now display by default
  • Updated Playwright snapshots: Refreshed visual regression test snapshots to reflect the new copy button visibility across affected components
  • Maintained UX consistency: Ensured transaction hash copy behavior is contextually appropriate - visible where users need it most (their own transaction history) and hidden where it might create interface clutter (system-wide transaction lists)

This enhancement provides a more intuitive and user-friendly approach to transaction hash copying, making the functionality available where users expect it while keeping system-wide interfaces clean and focused.

No changes were made to ENV variables.

Breaking or Incompatible Changes

No breaking changes. This is a purely additive enhancement that improves UX. The copy button can still be hidden by explicitly setting noCopy={true} if needed in specific implementations.

Additional Information

This enhancement improves user workflow by allowing direct copying of transaction hashes from list views without requiring navigation to individual transaction pages. The change maintains backward compatibility while providing better default behavior.

Checklist for PR author

  • I have tested these changes locally.
  • I added tests to cover any new functionality, following this guide
  • Whenever I fix a bug, I include a regression test to ensure that the bug does not reappear silently.
  • If I have added, changed, renamed, or removed an environment variable
    • I updated the list of environment variables in the documentation
    • I made the necessary changes to the validator script according to the guide
    • I added "ENVs" label to this pull request

@iamenochlee iamenochlee marked this pull request as ready for review September 29, 2025 12:12
@iamenochlee
Copy link
Contributor Author

iamenochlee commented Sep 29, 2025

@isstuev @tom2drum i have made the changes

@isstuev
Copy link
Collaborator

isstuev commented Oct 8, 2025

@isstuev @tom2drum i have made the changes

@iamenochlee could you please rebase to the current main branch so we can run tests and code quality workflows?

@iamenochlee iamenochlee marked this pull request as draft October 8, 2025 13:01
@iamenochlee iamenochlee force-pushed the display-copy-button-v2 branch from 36aeb06 to 034fb3d Compare October 8, 2025 16:40
@iamenochlee
Copy link
Contributor Author

@isstuev you can check it out now

@iamenochlee iamenochlee marked this pull request as ready for review October 8, 2025 16:44
@iamenochlee
Copy link
Contributor Author

all good for a merge

@iamenochlee
Copy link
Contributor Author

i see the failing tests, currently checking

@iamenochlee
Copy link
Contributor Author

@isstuev sorted!

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.

Add 'copy' button for tx hash in the lists

2 participants