-
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
[$250] Search - Search tabs are blank instead of showing empty state in offline mode #47604
Comments
We think that this bug might be related to #wave-collect - Release 1 |
Triggered auto assignment to @garrettmknight ( |
@garrettmknight FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
ProposalPlease re-state the problem that we are trying to solve in this issue.Search - Search tabs are blank instead of showing empty state in offline mode What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?We should remove What alternative solutions did you explore? (Optional)
TO: const ListItem = SearchUtils.getListItem(type, status);
const data = SearchUtils.getSections(type, status, searchResults?.data ?? [], searchResults?.search ?? []);
const sortedData = SearchUtils.getSortedSections(type, status, data, sortBy, sortOrder);
const sortedSelectedData = sortedData.map((item) => mapToItemWithSelectionInfo(item, selectedTransactions, canSelectMultiple)); Updated Code const type = (searchResults?.search?.type ?? queryType) as SearchDataTypes;
const isValidType = SearchUtils.isSearchDataType(type);
if (searchResults === undefined && !isValidType) {
Log.alert('[Search] Undefined search type');
return null;
}
const ListItem = SearchUtils.getListItem(type, status);
const data = SearchUtils.getSections(type, status, searchResults?.data ?? {}, searchResults?.search ?? []);
const sortedData = SearchUtils.getSortedSections(type, status, data, sortBy, sortOrder);
const sortedSelectedData = sortedData.map((item) => mapToItemWithSelectionInfo(item, selectedTransactions, canSelectMultiple));
const shouldShowEmptyState = !isDataLoaded || data.length === 0;
if (shouldShowEmptyState) {
return (
<>
<SearchPageHeader
isCustomQuery={isCustomQuery}
queryJSON={queryJSON}
hash={hash}
/>
<EmptySearchView type={type} />
</>
);
} OPTIONAL: We can also use |
ProposalPlease re-state the problem that we are trying to solve in this issue.Search tabs display blank instead of showing an empty state in offline mode. What is the root cause of that problem?We return empty component when the searchResults and type undefined App/src/components/Search/index.tsx Lines 208 to 211 in 62722e8
What changes do you think we should make in order to solve the problem?If searchResults and type are undefined, it means the loading process hasn't started. In this case, it's better to display a loading skeleton instead of an empty state. However, if loading has started once and we reload it offline, then we can show an empty state. Instead of returning empty component, I think this logic Move up the logic and show loading state instead of empty component. const type = SearchUtils.getSearchType(searchResults?.search);
const isDataLoaded = searchResults?.data !== undefined;
const shouldShowLoadingState = (!isOffline && !isDataLoaded) || (searchResults === undefined || type === undefined); What alternative solutions did you explore? (Optional)N/A |
ProposalPlease re-state the problem that we are trying to solve in this issue.Search tabs are blank in offline mode. What is the root cause of that problem?When we didn't call App/src/components/Search/index.tsx Lines 115 to 122 in 62722e8
In there, App/src/components/Search/index.tsx Line 177 in 62722e8
so we display empty view: App/src/components/Search/index.tsx Lines 208 to 211 in 62722e8
What changes do you think we should make in order to solve the problem?When we haven't called When we are in offline, we should not display the loading state because the loading state is used to indicates that we're trying to load something, but infact we're not actually loading anything as user is offline. Based on the above, we should display the offline page, indicating that user is offline and we're unable to load. It is our pattern D in the Offline UX. So just need to update: App/src/components/Search/index.tsx Line 210 in 62722e8
to:
DemoWhat alternative solutions did you explore? (Optional)We can update: App/src/components/Search/index.tsx Lines 208 to 211 in 62722e8
if (searchResults === undefined) {
return (
<>
<SearchPageHeader
isCustomQuery={isCustomQuery}
queryJSON={queryJSON}
hash={hash}
/>
<EmptySearchView />
</>
);
}
if (type === undefined) {
Log.alert('[Search] Undefined search type');
return null;
} |
Job added to Upwork: https://www.upwork.com/jobs/~0105023dd56503c746 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale ( |
@garrettmknight, @akinwale Huh... This is 4 days overdue. Who can take care of this? |
@akinwale can you take a look at these proposals? |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@dominictb's proposal is the best approach here. 🎀👀🎀 C+ reviewed. |
Triggered auto assignment to @puneetlath, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @akinwale 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @dominictb 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Sorry, I see that in those pages we have option to add the tags. |
@garrettmknight This hit production on Sep 11 on should be ready for payment today. #48791 (comment) |
This issue has not been updated in over 15 days. @puneetlath, @garrettmknight, @akinwale, @dominictb eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
Payment Summary:
|
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: v9.0.21-3
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Search tabs will show empty state instead of blank in offline mode (previous behavior).
Actual Result:
Search tabs are blank in offline mode.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6574888_1723925312307.20240818_040635.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @garrettmknightThe text was updated successfully, but these errors were encountered: