-
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] Saved search - Selected saved search is no longer highlighted after changing sorting #49227
Comments
Triggered auto assignment to @johncschuster ( |
Triggered auto assignment to @robertjchen ( |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
Job added to Upwork: https://www.upwork.com/jobs/~021835414058564092667 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
Edited by proposal-police: This proposal was edited at 2024-09-15 20:55:16 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Saved search - Selected saved search is no longer highlighted after changing sorting What is the root cause of that problem?When sorting is applied, the hash is changed and App/src/pages/Search/SearchTypeMenu.tsx Line 107 in 0c618ac
What changes do you think we should make in order to solve the problem?We should compare the query instead of the hash. focused: item.query === SearchUtils.getSearchHeaderTitle(queryJSON, personalDetails, cardList, reports, taxRates), OPTIONAL: We can create or rename What alternative solutions did you explore? (Optional)
const isCannedQuery = SearchUtils.isCannedSearchQuery(queryJSON);
const activeItemIndex = isCannedQuery ? typeMenuItems.findIndex((item) => item.type === type) : -1;
const searchHeaderTitle = SearchUtils.getSearchHeaderTitle(queryJSON, personalDetails, cardList, reports, taxRates);
const title = isCannedQuery ? undefined : searchHeaderTitle;
const savedSearchesMenuItems = () => {
if (!savedSearches) {
return [];
}
return Object.entries(savedSearches).map(([key, item]) => createSavedSearchMenuItem(item as SaveSearchItem, key, shouldUseNarrowLayout, searchHeaderTitle));
};
// In createSavedSearchMenuItem
focused: item.query === searchHeaderTitle, What alternative solutions did you explore? (Optional 2)
const queryStringWithoutSorting = queryJSON.inputQuery
.split(' ')
.filter((e) => !e.startsWith('sort') && e)
.join(' ');
const createSavedSearchMenuItem = useCallback(
(item: SaveSearchItem, key: string, isNarrow: boolean) => {
const baseMenuItem: SavedSearchMenuItem = {
key,
title: item.name,
hash: key,
query: item.query,
shouldShowRightComponent: true,
focused: item.query === queryStringWithoutSorting, Result |
Proposal updated
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Selected saved search is no longer highlighted after changing sorting What is the root cause of that problem?when comparing the current filter with saved filter, we take hash of the search query in url which includes sort field. App/src/pages/Search/SearchTypeMenu.tsx Line 107 in 0c618ac
What changes do you think we should make in order to solve the problem?Update here to use queryString obtained from current filter and compare it with saved query const [searchAdvancedFilters = {} as SearchAdvancedFiltersForm] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM);
const queryString = useMemo(() => SearchUtils.buildQueryStringFromFilterValues(searchAdvancedFilters) || '', [searchAdvancedFilters]); focused: item.query === queryString, What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
Proposal Updated
|
I think this behavior is expected for now. Once we change anything about the saved search, it is no longer the saved search you created, so I think it's expected that we don't highlight it anymore. Especially once we add the search bar and users can specify the column and order they want to search by. |
Gonna close this for now. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.35-0
Reproducible in staging?: Y
Reproducible in production?: N/A - new feature, doesn't exist in prod
Email or phone of affected tester (no customers): applausetester+khcategory16@applause.expensifail.com
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
The selected saved search should remain highlighted after changing sorting because the filters remain unchanged.
Actual Result:
The selected saved search is no longer highlighted after changing sorting.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6604617_1726423204848.20240914_102752.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @sobitneupaneThe text was updated successfully, but these errors were encountered: