-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 strikethrough is not applied to deleted markdown text while offline on native #16465
Conversation
@youssef-lr @Santhosh-Sellavel One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
We don't apply the Code block:
|
@@ -0,0 +1,5 @@ | |||
function applyStrikethrough(html) { | |||
return html; |
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.
Shouldn't we remove the styles which apply strike-through for web and unify the approach across platforms
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.
If we want to remove the style, that means we need to remove it from all of it's parent and that would affect other components.
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.
If we can add del
tag and simplify things why would we still need stick to old styles
Why would we need it still?
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.
@youssef-lr your 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.
The chat message is inside this OfflineWithFeedback
, and if we don't want to have the strikethrough styles, then we need to pass the pendingAction
props only if it's a delete action.
App/src/pages/home/report/ReportActionItem.js
Lines 255 to 279 in 0763be5
<OfflineWithFeedback | |
onClose={() => { | |
if (this.props.action.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) { | |
ReportActions.deleteOptimisticReportAction(this.props.report.reportID, this.props.action.reportActionID); | |
} else { | |
ReportActions.clearReportActionErrors(this.props.report.reportID, this.props.action.reportActionID); | |
} | |
}} | |
pendingAction={this.props.draftMessage ? null : this.props.action.pendingAction} | |
errors={this.props.action.errors} | |
errorRowStyles={[styles.ml10, styles.mr2]} | |
needsOffscreenAlphaCompositing={this.props.action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU} | |
> | |
{!this.props.displayAsGroup | |
? ( | |
<ReportActionItemSingle action={this.props.action} showHeader={!this.props.draftMessage}> | |
{this.renderItemContent(hovered || this.state.isContextMenuActive)} | |
</ReportActionItemSingle> | |
) | |
: ( | |
<ReportActionItemGrouped> | |
{this.renderItemContent(hovered || this.state.isContextMenuActive)} | |
</ReportActionItemGrouped> | |
)} | |
</OfflineWithFeedback> |
Next, we also need to give the style manually to the non-HTML text here
App/src/pages/home/report/ReportActionItemFragment.js
Lines 120 to 137 in 0763be5
return ( | |
<Text | |
family="EMOJI_TEXT_FONT" | |
selectable={!DeviceCapabilities.canUseTouchScreen() || !props.isSmallScreenWidth} | |
style={[EmojiUtils.containsOnlyEmojis(text) ? styles.onlyEmojisText : undefined, styles.ltr, ...props.style]} | |
> | |
{StyleUtils.convertToLTR(Str.htmlDecode(text))} | |
{props.fragment.isEdited && ( | |
<Text | |
fontSize={variables.fontSizeSmall} | |
color={themeColors.textSupporting} | |
> | |
{` ${props.translate('reportActionCompose.edited')}`} | |
</Text> | |
)} | |
</Text> | |
); | |
} |
This is assuming that all components inside the OfflineWithFeedback
does not need the strikethrough style except ReportActionItemFragment
.
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.
@Santhosh-Sellavel could you please clarify what you mean by this? Aren't these styles coming from OfflineWithFeedback
and web will remain untouched here as we're only adding them in index.native.js
?
Shouldn't we remove the styles which apply strike-through for web and unify the approach across platforms
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.
the web will remain untouched here as we're only adding them in index.native.js?
Yes
Shouldn't we remove the styles which apply strike-through for the web and unify the approach across platforms?
As of now strike through styles for deleted messages are applied through styles on web, now we are handling native using <del>
tag. Instead of mixing up two solutions one for the web & one for native shouldn't we unify?
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 see. How do you suggest we unify this? Do you have a solution in mind?
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 really have a good solution, but are we fine with this?
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'm fine with as is now, let me know if you differ @youssef-lr
Kindly bump @Santhosh-Sellavel. |
Reviewer Checklist
Screenshots/Videos |
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, tests well!
All you @youssef-lr!
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!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/youssef-lr in version: 1.2.93-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.2.93-4 🚀
|
Details
When we delete a markdown message while offline on Android/iOS, the text is not getting strikethrough.
Fixed Issues
$ #15571
PROPOSAL: #15571 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
web.mov
Mobile Web - Chrome
android.mweb.mp4
Mobile Web - Safari
ios.mweb.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mp4