Page MenuHomePhabricator

[web] Added message editing
ClosedPublic

Authored by kuba on May 16 2023, 3:57 AM.
Tags
None
Referenced Files
F3352147: D7828.diff
Sat, Nov 23, 4:47 AM
Unknown Object (File)
Tue, Nov 5, 9:00 AM
Unknown Object (File)
Mon, Nov 4, 8:16 AM
Unknown Object (File)
Mon, Nov 4, 8:16 AM
Unknown Object (File)
Mon, Nov 4, 8:16 AM
Unknown Object (File)
Mon, Nov 4, 8:16 AM
Unknown Object (File)
Mon, Nov 4, 8:15 AM
Unknown Object (File)
Mon, Nov 4, 8:15 AM
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