-
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
fix: Workflows - Offline indicator is present below the last option instead of page bottom. #42019
fix: Workflows - Offline indicator is present below the last option instead of page bottom. #42019
Conversation
…nstead of page bottom. Signed-off-by: Krishna Gupta <belivethatkg@gmail.com>
@hoangzinh 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] |
Signed-off-by: Krishna Gupta <belivethatkg@gmail.com>
Signed-off-by: Krishna Gupta <belivethatkg@gmail.com>
Signed-off-by: Krishna Gupta <belivethatkg@gmail.com>
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.
Sorry for late review. Overall looks good, just some feedbacks
src/hooks/useArrowKeyFocusManager.ts
Outdated
useEffect(() => { | ||
setFocusedIndex(initialFocusedIndex); | ||
}, [initialFocusedIndex]); | ||
|
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.
why do we need this change @Krishna2323?
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.
There was a focus issue with the newly selected option. Although I don't completely remember the exact bug. I removed this code as I can't reproduce any bug like that.
{isMonthlyFrequency && item.keyForList === CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MONTHLY ? monthlyFrequencyDetails() : null} | ||
</> | ||
); | ||
const autoReportingFrequencyItems: WorkspaceAutoReportingFrequencyPageItem[] = Object.keys(getAutoReportingFrequencyDisplayNames(preferredLocale)).map((frequencyKey) => { |
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.
we can put it into a memo to memorize this output
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 this is necessary, but if we decide to use memo, we would also need to wrap monthlyFrequencyDetails
and getDescriptionText
in useCallback.
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.
uhm, let's keep it as it's
text: getAutoReportingFrequencyDisplayNames(preferredLocale)[frequencyKey as AutoReportingFrequencyKey] || '', | ||
keyForList: frequencyKey, | ||
isSelected, | ||
footerComponent: isMonthlyFrequency && frequencyKey === CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MONTHLY ? monthlyFrequencyDetails() : null, |
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.
footerComponent: isMonthlyFrequency && frequencyKey === CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MONTHLY ? monthlyFrequencyDetails() : null, | |
FooterComponent: isMonthlyFrequency && frequencyKey === CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MONTHLY ? monthlyFrequencyDetails() : null, |
If it's a component we should name it capitalize
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.
@hoangzinh, we use camelCase for components as well, and instead of component we use content, so I replaced footerComponent
with footerContent
.
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 doesn't show footerContent when I select "Monthly" option. Could you take a look?
Screen.Recording.2024-05-21.at.22.23.44.mov
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.
@hoangzinh, maybe you don't have access, I just removed that check for testing.
const canUseDelayedSubmission = Permissions.canUseWorkflowsDelayedSubmission(betas); |
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.
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.
hmm, sorry there was a typo, I forgot to update footerComponent
to footerContent
in one place. Fixed now.
Signed-off-by: Krishna Gupta <belivethatkg@gmail.com>
Signed-off-by: Krishna Gupta <belivethatkg@gmail.com>
Hi @Krishna2323 in your test cases, I think instead of "For devices with width <800" we can say "On mWeb/native apps" |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-05-23.at.22.29.57.android.movAndroid: mWeb ChromeScreen.Recording.2024-05-23.at.22.31.32.android.chrome.moviOS: NativeScreen.Recording.2024-05-23.at.22.26.13.ios.moviOS: mWeb SafariScreen.Recording.2024-05-23.at.22.23.43.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2024-05-23.at.22.12.35.web.movMacOS: DesktopScreen.Recording.2024-05-23.at.22.13.34.desktop.mov |
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
We did not find an internal engineer to review this PR, trying to assign a random engineer to #41326 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
Oops, PR has conflict, can you help resolve it? @Krishna2323 |
…a2323/issue/41326
Conflicts resolved. |
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
Looks good to me, but you've got conflicts now. |
…a2323/issue/41326
…a2323/issue/41326
@puneetlath, conflicts resolved. |
@puneetlath, friendly bump to merge 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.
Sorry for the delay. Lots going on. One comment.
@@ -427,7 +427,8 @@ function BaseSelectionList<TItem extends ListItem>( | |||
shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow} | |||
// We're already handling the Enter key press in the useKeyboardShortcut hook, so we don't want the list item to submit the form | |||
shouldPreventEnterKeySubmit | |||
rightHandSideComponent={rightHandSideComponent} | |||
// Change this because of lint |
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 leave a better comment here? I'm not sure what this means.
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.
@puneetlath, we haven't changed or added any prop to ListItem
, we only wrapped it with <></>
and added {item.footerContent && item.footerContent}
below it
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.
Yeah, makes sense. But since we're touching this code, let's still make this comment better while we're here. To leave the code in a better place than when we found it.
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.
Merged main and that part is removed now.
Signed-off-by: Krishna Gupta <belivethatkg@gmail.com>
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
fix: Workflows - Offline indicator is present below the last option instead of page bottom.
data={autoReportingFrequencyItems} | ||
renderItem={renderItem} | ||
keyExtractor={(item: WorkspaceAutoReportingFrequencyPageItem) => item.text} | ||
<SelectionList |
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.
Coming from this #47574
Since we don't pass shouldUpdateFocusedIndex we don't see selected background after selecting Submission frequency as monthly
Details
Fixed Issues
$ #41326
PROPOSAL: #41326 (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 methodSTYLE.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 and/or tagged@Expensify/design
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
android_native.mp4
Android: mWeb Chrome
android_chrome.mp4
iOS: Native
ios_native.mp4
iOS: mWeb Safari
ios_safari.mp4
MacOS: Chrome / Safari
web_chrome.mp4
MacOS: Desktop
desktop_app.mp4