-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix for: Web - Triple clicking an edited message select’s the (edited) label along with the actual message #17704
Changes from 7 commits
0951986
861fc7c
18274bd
93f3662
45646d5
2619a9b
db83d74
06b6454
fcf4630
a994917
133d4d5
7633f88
44bbe3c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,6 @@ const EmojiReactionBubble = (props) => { | |
> | ||
<Text style={[ | ||
styles.emojiReactionBubbleText, | ||
styles.userSelectNone, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checking on it where it was added originally. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Ollyws Which part does this fix? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @parasharrajat it fixes copying the emoji reaction. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which one is Context or Underneath the message? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @parasharrajat Underneath the message. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. It means that this change will be against #18228 as that PR uses There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this change is not needed for the current issue and is delaying the PR. I don't want anyone to be penalized for figuring this out on this PR. So should we remove this change and merge as it is @marcochavezf? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @parasharrajat It seems #18228 will fix the problem that us removing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes please revert it. @Ollyws |
||
StyleUtils.getEmojiReactionBubbleTextStyle(props.isContextMenu), | ||
]} | ||
> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -275,6 +275,18 @@ class ReportActionItem extends Component { | |
<Hoverable> | ||
{hovered => ( | ||
<View accessibilityLabel={this.props.translate('accessibilityHints.chatMessage')}> | ||
<MiniReportActionContextMenu | ||
reportID={this.props.report.reportID} | ||
reportAction={this.props.action} | ||
isArchivedRoom={ReportUtils.isArchivedRoom(this.props.report)} | ||
displayAsGroup={this.props.displayAsGroup} | ||
isVisible={ | ||
hovered | ||
&& !this.props.draftMessage | ||
} | ||
draftMessage={this.props.draftMessage} | ||
isChronosReport={ReportUtils.chatIncludesChronos(this.props.report)} | ||
/> | ||
Comment on lines
+278
to
+289
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the refactor? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moving this to the top of the view changes its position in the DOM to be first (which makes sense since visually it is at the top). This means it won't be selected on triple-click as it is no longer after the (edited) label. This resolves the MiniReportActionContextMenu part of #15810 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am fine with it as it does not logically change anything. |
||
{this.props.shouldDisplayNewMarker && ( | ||
<UnreadActionIndicator reportActionID={this.props.action.reportActionID} /> | ||
)} | ||
|
@@ -336,19 +348,6 @@ class ReportActionItem extends Component { | |
)} | ||
</OfflineWithFeedback> | ||
</View> | ||
<MiniReportActionContextMenu | ||
reportID={this.props.report.reportID} | ||
reportAction={this.props.action} | ||
isArchivedRoom={ReportUtils.isArchivedRoom(this.props.report)} | ||
displayAsGroup={this.props.displayAsGroup} | ||
isVisible={ | ||
hovered | ||
&& !this.props.draftMessage | ||
&& !hasErrors | ||
} | ||
draftMessage={this.props.draftMessage} | ||
isChronosReport={ReportUtils.chatIncludesChronos(this.props.report)} | ||
/> | ||
</View> | ||
)} | ||
</Hoverable> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,8 +133,10 @@ const ReportActionItemFragment = (props) => { | |
<Text | ||
fontSize={variables.fontSizeSmall} | ||
color={themeColors.textSupporting} | ||
style={[styles.alignItemsBaseline, styles.dInlineFlex]} | ||
> | ||
{` ${props.translate('reportActionCompose.edited')}`} | ||
<Text style={styles.w1}>{' '}</Text> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see same as EditedRenderer. Correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @parasharrajat This is necessary for our solution to work on Firefox and also fixes this problem with overflow. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does this work? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the way Firefox deals with selection using flex, having a There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Any thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @parasharrajat I'm having a look at it, but I'm not sure there is any easy solution. Do you think it is a big issue? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think @marcochavezf? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another issue with this change is that this space is selectable via triple click.
Can we just replace it with a margin? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @parasharrajat We could just add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, let's add that. |
||
{props.translate('reportActionCompose.edited')} | ||
</Text> | ||
)} | ||
</Text> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
display: 'inline-flex', | ||
}; |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a bad example of platform file usage. Proper way would be only apply the inline flex on the web platforms and flex on native. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @parasharrajat Applying flex would break the layout: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do also return empty for other styles such as overflowXHiden, pointerEventsNone, pointerEventsAuto, whiteSpace, wordBreak. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh interesting, I think this is fine since we're applying empty objects in other places. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @parasharrajat Given @marcochavezf thoughts, are we ok to leave this as it is? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default {}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem with this code is inconsistency. It looks incorrect that inline-flex is null on native. The proper way would be:
So a new function|lib There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @parasharrajat Ok I see, could you point me at some code where we already do something like this so I have something to go on? I'm slightly confused about the implementation. Thanks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can do following
|
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 just noticed that this is a Text Component where we are applying inline flex.
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.
@parasharrajat Yes, is this an issue?
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.