-
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
[HOLD for payment 2025-01-07] [$250] Android - Live mark down is not rendered when Description field is opened after saving it #53645
Comments
Triggered auto assignment to @arosiclair ( |
💬 A slack conversation has been started in #expensify-open-source |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
I reproduced on Android v9.0.72-0. Looks like iOS is unaffected. |
None of the PRs in the checklist seem to be the issue. I reproduced in dev with the latest on |
Looks like markdown doesn't render at all in the Description field on v9.0.70-9. This looks like a new feature and not a regression. Removing the blocker label |
Triggered auto assignment to @zanyrenney ( |
Job added to Upwork: https://www.upwork.com/jobs/~021864791346170591685 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak ( |
Edited by proposal-police: This proposal was edited at 2024-12-11 09:47:37 UTC. ProposalPlease re-state the problem that we are trying to solve in this issueLive markdown is not rendered when Description field is opened after saving it (the same thing happens in Private notes, room description and workspace description fields). What is the root cause of that problem?The root of this issue comes from the Android: Native implementation of the @Override
public void afterTextChanged(Editable editable) {
if (editable instanceof SpannableStringBuilder) {
mMarkdownUtils.applyMarkdownFormatting((SpannableStringBuilder) editable);
}
} the problem with this being evident from the method name -> the live markdown styling is only applied when the after input changes and not when the input is mounted as it happens on iOS: Native for example. This is also confirmed by the fact that if we change the text or remove a markdown symbol and add it back -> the live markdown will be applied again and show up as expected. What changes do you think we should make in order to solve the problem?Note I don't have a lot of experience with android native code, but I'll give this a shot and hopefully the What we want here is to apply the live markdown formatting when the input is mounted (regardless of its focus state), to do this we need to apply the following change in the
// add the imports at the top
import android.text.Editable;
import android.text.SpannableStringBuilder;
// add this inside, at the end of this if block
if (previousSibling instanceof ReactEditText) {
AssetManager assetManager = getContext().getAssets();
MarkdownUtils.maybeInitializeRuntime(assetManager);
mMarkdownUtils = new MarkdownUtils(assetManager);
mMarkdownUtils.setMarkdownStyle(mMarkdownStyle);
mReactEditText = (ReactEditText) previousSibling;
mTextWatcher = new MarkdownTextWatcher(mMarkdownUtils);
mReactEditText.addTextChangedListener(mTextWatcher);
Editable editable = mReactEditText.getText(); // <- new line
if (editable instanceof SpannableStringBuilder) { // <- new line
mMarkdownUtils.applyMarkdownFormatting((SpannableStringBuilder) editable); // <- new line
} // <- new line
} The reason we add it there is because at that point the input is mounted and the next logical step would be to apply the markdown formatting. What the new logic does is it extracts the text from the input and applies the markdown formatting. Or, to make things simpler we can add 1 line instead of the ones above, as suggested in #53645 (comment): // add this inside, at the end of this if block
if (previousSibling instanceof ReactEditText) {
AssetManager assetManager = getContext().getAssets();
MarkdownUtils.maybeInitializeRuntime(assetManager);
mMarkdownUtils = new MarkdownUtils(assetManager);
mMarkdownUtils.setMarkdownStyle(mMarkdownStyle);
mReactEditText = (ReactEditText) previousSibling;
mTextWatcher = new MarkdownTextWatcher(mMarkdownUtils);
applyNewStyles(); // <- new line
} Important This solution will fix the issue in all inputs where the issue is present, as required by the Expected result. If there are any other details I missed or some technical oversight, I think that can be further discussed during review. cc @tomekzaw @BartoszGrajdek for visibility since this is Result videoAndroid: Nativeandroid.mp4 |
I agree with solution proposed by @ikevin127 in #53645 (comment) but I'd like to understand the issue a bit more since in the live-markdown example app, the Markdown formatting is already applied immediately during first render even without this change. |
What I'm thinking is that on native, the screen which contains this input remains in the stack (for navigation purposes) and when reopening it and since there was no change, the android native code does not include logic to This is the only explanation that would make sense to me when comparing our case with the live-markdown example app where there's no navigation stack involved as the markdown input is added directly in the It's just a hunch though, not entirely sure how to debug this to see why, other than looking at the code and figuring that it's because |
@arosiclair, @eVoloshchak, @zanyrenney Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Someone from SWM will also take a look at this to make sure we understand the root cause properly cc @j-piasecki @Kicu |
This comment was marked as outdated.
This comment was marked as outdated.
Opened Expensify/react-native-live-markdown#590 PR, tagged @tomekzaw as I'm not sure how review is handled there. Once that PR is merged, will sync up with the team in order to follow up with the version bump PR on E/App. |
E/App PR #54326 is open and ready for review! 🚀 Note: From @arosiclair I think an Android: Native build on the PR would facilitate testing and help ensure the fix works as expected before we merge the PR. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.79-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2025-01-07. 🎊 For reference, here are some details about the assignees on this issue:
|
@eVoloshchak / @ikevin127 @zanyrenney @eVoloshchak / @ikevin127 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
cc @zanyrenney for visibility |
As per the melvin comment @ikevin127 @eVoloshchak the checklist needs to be completed before payout. |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test Proposal
Do we agree 👍 or 👎. |
@zanyrenney Weird, didn't know that the payment cannot be completed for the Contributor (PR author) unless the C+ checklist is completed (which is usually C+ reviewer's responsability).
As quoted above, #53645 (comment) doesn't mention anything about payment but I guess one can argue that Here's a recent example of issue where I got paid as Contributor (PR author) but the C+ didn't get paid yet because they did not complete their checklist. Anyway, I completed the checklist myself, thanks for working with us on this! 🙏 |
Contributor: @ikevin127 paid $250 via Upwork Test case created Reckon we're all done here. 👀 here too on the PR, in case it was missed
|
$250 approved for @eVoloshchak |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.72-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: #53367
Email or phone of affected tester (no customers): applausetester+kh16110001@applause.expensifail.com
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
The description field will show live mark down for the content with mark down
Actual Result:
Live mark down is not rendered when Description field is opened after saving it
The same issue also happens in Private notes, room description and workspace description
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6685420_1733421229321.1733421098511_Screen_Recording_20241206_015121_Expensify.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @zanyrenneyThe text was updated successfully, but these errors were encountered: