Standardize on-chain identifiers, copy actions, and explorer links - #276
Merged
Caneryy merged 2 commits intoAug 30, 2026
Merged
Conversation
Introduce one OnChainIdentifier component to standardize how wallet addresses, contract IDs, transaction hashes, and proposal IDs are truncated, copied, and linked to the explorer, then migrate the Community detail page, CommunityDeploymentPanel, ProposalSummaryCard, proposal detail page, and CommunityCard onto it. - Add buildStellarExplorerAccountUrl to stellarExplorer.ts so G-address owners/proposers can link out like contracts and transactions already do. - Copy feedback now goes through a stable aria-live region so a successful/failed copy never changes the button's accessible name (the previous proposer "Copy"/"Copied!" toggle did).
|
@ZeePearl56 is attempting to deploy a commit to the caneryy's projects Team on Vercel. A member of the Team first needs to authorize it. |
Reconcile OnChainIdentifier changes with merged async-state and community registry updates on main. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Closes #253.
Adds one shared
OnChainIdentifiercomponent (apps/web/src/components/ui/OnChainIdentifier.tsx) and migrates the identified consumers onto it, so wallet addresses, contract IDs, transaction hashes, and proposal IDs get the same truncation, copy, and explorer behavior everywhere instead of each screen reimplementing it slightly differently.OnChainIdentifiercomposes the existingtruncateMiddlehelper and thestellarExplorerURL builders. It takes akind(contract|tx|account|opaque) that decides whether/which explorer link to render, truncates the value deterministically with the full value exposed viatitle, and exposes a copy button whose accessible name never changes on copy — success/failure is announced through aLiveStatuslive region instead, fixing the "Copy" → "Copied!" accessible-name change that existed on the proposal detail page.stellarExplorer.ts: addedbuildStellarExplorerAccountUrl(validatesG...account addresses) since onlytxandcontractentity types had explorer support before. Proposer and community-owner addresses can now link to the explorer for the active network like contracts already do.communities/[id]/page.tsx): NFT/Governor contract chips and the community owner address.CommunityDeploymentPanel: the post-deployment NFT/Governor contract chips (previously rendered the full untruncated ID withbreak-all, inconsistent with every other consumer).proposals/[id]/page.tsx): the proposal ID chip and the proposer address (this is where the accessible-name-changing copy button lived).ProposalSummaryCard: replaced the ad hoconCopyIdcallback prop with an internal copy-onlyOnChainIdentifier(kindopaque,hideValue), removing three separate inlinenavigator.clipboard.writeTextcall sites in the proposals list pages.CommunityCard: the community ID display.<Link>(e.g.CommunityProposalsView's#idspan) were left as plain truncated text — nestingOnChainIdentifier's button inside an anchor would create nested interactive controls, which is its own a11y issue. Good candidate for a follow-up if those rows get dedicated copy/explorer affordances.Test plan
npm run lint— no new errors introduced by this change (two pre-existingreact-hooks/set-state-in-effecterrors inproposals/page.tsxreproduce identically onmain)npm run typecheck— no new errors (five pre-existing errors unrelated to this change reproduce identically onmain)npm run test:web— newOnChainIdentifierandstellarExploreraccount-URL tests pass; updatedCommunityDetailPage,ProposalSummaryCardtests pass; full suite has the same pre-existing failures onmain(unrelatedvoteAggregation/stellarmock setup issues), none introduced by this changenpm run test:e2e:ci— not run in this environment (Playwright); no e2e specs reference the markup strings that changed here (verified via grep for the old "Copy address"/"Copied!"/"Open explorer" labels)New/updated tests cover: deterministic truncation with the full value in
title, the copy button's accessible name staying stable across success and failure, explorer links resolving correctly perkind/network (contract/account/tx), and no explorer link for invalid values oropaquekind (e.g. proposal IDs).