-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add exploding icon for chat input. #12009
Conversation
this.state.explodingPopupOpen && ( | ||
<SetExplodingMessagePopup | ||
attachTo={this.props.attachmentRef} | ||
isNew={true} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@buoyad, how should this be determined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet implemented, I haven't gotten to it yet in the integration
Actually, I need to get mobile into this PR. So, please hold off on reviewing. 🙏 |
Codecov Report
@@ Coverage Diff @@
## master #12009 +/- ##
==========================================
- Coverage 87.32% 87.27% -0.06%
==========================================
Files 1262 1198 -64
Lines 66274 66001 -273
==========================================
- Hits 57872 57600 -272
+ Misses 8402 8401 -1
Continue to review full report at Codecov.
|
@keybase/react-hackers, this is ready for review. |
Just noticed I've left something out of mobile: https://zpl.io/beg7PBY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, a couple changes
super(props) | ||
this.state = { | ||
emojiPickerOpen: false, | ||
explodingPopupOpen: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes in through the FloatingMenuParentHOC
too, as props.showingMenu
and props.toggleShowingMenu()
@@ -279,6 +292,36 @@ class PlatformInput extends Component<PlatformInputProps, State> { | |||
type="iconfont-boom" | |||
/> | |||
)} | |||
{flags.explodingMessagesEnabled && | |||
this.state.explodingPopupOpen && ( | |||
<SetExplodingMessagePopup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is close to needing to be factored into a connected component. But it can probably wait until the isNew
flag integration
@@ -29,6 +35,14 @@ class PlatformInput extends Component<PlatformInputProps, State> { | |||
this.props.inputSetRef(ref) | |||
} | |||
|
|||
_explodingPickerToggle = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, this and state.explodingPickerOpen
can go away to use the props from the HOC
<ExplodingIcon | ||
explodingModeSeconds={explodingModeSeconds} | ||
isExploding={isExploding} | ||
openExplodingPicker={openExplodingPicker} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On native on device this isn't dismissing the keyboard, so there's no way to make a selection without backing out of the convo, going back in, and choosing before focusing the input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a solution with a little fiddling, changing _explodingPickerToggle
to focus or blur the input depending on whether the popup is open works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dismissing the keyboard feels pretty weird. Is there a way to attach the picker so that it stays adjacent to the keyboard instead of under it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done this within the adapter. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that seems ok.
let title = 'New' | ||
|
||
if (explodingModeSeconds !== 0) { | ||
const description = messageExplodeDescriptions.find( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should look for a match in messageExplodeDescriptions
. If it's set to something different than one of the choices, it doesn't show anything. Instead, this could do a couple checks on whether explodingModeSeconds
is > a day, an hour, etc. and create a ballpark meta based on that. There are some similar functions in #12024 for displaying the countdown. Actually, formatTimeDifference
could be a drop-in replacement for this, it just takes in milliseconds instead of seconds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea. I commented on formatTimeDifference
in your PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll wait for #12024 to merged so I can use that helper.
shared/common-adapters/meta.js
Outdated
color?: string, | ||
backgroundColor: string, | ||
lowercase?: boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be better as noUppercase
so callers can set mixed case stuff freely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!
@@ -238,6 +238,19 @@ const metaData: {[key: TextType]: MetaType} = { | |||
fontSize: 11, | |||
styleOverride: globalStyles.fontRegular, | |||
}, | |||
// Body tiny | |||
BodyTiny: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We needed a smaller text style to match the design. Is this not the way to do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In those cases I usually use the closest TextType
and apply the necessary styles adhoc. I think these are meant to correspond with what's in the font styleguide
@keybase/react-hackers, this is ready for another review. I ran into a known bug with overflow on Android: facebook/react-native#17074, and I'm still working through it (as seen in the last commit). This is behind a feature flag. So, we should be okay to merge it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm pending native flag
@@ -166,6 +208,11 @@ const Action = ({hasText, onSubmit, isEditing, openFilePicker, insertMentionMark | |||
</Box> | |||
) : ( | |||
<Box2 direction="horizontal" gap="small" style={styles.actionIconsContainer}> | |||
<ExplodingIcon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feature flag needed here too
@keybase/react-hackers, this is ready for review.