Skip to content

Conversation

@DarkLord017
Copy link
Contributor

@DarkLord017 DarkLord017 commented Nov 28, 2025

Resolves #135

📝 Description

This pull request introduces a new CompactPeerID component to improve how Peer IDs are displayed and interacted with across the application.

Problem Solved:
Long Peer IDs cluttered table layouts, were difficult to read, and required multiple steps to copy. The new component resolves these issues by providing a cleaner UI and faster interaction.

Type: New feature / UI enhancement / Refactor


🛠️ Key Changes

  • Introduced the new CompactPeerID component with:

    • Truncated display for long Peer IDs
    • Full Peer ID shown on hover/focus
    • One-click copy-to-clipboard support
    • (src/components/CompactPeerID.tsx)
  • Added truncatePeerID utility for consistent truncation logic

    • (src/utils/truncate-peer-id.ts)
  • Updated Service Providers table to replace PeerID with CompactPeerID and applied max column sizing

    • (src/app/service-providers/data/column-definition.tsx)
  • Updated Warm Storage Service table to use CompactPeerID

    • (src/app/warm-storage-service/data/column-definition.tsx)

📌 To-Do Before Merging

  • Confirm accessibility (hover, focus, screen reader text)
  • Validate that copy-to-clipboard works across all supported browsers
  • Add unit tests for truncatePeerID
  • Add Storybook / UI docs for CompactPeerID (optional)

🧪 How to Test

Setup

  • Pull the branch locally

  • Run the dev server:

    npm run dev

Steps to Test

  1. Navigate to Service Providers table
  2. Confirm Peer IDs appear truncated
  3. Hover or focus on the Peer ID to view full value
  4. Click the copy button/icon
  5. Verify the correct full Peer ID is copied to clipboard
  6. Navigate to Warm Storage Service table
  7. Repeat the same validation steps there

Expected Results

  • Peer IDs should display in truncated form (e.g., 12D3K...8H9Q)
  • Tooltip or hover should show full Peer ID
  • Clicking the copy icon should copy the full Peer ID
  • Table layout should be cleaner and more compact

Additional Notes

  • Ensure no regressions in sorting, filtering, or row alignment
  • Confirm that mobile responsiveness is not affected

📸 Screenshots

Screenshot 2025-11-29 at 5 01 29 AM

@vercel
Copy link

vercel bot commented Nov 28, 2025

@DarkLord017 is attempting to deploy a commit to the FilOz's projects Team on Vercel.

A member of the Team first needs to authorize it.

@mirhamasala
Copy link
Collaborator

mirhamasala commented Dec 1, 2025

@DarkLord017 Thank you for this. We'll have a look. 🙏🏼

@CharlyMartin Would you like to review and pull the relevant bits into the component library? There's a design but it may be incomplete. I think we also need to give the user feedback once copied like we have on the Warm Storage Service page for the "copy code snippet" bit.

#135

@CharlyMartin CharlyMartin self-requested a review December 2, 2025 10:24
DarkLord017 and others added 2 commits December 19, 2025 11:25
…n tables

Simplify CompactPeerID by making peerId prop required and removing internal null check. Update table columns in service providers and warm storage to display '-' for missing peerIds, add sortUndefined: 'last' for consistency. Revamp component UI: replace custom button with Headless UI Button, remove hover tooltip, update icons/styling for better accessibility and copy feedback. Move import in column-definition.tsx for organization.
@CharlyMartin CharlyMartin merged commit 2a46843 into FilOzone:main Dec 19, 2025
4 of 5 checks passed
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 truncatePeerID function with hover and copy functionality

3 participants