Page MenuHomePhabricator

[web] Storing edited message component position
ClosedPublic

Authored by kuba on May 16 2023, 4:20 AM.
Tags
None
Referenced Files
F1440839: D7833.diff
Thu, Mar 28, 11:02 PM
F1440119: D7833.id26845.diff
Thu, Mar 28, 9:27 PM
F1440117: D7833.id26951.diff
Thu, Mar 28, 9:26 PM
F1440116: D7833.id26519.diff
Thu, Mar 28, 9:26 PM
F1440115: D7833.id26643.diff
Thu, Mar 28, 9:26 PM
F1440060: D7833.id.diff
Thu, Mar 28, 9:26 PM
F1439994: D7833.diff
Thu, Mar 28, 9:19 PM
Unknown Object (File)
Tue, Mar 5, 8:27 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 ↗(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