Skip to content
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

BED-5445: Deep linking node search #1182

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

maffkipp
Copy link
Contributor

@maffkipp maffkipp commented Feb 27, 2025

Description

Adds single node search functionality to our deep linking implementation on the Explore page. This feature can be tested by enabling the back_button_support feature flag. Some other aspects of the Explore page (particularly pathfinding search) may appear temporarily broken when this flag is enabled.

Motivation and Context

First search type implemented in the larger deep linking initiative.

This PR addresses: BED-5455

How Has This Been Tested?

Tests have been added to cover the useNodeSearch hook that wraps the new query param interactions.

Screenshots (optional):

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

Copy link
Contributor

@benwaples benwaples left a comment

Choose a reason for hiding this comment

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

This looks great!! I like the organization and how you did useNodeSearch

I left one comment on a potential solution for the missing adornment! But if we determine its not feasible/doesnt make sense im happy to stamp this as is

Comment on lines +32 to +33
const graphQuery = nodeSearchGraphQuery({ primarySearch, searchType });
const { data: graphData } = useQuery(graphQuery);
Copy link
Contributor

Choose a reason for hiding this comment

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

good call keeping this! I realized that if we did use the useExploreGraph directly here then the matchedNode below may not return the node that was searched for in the case where the current searched for node doesnt return in the graph results.

Copy link
Contributor

@benwaples benwaples left a comment

Choose a reason for hiding this comment

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

Couple comments about build/tests, but functionality is great! Thank you!

import { useQuery } from 'react-query';
import { SearchValue } from '../../../store';
import { useExploreParams } from '../../useExploreParams';
import { nodeSearchGraphQuery } from '../queries';
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this introduces a circular dep, I think we just need to specify the import from ../queries/nodeSearch

dispatch(searchbarActions.sourceNodeEdited(edit));
const handleNodeSelected = (selected?: SearchValue): SourceNodeSelectedAction =>
dispatch(searchbarActions.sourceNodeSelected(selected));
const { searchTerm, selectedItem, editSourceNode, selectSourceNode } = useNodeSearchSwitch();
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: this will trigger api requests without a handlers in ExploreSearch tests, mind adding mocks? no worries if not, the warning would go away when we clean up feature flag logic for this epic

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

Successfully merging this pull request may close these issues.

2 participants