Edit thread message UI
Closes #2352 (closed)
Scenario | example |
---|---|
Edit from the context menu | |
Edit by pressing UP | |
Updating message fails (shamelessly using #2375) | |
Cancelling edit with ESC | |
Update in progress |
Core idea
When we want to edit a thread message, we initialize threadedConversations.messageEditState
object:
{
id: "<messageId>",
text: "draft text, starting with copy of message.text"
}
Presence of this object means a message is being edited.
Focus
Changes to focus as a part of this MR
- opening TMF will set focus to the TMF chat input box
- when opening message edit (either from context menu or by pressing UP) - we focus the message edit input box
- when closing the message edit input box (either by ESC or submitting an update by ENTER) we focus back on the TMF chat input box
Testing strategy
(all testing done in TMF)
- Messages older than 10 mins shouldn't be editable in UI
- Create a message and edit it by selecting "Edit" from the context menu
- Testing selecting the latest editable message by pressing UP
- Create a message with user A
- Create another message with user B
- With user A, press UP in the TMF input box
- Observe that the correct message (second last) is being edited
- Testing error state - either you can open the edit box and wait 10 minutes before submitting (server will return 400) or you can take advantage of a current bug #2375 and submit a message that will fail markdown parsing
Edited by Tomas Vik (OOO back on 2024-09-23)