-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Hide mention suggestions while opening file picker #19541
Conversation
@0xmiroslav I could use a little help here, this works perfectly on desktop browsers however I'm facing some issues on mobile web (tested on android chrome). I noticed (for me at least), on mobile browsers the composer is not focused before the file picker is opened like it does on desktop browsers ( I believe this is the reason the composer's App/src/pages/home/report/ReportActionCompose.js Line 1085 in 0925c25
Replacing Bug outputNotice how the suggestions list doesn't show up event on multiple taps (until screen-20230526-132808.mp4 |
@0xmiroslav alright I figured it out.
I'll be proceeding with these changes. I'd just like to confirm with @jjcoffee (the person who wrote this code), was there any reason for the |
@therealsujitk No, I think it just being there for mWeb sounds about right to me! |
@therealsujitk let's keep same behavior as emoji suggestions for now. Rest things can be out of scope if already happening on main. |
deprecate |
I tested on Safari and there was a similar issue to the one I mentioned above (It's on staging as well). It appears the PR (#18227) was not tested properly. I fixed it by manually calling Screen.Recording.2023-05-26.at.5.27.51.PM.mov |
@pecanoro @0xmiroslav PR is ready for review. |
onSelectionChange(e) { | ||
LayoutAnimation.configureNext(LayoutAnimation.create(50, LayoutAnimation.Types.easeInEaseOut, LayoutAnimation.Properties.opacity)); | ||
this.setState({selection: e.nativeEvent.selection}); | ||
if (!this.state.value || e.nativeEvent.selection.end < 1) { | ||
this.resetSuggestions(); | ||
|
||
if (e) { | ||
this.setState({selection: e.nativeEvent.selection}); | ||
if (!this.state.value || e.nativeEvent.selection.end < 1) { | ||
this.resetSuggestions(); | ||
this.shouldBlockSuggestionsCalc = false; | ||
return; | ||
} | ||
} | ||
|
||
if (this.shouldBlockSuggestionsCalc) { | ||
this.shouldBlockSuggestionsCalc = false; | ||
return; | ||
} | ||
|
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 like this change. When click composer, calculateEmojiSuggestion
and calculateMentionSuggestion
is called 2 times always.
It's already known issue that onSelectionChange
is not called on web when composer focused so can be out of scope.
Let's keep this PR simple as possible.
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 you want me to remove it I can, but keep in mind that after I do the issue I mentioned will occur for mWeb, desktop, macOS browsers. Is that fine?
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.
It's already happening on main right?
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.
Yes, except the mWeb issue occurs more now for some reason. It was working previously by luck because of where it was placed in the code.
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.
can you share 2 videos on mWeb ? from main and from this 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.
Understood I'll make the changes! I'd prefer if we create a separate issue for this and don't just forget about it because it seems like bad code. I probably won't work on it thought, this has given me quite a headache 😅.
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.
Understood I'll make the changes! I'd prefer if we create a separate issue for this and don't just forget about it because it seems like bad code. I probably won't work on it thought, this has given me quite a headache 😅.
cc: @pecanoro
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 think that refactor work will be done by someone who is working on #16263.
There will be many obstacles while converting this component to functional.
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.
ok, let's put that code at the top of both functions
Ah, we can't do this 😞. The calculateEmojiSuggestion
function is first called when shouldBlockSuggestionsCalc
is true
. It sets it to false
and returns, immediately after calculateMentionSuggestion
is called which is set to false
because of calculateEmojiSuggestion
so it doesn't return even though it should.
To solve this we'll need two variables shouldBlockEmmojiCalc
& shouldBlockMentionCalc
. Should I proceed?
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.
yes
@therealsujitk steps are incomplete in Tests/QA steps |
Updated 👍 |
We usually use "Verify" term than "Ensure" |
Updated 👍 |
|
Updated 👍 |
Bug on native: Screen.Recording.2023-05-26.at.5.44.54.PM.movI confirmed that this also happens on production so out of scope |
Bug on mSafari: msafari.movThis is happening to emoji suggestions list on production |
Yeah, this is related to the issue we were discussing for hours. So, out of scope. |
@pecanoro can you please confirm above bugs can be out of scope?
All of these already happen to emoji suggestions list on production app |
@pecanoro friendly bump. Edit: Sorry, I didn't know it was a holiday. |
@pecanoro do you think you could review this PR today? |
Yes! Reviewing the PR today, sorry for the delay! |
I read the whole discussion and tested it, but I am still a bit unsure why we can't fix the mentions not showing up after closing the attachment modal. If the same bug was present for the platforms, we should fix them all. I feel we are changing just one bug (half-height) for another one (completely hidden) |
We can fix here but it's beyond the accepted proposal. And need more research for ideal solution to fix Safari, mWeb issues.
|
As of now we don't have a good solution to fix the out-of-scope bugs, the only one I could come up with until now is to call This PR simply keeps the behaviour of the mention suggestion list consistent with the emoji suggestion list and doesn't introduce any new bugs. |
Ok, ok! You guys convinced me. But the bug needs to be reported so we can develop a solution. And maybe even post in the original PR to let them know it didn't work as expected. |
@0xmiroslav We need the checklist before I can merge it. |
Sure! I will report bug in slack soon |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari.movDesktopdesktop.moviOSios.movAndroidandroid.mov |
@pecanoro friendly bump. |
✋ 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/pecanoro in version: 1.3.23-0 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/pecanoro in version: 1.3.23-0 🚀
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.23-7 🚀
|
1 similar comment
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.23-7 🚀
|
Details
We already use a state variable
shouldBlockEmojiCalc
to prevent the emoji suggestions list from opening while the file picker is being opened. This PR simply renames this variable toshouldBlockSuggestionsCalc
and applies it to both emoji and mention suggestions.Fixed Issues
$ #18992
PROPOSAL: #18992 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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
Screencast.from.24-05-23.08.19.45.PM.IST.webm
Mobile Web - Chrome
screen-20230526-152932.mp4
Mobile Web - Safari
VID-20230526-WA0002.mp4
Desktop
Screen.Recording.2023-05-26.at.5.45.36.PM.mov
iOS
Android
screen-20230525-122013.mp4