Page MenuHomePhabricator

[web] Added message editing
ClosedPublic

Authored by kuba on May 16 2023, 3:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 5, 2:23 AM
Unknown Object (File)
Wed, Dec 4, 4:04 AM
Unknown Object (File)
Wed, Dec 4, 4:04 AM
Unknown Object (File)
Wed, Dec 4, 4:04 AM
Unknown Object (File)
Tue, Dec 3, 10:52 PM
Unknown Object (File)
Tue, Dec 3, 10:52 PM
Unknown Object (File)
Tue, Dec 3, 10:51 PM
Unknown Object (File)
Tue, Dec 3, 10:51 PM
Subscribers

Details

Summary

Added message editing after the user clicks Save or presses Enter.

Test Plan
  • selected message to edit, made changes, pressed Save -> the message was successfully edited,
  • selected message to edit, pressed save without edits -> exited edit mode without sending edit message

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Added setting error state, merged with next diff

michal added inline comments.
web/chat/edit-message-provider.js
70–72 ↗(On Diff #26642)

Is this possible? Should we use an invariant?

web/chat/edit-text-message.react.js
62–64 ↗(On Diff #26642)

In this case we probably want to clearEditModal?

This revision is now accepted and ready to land.May 19 2023, 2:55 AM
kuba added inline comments.
web/chat/edit-message-provider.js
70–72 ↗(On Diff #26642)

You are right. We use it only inside the edit modal. We can probably use here invariant.

web/chat/edit-text-message.react.js
62–64 ↗(On Diff #26642)

It is here to prevent typing warnings. If the user leaves an empty message and wants to save it, we clear the edit modal (lines 50 and 59) anyway. Probably, I could use here an invariant as well. Should I change it?

kuba marked 2 inline comments as done.

Added invariant