-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Show join button in the chat header #33791
Show join button in the chat header #33791
Conversation
@abdulrahuman5196 Please 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] |
</View> | ||
{canJoin && isSmallScreenWidth && <View style={[styles.ph5, styles.pb2]}>{joinButton}</View>} | ||
</View> |
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.
This looks like so many changes, but it just changing
from
<View style={[styles.appContentHeader, shouldShowBorderBottom && styles.borderBottom]}
dataSet={{dragArea: true}}>
... (unchanged)
</View>
to
<View style={[shouldShowBorderBottom && styles.borderBottom]} dataSet={{dragArea: true}}>
<View style={[styles.appContentHeader]}>
... (unchanged)
</View>
{join button for small screen)
</View>
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.
Thank you for the reference. This seems to better approach than task button which is existing now, since for small screen we render the task button from ReportScreen and non-small screen we render the task button from HeaderView.
I think in future we should have standard component to render these kind of buttons and their logic.
icon: Expensicons.ChatBubbles, | ||
text: translate('common.leave'), | ||
onSelected: Session.checkIfActionIsAllowed(() => Report.leaveRoom(props.report.reportID, isWorkspaceMemberLeavingWorkspaceRoom)), | ||
}); | ||
} |
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.
Because we need the canJoin
condition to show the Join button, I guess it's better to create canLeave
too to store the leave visibility condition.
Report.updateNotificationPreference(props.report.reportID, props.report.notificationPreference, CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS, false), | ||
)} | ||
/> | ||
); |
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 think it's worth to create a separate component for join button (like task button), so I just put it here.
Yes, we should take it out of the 3-dot menu |
|
aa2c196
to
e76361b
Compare
I think so too, added it back. |
Reviewing now |
@bernhardoj Typescript checks are failing |
Unit test fails on main |
Reviewing now |
@bernhardoj I see an issue where the join button is flickering when we leave. Screen.Recording.2024-01-02.at.2.12.58.PM.mov |
@abdulrahuman5196 the join button shows because you leave the room. |
Got it. It visually seems flickering, but it's actually switching chat which has the join button to chat without join button. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-01-02.at.6.52.33.PM.mp4Android: mWeb ChromeScreen.Recording.2024-01-02.at.6.54.50.PM.mp4iOS: NativeScreen.Recording.2024-01-02.at.6.44.29.PM.mp4iOS: mWeb SafariScreen.Recording.2024-01-02.at.6.49.48.PM.mp4MacOS: Chrome / SafariScreen.Recording.2024-01-02.at.6.10.22.PM.mp4MacOS: DesktopScreen.Recording.2024-01-02.at.6.11.22.PM.mp4 |
@bernhardoj Unit test failure has been fixed in main. Could you kindly do a merge from main, so that all tests pass? |
@abdulrahuman5196 done 👍 |
And a note on QA tests, for me Join or Leave only appears if the thread has a child message. Same in staging as well. |
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.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @srikarparsi
🎀 👀 🎀
C+ Reviewed
src/pages/home/HeaderView.js
Outdated
icon: Expensicons.ChatBubbles, | ||
text: translate('common.join'), | ||
onSelected: Session.checkIfActionIsAllowed(() => | ||
Report.updateNotificationPreference(props.report.reportID, props.report.notificationPreference, CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS, false), |
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 we add , props.report.parentReportID, props.report.parentReportActionID)
as the fifth and sixth parameters of updateNotificationPreference so that the bell icon updates optimistically?
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.
Done
@srikarparsi Hmm, the reassure pass when I ran it locally. Can you help re-run the CI job for reassure, please? |
Changes look good, thank you, re-running tests |
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/srikarparsi in version: 1.4.22-0 🚀
|
🚀 Deployed to staging by https://github.com/srikarparsi in version: 1.4.22-0 🚀
|
Hmm, the code for joining the thread stays the same, that is by sending the current report |
🚀 Deployed to production by https://github.com/thienlnam in version: 1.4.22-6 🚀
|
</View> | ||
{canJoin && isSmallScreenWidth && <View style={[styles.ph5, styles.pb2]}>{joinButton}</View>} |
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 join button should be displayed only if isLoading
if false (Coming from #34820)
Details
We want to show a join button in the chat header.
Fixed Issues
$ #33577
PROPOSAL: #33577 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
(NOTE: if you press back from the concierge chat, you will see the thread chat again and if you try to press Join, it will fail. The BE response said it's because the report doesn't exist anymore, as shown on the iOS recording below, so make sure to reopen the thread chat from the room chat by following step 8)
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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.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
Android: Native
Screen.Recording.2023-12-30.at.12.23.40.mov
Android: mWeb Chrome
Screen.Recording.2023-12-30.at.12.19.13.mov
iOS: Native
Screen.Recording.2023-12-30.at.12.24.44.mov
iOS: mWeb Safari
Screen.Recording.2023-12-30.at.12.20.26.mov
MacOS: Chrome / Safari
Screen.Recording.2023-12-30.at.12.16.44.mov
MacOS: Desktop
Screen.Recording.2023-12-30.at.12.17.16.mov