Skip to content

CUMULUS-4122: prefix vs infix searching in dashboard #1213

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

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from

Conversation

acyu
Copy link
Contributor

@acyu acyu commented Jul 2, 2025

Summary: Summary of changes

Addresses CUMULUS-4122: prefix vs infix searching in dashboard

Changes

  • Add new toggle for user to choose between prefix/infix search on Granule ID
  • Update Dashboard granule ID search query based on prefix/infix toggle

PR Checklist

  • Update CHANGELOG
  • Unit tests
  • Adhoc testing
  • Integration tests

@acyu acyu marked this pull request as draft July 2, 2025 04:38
@acyu acyu marked this pull request as ready for review July 16, 2025 19:34
@acyu acyu marked this pull request as draft July 17, 2025 17:28
@acyu acyu added the Needs Review Looking for a reviewer label Jul 18, 2025
@etcart etcart marked this pull request as ready for review July 18, 2025 13:35
@etcart etcart added In Review and removed Needs Review Looking for a reviewer labels Jul 18, 2025
if (typeof infix === 'undefined') {
dispatch(action(initialValueRef.current));
} else {
dispatch(action({ search: initialValueRef.current, infix }));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recognizing that: this does work, I've deployed and tested it and it appears to do what it's supposed to.
what's happening here? why is there not parity between infix and prefix searching here? how does infix become undefined? (I see that we're setting it to null below, although maybe I'm looking at the wrong source) and why does {value} vs {search: value} work?

Copy link
Contributor Author

@acyu acyu Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • what's happening here? how does infix become undefined? (I see that we're setting it to null below, although maybe I'm looking at the wrong source)
    Search component is been used on multiple views, and since toggle is only on view with granule id search, I modify Search to check for infix property. On view where I don't have infix toggle such as Collection list, I expect the Search infix property to be undefined and dispatch action like how it was originally.

  • why does {value} vs {search: value} work?
    The search granule action originally looks like this
    export const searchGranules = (infix) => ({ type: types.SEARCH_GRANULES, infix });
    where the search value pass to searchGranule was expecting to be used in infix search. I have to modify the searchGranule to accept 2 parameters, one is search that holds the search value and infix becomes bool that holds the toggle value.
    Other search method remain unchanged, that's why I had to differenitate with if (typeof infix === 'undefined') so other search method will still receive infix as search value intead.

  • why is there not parity between infix and prefix searching here?
    I am actually not sure what you mean by this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I am looking at this again, maybe it's better to change search method like searchCollections from
export const searchCollections = (infix) => ({ type: types.SEARCH_COLLECTIONS, infix });
to
export const searchCollections = ({ search, infix }) => ({ type: types.SEARCH_COLLECTIONS, search, infix });
and always pass infix = true on views without the actual toggle so Search doesn't have to check infix == undefined?
I am not sure which way is better

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there enot parity:
I would expect the base syntax to look the same
a = b({.......infix: infix})
vs
a = b({ ......prefix: prefix})

since what's arriving on the other end of the process to the api is a thing that unpacks prefix and/or infix and performs a search.
it's suspicious that there isn't a parallel between the two, and either prefix or infix is handled like it's an edge case.
now I do understand that elsewhere int eh dashboard we're using infix, and so the prefix is a special case, but it still feels suspicious

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants