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)
Tue, Nov 12, 12:37 AM
Unknown Object (File)
Wed, Nov 6, 5:15 PM
Unknown Object (File)
Wed, Nov 6, 5:15 PM
Unknown Object (File)
Mon, Nov 4, 10:41 AM
Unknown Object (File)
Mon, Nov 4, 8:17 AM
Unknown Object (File)
Mon, Nov 4, 8:17 AM
Unknown Object (File)
Fri, Nov 1, 8:15 AM
Unknown Object (File)
Sat, Oct 26, 11:17 PM
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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

web/chat/chat-input-text-area.react.js
15 ↗(On Diff #26643)

Why is this typed as any?

web/chat/edit-message-provider.js
93–95 ↗(On Diff #26643)

Can this happen? Should this be an invariant?

web/chat/edit-text-message.react.js
91 ↗(On Diff #26643)

This is needed because of eslint?

web/chat/chat-input-text-area.react.js
15 ↗(On Diff #26643)

Should not use any

web/chat/edit-text-message.react.js
89 ↗(On Diff #26643)

Nit: we usually do React.useEffect here

91 ↗(On Diff #26643)

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