-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements contact deletion functionality #420
Conversation
… removes the not needed event.stopPropagation()
fill="none" is needed in delete icon for retaining its transparent background behr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requested some changes inline.
One gotcha I want to make sure is handled (it may be handled already but we should confirm).
Say we have a private conversation with a contact, but we never received a profile for that contact agent and conversation. Then we delete the contact. What will be displayed as the profile name in the conversation messages, or the profile in the ConversationSummary, or in the title from the ConversationTitleStore?
…ntact function as its handled already in the keystore
As per my understanding, we need to modify the delete behavior to maintain a "tombstone" record with basic display information even after deletion similar to how social media platforms handle deleted accounts. Let me explain it in more detail. Currently, when a contact is deleted, two key things happen:
There is a potential edge case that we are surely missing. While the contact information is removed from the If we never received a profile for that contact and then deleted the contact entry, we would lose the connection between the agent's public key and any profile information. When trying to display profile information in conversation messages,
To properly handle this case, we could consider one of the following solutions:
|
Did you actually confirm this is the case? I think we may be handling it because currently messages are not included the readable for agents who do not have a profile. Not necessarily the ideal solution, but not terrible either. If necessary I would prefer this option:
|
Yeah I am confirming that we have this issue, we are not actually removing the name of the contact deleted from the conversations. |
56bcd6e
to
00bca13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requested changes in comments inline
let pollInterval: NodeJS.Timeout; | ||
$: hasAgentJoinedDht = | ||
profiles !== undefined && | ||
$profiles?.list.find(([key]) => key === $contact.publicKeyB64) !== undefined; | ||
$profiles?.list.find(([key]) => key === $contact?.publicKeyB64) !== undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think this change is needed either anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ?.
operator is needed here because when a contact is deleted, there's a brief moment where the contact data becomes undefined. Without ?.
, trying to read properties during that moment would cause an error that freezes the UI update.?.
prevents this error, ensuring the deletion completes smoothly with instant UI feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see inline comments
…atching in Dialog component
…l stores after deletion
…citly check if contact is undefined once, rather in map with ?., pass icon to Dialog action button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a few minor changes to the implementation:
- The dialog stays open while the contact is being deleted, and the "loading" indicator is shown in the dialog action button
- Show the delete icon to the dialog action button
- explicitly check if $contact is undefined once, rather than within the
find
callback - Added a period to the end of the string
delete_contact_dialog_message
- Added the feature to the changelog
Great work!
Implements contact deletion functionality
Resolves #13
Adds the functionality for removing the contact from the contact list.
Adds a button on the create page (where contacts are listed) to allow users to remove contacts from the list.