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, Jun 23, 9:17 PM
Unknown Object (File)
Wed, Jun 19, 10:12 PM
Unknown Object (File)
Thu, May 30, 5:10 PM
Unknown Object (File)
Thu, May 30, 4:19 PM
Unknown Object (File)
Thu, May 30, 1:21 AM
Unknown Object (File)
May 25 2024, 5:30 PM
Unknown Object (File)
May 25 2024, 5:30 PM
Unknown Object (File)
May 24 2024, 6:24 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