From ab4d22af590ecf4100a1f5a5850a5231c347521c Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Wed, 19 Nov 2025 11:53:29 -0700 Subject: [PATCH] feat: simplify the user-profile-sharing prompts (where you contact via a current user) --- src/views/UserProfileView.vue | 117 +++++++++++++++++++--------------- 1 file changed, 65 insertions(+), 52 deletions(-) diff --git a/src/views/UserProfileView.vue b/src/views/UserProfileView.vue index abcb08dd..86775c49 100644 --- a/src/views/UserProfileView.vue +++ b/src/views/UserProfileView.vue @@ -57,8 +57,8 @@
@@ -85,62 +85,52 @@
-
-

- The following - {{ neighbors.length === 1 ? "user is" : "users are" }} - closer to the person who owns this profile. -

-
-
- 1 -

- - Click to copy this profile reference - - to your clipboard -

-
-
- 2 -

- Contact a user listed below and share the reference to request - an introduction -

-
-
-
- +
+ + + {{ getRelationLabel(neighbor.relation) }} + +
+
+
-

- {{ getNeighborDisplayName(neighbor.did) }} -

+ + Go to contact info + + and send them the link in your clipboard and ask for an + introduction to this person.

This person is connected to you, but they are not in this @@ -160,10 +150,7 @@

- - - {{ getRelationLabel(neighbor.relation) }} - +
@@ -274,12 +261,13 @@ export default class UserProfileView extends Vue { activeDid = ""; allContacts: Array = []; allMyDids: Array = []; + expandedNeighborDid: string | null = null; isLoading = true; loadingNeighbors = false; + neighbors: Array<{ did: string; relation: string }> = []; neighborsError = ""; partnerApiServer = DEFAULT_PARTNER_API_SERVER; profile: UserProfile | null = null; - neighbors: Array<{ did: string; relation: string }> = []; // make this function available to the Vue template didInfo = didInfo; @@ -431,6 +419,31 @@ export default class UserProfileView extends Vue { } } + /** + * Handles clicking the expand button next to a neighbor's name + * Copies the profile link to clipboard and toggles the expanded section + */ + async onNeighborExpandClick(did: string) { + if (this.expandedNeighborDid === did) { + this.expandedNeighborDid = null; + // don't copy the link + return; + } + + // Copy the profile link + const deepLink = `${APP_SERVER}/deep-link/user-profile/${this.profile?.rowId}`; + try { + await copyToClipboard(deepLink); + this.notify.copied("Profile link", TIMEOUTS.STANDARD); + } catch (error) { + this.$logAndConsole(`Error copying profile link: ${error}`, true); + this.notify.error("Failed to copy profile link."); + } + + // Toggle the expanded section + this.expandedNeighborDid = did; + } + /** * Computed properties for template logic streamlining */