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)
Wed, Dec 11, 7:55 PM
Unknown Object (File)
Sun, Dec 8, 6:43 PM
Unknown Object (File)
Sun, Dec 8, 6:43 PM
Unknown Object (File)
Wed, Dec 4, 4:05 AM
Unknown Object (File)
Wed, Dec 4, 4:05 AM
Unknown Object (File)
Wed, Dec 4, 4:04 AM
Unknown Object (File)
Sat, Nov 30, 4:07 AM
Unknown Object (File)
Tue, Nov 26, 10:51 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