Skip to content
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

Align message content deletion experience with web app #5528

Open
2 tasks
alya opened this issue Oct 20, 2022 · 6 comments · May be fixed by #5632
Open
2 tasks

Align message content deletion experience with web app #5528

alya opened this issue Oct 20, 2022 · 6 comments · May be fixed by #5632
Assignees
Labels
a-compose/send Compose box, autocomplete, camera/upload, outbox, sending help wanted webapp parity Features that exist in the webapp that we need to port to mobile. We aren't aiming for full parity.

Comments

@alya
Copy link
Collaborator

alya commented Oct 20, 2022

We should make two changes to make the mobile app message deletion experience consistent with the web app and https://zulip.com/help/edit-or-delete-a-message#delete-a-message. Specifically, we should only use "Delete message" to refer to fully removing the message, rather than deleting message content.

We should:

  • Drop the "Delete message" option from the menu for your own messages. (Once Delete a message completely by an admin #4701 is resolved, this option will be re-added when the user has message deletion permissions.)
  • Allow users to delete all the content of a message when editing messages. In that case, the message should be shown as "(deleted)". Currently, messaging editing changes cannot be saved when the resulting message content is empty.
@alya alya added help wanted a-compose/send Compose box, autocomplete, camera/upload, outbox, sending webapp parity Features that exist in the webapp that we need to port to mobile. We aren't aiming for full parity. labels Oct 20, 2022
@gnprice
Copy link
Member

gnprice commented Oct 20, 2022

An implementation note for this part:

Currently, messaging editing changes cannot be saved when the resulting message content is empty.

What's happening here is that for editing a message we re-use the UI (in ComposeBox) for composing and sending one. When you're composing a message to send, we keep the "send" button grayed out when the input is empty, for good reason. The same logic currently affects editing too, but we should change it so that when you're editing, an empty input is accepted as valid.

(The server already accepts an empty message content when editing a message; it then transforms that internally to say "(deleted)" instead. In fact editing a message to be empty is exactly what we do in the existing "Delete message" option, the one we'll be removing in the first part of this issue.)

@KshitizSareen
Copy link

KshitizSareen commented Dec 22, 2022

Hi @alya, I was wondering if you are still looking for help to solve this issue. I looked into it, and I think I might have an idea on how to fix it. I made some changes to my forked repository, that allows users to delete message when deleting the content of a message when editing messages.

Basically, I use the isEditing prop in the ComposeBox component to keep track of when the message is being edited or deleted. If its being edited, I ignore the "message is empty" error. That allows the user to send empty content while editing the message. I also changed the sendCallback in the ChatScreen to allow empty content to be sent through the API. I just had to change the if condition.

Im still working on removing the delete message button.

Could you assign this issue to me?

Please let me know if you need anything else.

Regards,
Kshitiz.

@KshitizSareen
Copy link

I also have an idea on how to remove the delete button for users who are not admins. I just need to check if the user is not an admin, and if it is an admin, I will add the delete button to the options of the action sheet, else I wont add it. I understand how to remove it for users, but I also see it being added when message.isOutbox is True. Im not really sure what isOutbox means.

I would appreciate it if I could get some help.

Regards,
Kshitiz.

@alya
Copy link
Collaborator Author

alya commented Dec 29, 2022

@gnprice @chrisbobbe Any feedback on the approach described above?

@alya
Copy link
Collaborator Author

alya commented Dec 31, 2022

@KshitizSareen If you have questions as you are working on an issue, you'll generally get a faster response if you post them in the #mobile-team stream in the Zulip development community. Be sure to follow https://zulip.readthedocs.io/en/latest/contributing/asking-great-questions.html. Thanks!

@KshitizSareen
Copy link

Hi @alya, Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-compose/send Compose box, autocomplete, camera/upload, outbox, sending help wanted webapp parity Features that exist in the webapp that we need to port to mobile. We aren't aiming for full parity.
Projects
None yet
3 participants