Page MenuHomePhabricator

[native] Lift selectionState in chat input bar
ClosedPublic

Authored by rohan on Dec 18 2023, 6:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 9, 12:34 AM
Unknown Object (File)
Mar 24 2024, 3:42 PM
Unknown Object (File)
Mar 24 2024, 8:59 AM
Unknown Object (File)
Feb 20 2024, 11:39 AM
Unknown Object (File)
Feb 20 2024, 6:39 AM
Unknown Object (File)
Feb 20 2024, 5:38 AM
Unknown Object (File)
Feb 20 2024, 3:16 AM
Unknown Object (File)
Feb 19 2024, 9:29 PM
Subscribers

Details

Summary

In order to use a hook that will get user mention candidates that are resolved, we need to first extract the logic to compute user chat mention candidates outside of the class component. There are two steps to this:

  1. Lift the selectionState out of the class component
  2. Move the computation logic out of the class component

This diff just covers step 1, and the following diff will cover the next step.

Addresses https://linear.app/comm/issue/ENG-6112/update-native-chat-input-bar-to-make-it-easier-to-use-hooks

Test Plan

Ran the app and did some testing with @ mentioning to confirm there were no visibile regressions. Also did some logging to make sure the @ mention suggestions were the same as before

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rohan requested review of this revision.Dec 18 2023, 8:06 AM

looks good, minor nit inline

native/chat/chat-input-bar.react.js
312 ↗(On Diff #34800)

Inside of lib/types/hook-types.js there is a SetState type that we should use instead of typing this by hand

This revision is now accepted and ready to land.Dec 18 2023, 3:53 PM