Skip to content

Standardize on-chain identifiers, copy actions, and explorer links - #276

Merged
Caneryy merged 2 commits into
stolla-labs:mainfrom
Hollujay:feature/253-onchain-identifier-component
Aug 30, 2026
Merged

Standardize on-chain identifiers, copy actions, and explorer links#276
Caneryy merged 2 commits into
stolla-labs:mainfrom
Hollujay:feature/253-onchain-identifier-component

Conversation

@Hollujay

Copy link
Copy Markdown

Summary

Closes #253.

Adds one shared OnChainIdentifier component (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.

  • New component: OnChainIdentifier composes the existing truncateMiddle helper and the stellarExplorer URL builders. It takes a kind (contract | tx | account | opaque) that decides whether/which explorer link to render, truncates the value deterministically with the full value exposed via title, and exposes a copy button whose accessible name never changes on copy — success/failure is announced through a LiveStatus live region instead, fixing the "Copy" → "Copied!" accessible-name change that existed on the proposal detail page.
  • Extended stellarExplorer.ts: added buildStellarExplorerAccountUrl (validates G... account addresses) since only tx and contract entity types had explorer support before. Proposer and community-owner addresses can now link to the explorer for the active network like contracts already do.
  • Migrated consumers:
    • Community detail page (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 with break-all, inconsistent with every other consumer).
    • Proposal detail page (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 hoc onCopyId callback prop with an internal copy-only OnChainIdentifier (kind opaque, hideValue), removing three separate inline navigator.clipboard.writeText call sites in the proposals list pages.
    • CommunityCard: the community ID display.
  • List-row identifiers that live inside a <Link> (e.g. CommunityProposalsView's #id span) were left as plain truncated text — nesting OnChainIdentifier'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-existing react-hooks/set-state-in-effect errors in proposals/page.tsx reproduce identically on main)
  • npm run typecheck — no new errors (five pre-existing errors unrelated to this change reproduce identically on main)
  • npm run test:web — new OnChainIdentifier and stellarExplorer account-URL tests pass; updated CommunityDetailPage, ProposalSummaryCard tests pass; full suite has the same pre-existing failures on main (unrelated voteAggregation/stellar mock setup issues), none introduced by this change
  • npm 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 per kind/network (contract/account/tx), and no explorer link for invalid values or opaque kind (e.g. proposal IDs).

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).
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

@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>
@Caneryy
Caneryy merged commit 8e5aabd into stolla-labs:main Aug 30, 2026
1 check failed
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.

Standardize on-chain identifiers, copy actions, and explorer links

3 participants