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)
Nov 18 2024, 8:02 AM
Unknown Object (File)
Nov 8 2024, 10:02 PM
Unknown Object (File)
Nov 8 2024, 7:17 PM
Unknown Object (File)
Nov 8 2024, 7:17 PM
Unknown Object (File)
Nov 8 2024, 7:17 PM
Unknown Object (File)
Nov 8 2024, 1:13 PM
Unknown Object (File)
Sep 27 2024, 9:10 AM
Unknown Object (File)
Sep 27 2024, 9:10 AM
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