Page MenuHomePhabricator

[7/n] Native Typeahead - Introduce tooltip component
ClosedPublic

Authored by przemek on Jan 24 2023, 1:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 6:23 AM
Unknown Object (File)
Wed, Apr 17, 6:23 AM
Unknown Object (File)
Wed, Apr 17, 6:23 AM
Unknown Object (File)
Wed, Apr 17, 6:23 AM
Unknown Object (File)
Wed, Apr 17, 6:23 AM
Unknown Object (File)
Wed, Apr 17, 6:23 AM
Unknown Object (File)
Wed, Apr 17, 6:23 AM
Unknown Object (File)
Wed, Apr 17, 6:23 AM

Details

Summary

This is component that takes currently typed text, regex matches, suggested users and creates overlay with clickable buttons that insert usernames into text input.

Test Plan

Checked if app builds.
Will be tested in next diff when it's displayed.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Cleaned up and added PanGestureHandler so the component still takes pan/scroll events even ig it's not scrollable

Added comment justifying GestureHandler

ashoat requested changes to this revision.Jan 26 2023, 7:07 AM
ashoat added inline comments.
native/chat/typeahead-tooltip.react.js
75–80 ↗(On Diff #21347)

This isn't a good explanation... what "scroll/pan events" needed to be handled? Please try revising this. You might have to read and rewrite it eg. 3-4 times before it's ready. Once it's ready, can you make sure somebody other than me reviews it before I take a look?

This revision now requires changes to proceed.Jan 26 2023, 7:07 AM
native/chat/typeahead-tooltip.react.js
75–80 ↗(On Diff #21347)

You should explain first the bug that you were seeing, and then explain why this hack avoids the issue. You should also be honest and direct that this is a hack, and that we're not actually using it for anything – just to get around the issue

Updated comment. I feel like now it's really exhaustive explantion of both the bug and fix.
Or at least as exhaustive as comment can get.

ashoat requested changes to this revision.Jan 26 2023, 8:48 AM

Once it's ready, can you make sure somebody other than me reviews it before I take a look?

Did you do this? I wonder if somebody else could've caught the typos. I'd love to get to a world where I'm not the only person on the team who can review English like this...

native/chat/typeahead-tooltip.react.js
75–91 ↗(On Diff #21366)

Paragraphs are hard to discern here, maybe try adding some empty lines to separate them

80 ↗(On Diff #21366)

Typo

82 ↗(On Diff #21366)

Typo

83 ↗(On Diff #21366)

Typo

93 ↗(On Diff #21366)

Should we be including this on iOS? Will it hurt performance at all?

This revision now requires changes to proceed.Jan 26 2023, 8:48 AM

Fixed typos and revised text.

tomek requested changes to this revision.Jan 27 2023, 1:50 AM
tomek added inline comments.
native/chat/typeahead-tooltip.react.js
6 ↗(On Diff #21414)

This should be included from react-native

38–49 ↗(On Diff #21414)

This code looks familiar - we probably have something similar on web. Is it a good idea to extract the common part from them?

60 ↗(On Diff #21414)

How does this behave when usernames are really long?

114 ↗(On Diff #21414)

How were these values determined? Are they correct for different resolutions / pixel densities?

This revision now requires changes to proceed.Jan 27 2023, 1:50 AM

Comment looks good, defer to @tomek on the rest

przemek marked 3 inline comments as done.

Responding to review.

native/chat/typeahead-tooltip.react.js
38–49 ↗(On Diff #21414)

You're right. I've created commit 4.5/n and refactored it to seperate common function, so we can use it here

60 ↗(On Diff #21414)

It's fine. It puts ellipsis at the end and hides overflow.

114 ↗(On Diff #21414)

Experimentally. It was related to chat-input-bar.react.js

container: {
    backgroundColor: 'listBackground',
    paddingLeft: Platform.OS === 'android' ? 10 : 5,
  }

and https://github.com/facebook/react-native/issues/4240
Working fix was to set both left and right to 0

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