Page MenuHomePhabricator

[web] Storing edited message component position
ClosedPublic

Authored by kuba on May 16 2023, 4:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 22, 6:57 AM
Unknown Object (File)
Fri, Jun 21, 6:48 AM
Unknown Object (File)
Thu, Jun 20, 12:19 PM
Unknown Object (File)
Sun, Jun 16, 10:05 AM
Unknown Object (File)
Sun, Jun 16, 3:46 AM
Unknown Object (File)
Fri, Jun 14, 3:39 AM
Unknown Object (File)
Wed, Jun 12, 5:34 AM
Unknown Object (File)
Mon, Jun 3, 8:59 AM
Subscribers

Details

Summary

To display a modal of the editing message GUI, I have to store and update the current position of the edited message.

Test Plan
  • Checked if the position is correctly stored after entering edit mode.
  • Resized the window, checked if the position is updated.
  • Added/removed few lines to the message, checked if the position is updated.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

web/chat/chat-input-text-area.react.js
15

Why is this typed as any?

web/chat/edit-message-provider.js
93–95

Can this happen? Should this be an invariant?

web/chat/edit-text-message.react.js
91

This is needed because of eslint?

web/chat/chat-input-text-area.react.js
15

Should not use any

web/chat/edit-text-message.react.js
89

Nit: we usually do React.useEffect here

91

Should be possible to return undefined

kuba marked 6 inline comments as done.

Address review

This revision is now accepted and ready to land.May 23 2023, 4:29 AM
web/chat/chat-input-text-area.react.js
9–14 ↗(On Diff #26845)

It never hurts to be flexible with props (and with input parameters). If we don't care about the return, we do not need to insist on the function returning void. It can return anything, and it won't matter to us