Page MenuHomePhabricator

[native] Add EditState to the InputState
ClosedPublic

Authored by kuba on Apr 7 2023, 6:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 8, 6:34 PM
Unknown Object (File)
Sat, Dec 7, 8:37 PM
Unknown Object (File)
Sat, Dec 7, 8:36 PM
Unknown Object (File)
Thu, Dec 5, 1:35 AM
Unknown Object (File)
Thu, Dec 5, 1:35 AM
Unknown Object (File)
Thu, Dec 5, 1:35 AM
Unknown Object (File)
Thu, Dec 5, 1:16 AM
Unknown Object (File)
Sat, Nov 30, 8:59 PM
Subscribers

Details

Summary

Added EditState which stores information about which message is being currently edited.

Test Plan

Run the app, and check if it still works. More tests are in later diffs.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Can you provide more justification as to why this state needs to exist globally versus just being inside a local React component?

EDIT

This is more clear in D7343... the state needs to be set from a tooltip, which means we need some React context to hold the state. We could use a "one-off" context for this, but I think it's fine to use InputStateContainer.

native/input/input-state.js
57 ↗(On Diff #24781)

Couldn't this be just +editedMessageID: ?string, ? Do you plan to add more fields to EditState?

native/input/input-state.js
57 ↗(On Diff #24781)

For now, I don't plan to add new fields. But in the future, we might need more states for handling media message editing or error handling (when editing the message was unsuccessful).
If it is necessary I can change it to just editedMessageID.

inka added inline comments.
native/input/input-state.js
57 ↗(On Diff #24781)

Right, that makes sense. We can probably leave it

This revision is now accepted and ready to land.Apr 12 2023, 3:33 AM