codeforpdx / PASS

PASS project - with HMIS module integration
MIT License
25 stars 24 forks source link

Issue 414/add message to contacts #485

Closed andycwilliams closed 8 months ago

andycwilliams commented 8 months ago

This PR:

Resolves #414

I've been focused elsewhere and am only now getting back into the swing of PASS, so please make sure this is proper.

1. Adds a message button to each row in the contacts list 2. This button auto populates the To field with the corresponding username

Screenshots (if applicable):

Capture Capture2

Issues needing discussion/feedback (optional):

1. Determine whether this code could be more efficient 2. Determine if the message icon is adequate or should be replaced

leekahung commented 8 months ago

At the moment, the send message function hard-codes the trailing profile/card#me that comes with all solid webIds so you only need to enter the pod URL for the To field, sort of like not needing to type www. for websites.

Was thinking of modifying the UI for the To field to make that more apparent (like with a placeholder or text at the end of the field).

andycwilliams commented 8 months ago

At the moment, the send message function hard-codes the trailing profile/card#me that comes with all solid webIds so you only need to enter the pod URL for the To field, sort of like not needing to type www. for websites.

Was thinking of modifying the UI for the To field to make that more apparent (like with a placeholder or text at the end of the field).

Do you mean you'd like to do that in this PR, or just that it's something planned for the future?

Think we could have all the columns with interactive buttons be the same width. So perhaps we could make the other two columns 80px width as well.

Done in next push.

leekahung commented 8 months ago

At the moment, the send message function hard-codes the trailing profile/card#me that comes with all solid webIds so you only need to enter the pod URL for the To field, sort of like not needing to type www. for websites. Was thinking of modifying the UI for the To field to make that more apparent (like with a placeholder or text at the end of the field).

Do you mean you'd like to do that in this PR, or just that it's something planned for the future?

Think we can do it in a later PR.

andycwilliams commented 8 months ago

Think we can do it in a later PR.

Sounds good. Is there anything more needed for this?

leekahung commented 8 months ago

Think we can do it in a later PR.

Sounds good. Is there anything more needed for this?

If it's still using webId for the "To" field, it needs to be updated to use Pod URL (unless we update the sendMessage function in utils to just accept straight up webIds as well). Other wise think it should be ready?

Is there also a way to make the send icon gray like the other icons? Makes them consistent to the other icons on the row.

andycwilliams commented 8 months ago

If it's still using webId for the "To" field, it needs to be updated to use Pod URL (unless we update the sendMessage function in utils to just accept straight up webIds as well). Other wise think it should be ready?

So just removing profile/card#me from https://exampleusername.solidcommunity.net/profile/card#me? That should be simple

Is there also a way to make the send icon gray like the other icons? Makes them consistent to the other icons on the row.

Yep, that's easy.

leekahung commented 8 months ago

If it's still using webId for the "To" field, it needs to be updated to use Pod URL (unless we update the sendMessage function in utils to just accept straight up webIds as well). Other wise think it should be ready?

So just removing profile/card#me from https://exampleusername.solidcommunity.net/profile/card#me? That should be simple

Yeah, I think you could just pull contact.podUrl directly from the contact object:

Screen Shot 2023-10-31 at 19 47 53

andycwilliams commented 8 months ago

Yeah, I think you could just pull contact.podUrl directly from the contact object:

Should be good to go now?

leekahung commented 8 months ago

Had previously thought it was good to go, but it looks like there still a few kinks to work out.

The first being that I couldn't send any message and the error not entering a recipient pod URL appeared. Looking at NewMessageModal.jsx, it's likely that sendMessageTTL function in Line 83 did not trigger. The handleSubmit function needs to take into consideration the new toField variable as well.

Second, the cursor for the send icon remains cursor instead of pointer. This one should be easier to handle.

Screen.Recording.2023-11-02.at.0.20.36.mov

Thinking about it again, I think we could also disable the To field since we don't really need to change that if it's going to be a direct message to that person from the contact list.