Closed jmartinesp closed 10 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
b9fca08
) 89.40% compared to head (73430cb
) 89.35%. Report is 3 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Can I get another review for this PR? I added tests for checking the text + selection restoration, as well as keeping the right line count. I also tested it on EXA and it seems to work fine.
Kudos, SonarCloud Quality Gate passed!
I found 2 more bugs in the interop between Compose and the AndroidView:
When restoring state in- this was fixed in Rust. In any case, I believe this state restoration is not needed because the state is kept at theRealEditor
'sAndroidView
, for some reason if there is a single NSBP char at the end of the HTML it'll just remove it, and it can cause crashes because the selection may become invalid.ComposerModel
and the text and selection are restored in theEditorEditText.onRestoreInstanceState
method. This should fix the crashes we're seeing in EXA when a mention is added.factory
contents run before thisonRestoreInstanceState
runs, so there's no way to know if we're dealing with a restoration, AFAICT, so by the time we're adding the text changed listener on the factory the state hasn't been restored and thelineCount
will always be 0, which in turn will trigger a recomposition of the whole component, and then another one once we have the rightlineCount = 1
value. I changed the code to only take into accountlineCount
if it's > 0, which should fit our usage since we don't care about value 0 (the edittext being empty).