Feat/copyable hash component#475
Open
DevALVIN-24 wants to merge 2 commits into
Open
Conversation
…th variants Replaces the inline style object with ActionCard.css using --credence-* tokens and adds optional padding/elevated modifier props. API stays backward compatible.
…re explorer link Truncates tx/address hashes, copies via useCopyToClipboard with an aria-live confirmation, and links to the correct Stellar explorer per the active network.
|
@DevALVIN-24 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #435
📋 Description
What this PR does:
This PR introduces a reusable
CopyableHashcomponent to unify how hashes and addresses are displayed and interacted with across the application. Previously, hashes were truncated, copied, and linked inconsistently depending on the surface. This component provides a single, consistent approach:head…tail).useCopyToClipboardhook with visual feedback and anaria-live="polite"region to inform screen-reader users of copy actions (or failures).SettingsContextto provide a network-aware link to the appropriate Stellar explorer (mainnet or testnet).addressDisplaypreference when dealing with addresses, honoring their display choices seamlessly.This PR also updates the
ActivityTimelineto use this new component for rendering transaction metadata.Why it matters:
A single
CopyableHashcomponent ensures that our hashes look identical across all surfaces, while also centralizing and resolving several accessibility requirements around copy buttons and status announcements. This leads to a significantly better experience for users.🎯 Changes & Features
CopyableHash.tsxandCopyableHash.css.txandaddresskinds.SettingsContextnetworkstate.addressDisplaysettings for flexible truncation.prefers-reduced-motion.CopyableHashintoActivityTimelinereplacing the old static string rendering.SettingsContext, link resolution, and copy success/failure states.✅ Acceptance Criteria
CopyableHashcomponent + CSS implemented.SettingsContext.I have noticed that several tests in the main test suite are currently failing due to pre-existing mismatches between the test expectations and the actual components (for instance,
ActivityTimelinerenders "No activity yet" while theTrustScoretests are asserting for "No recent activity"). Additionally, there are existing lint errors scattered throughout the codebase.My specific tests for
CopyableHashpassed successfully, and the component fulfills all of your requirements. Since I've already pushed the branch and provided the PR description, please let me know if you would like me to proceed with fixing the existing test and lint issues across the rest of the project, or if we can consider this task complete!