-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Initial frontend search proof of concept with Fuse.js #3435
Conversation
Removed vultr server and associated DNS entries |
e64dec4
to
2cf94a8
Compare
@RODO94 @jessicamcinchak - Still plenty of TODO comments, and outstanding tasks + some planx-core / flow navigation questions for the next dev call, but I'm opening this up for review just now to get feedback on the code that's here. Once I've resolved a few questions on theopensystemslab/planx-core#462 (which this PR relies on) we can progress this (still feature flagged) to |
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.
Hiya! Great to spend time looking through the code here, and my comments are just clarifying how it all works. I can cast a more critical eye once it's clear to me, really appreciate the early review request.
## What? - Adds a required `parentId` property to `IndexedNode` - Updates `sortFlow()` logic to match PlanX graph structure ## Why? - Implemented in theopensystemslab/planx-new#3435 - For navigation to a node to work from search, we need to know the "path" through the graph to a node - Currently `sortFlow()` returns an optional `parentId`, despite all nodes having a parent (apart from the root node). It's more accurate to give all nodes a parent. This makes things a bit easier when constructing a path (upcoming PR) - The current implementation of `sortFlow()` doesn't quite match our graph structure. When reaching the next child of the root node, the current parentId is maintained instead of falling back to the root. This worked well for treating the graph as a linear structure to split it up be portal names (pseudo sections), but doesn't work in terms of actually describing the hierarchy of the graph (required to build a valid PlanX URL). - **The difference really comes down to "previous node" vs. "parent node"** - The flow will still retain the same sorted order, `root.edges[0]` → `root.edges[1]` → `root.edges[2]` → etc Note: This should not impact any current functionality. `sortFlow()` and `findNextNodeOfType()` are not used anywhere in PlanX currently. ### Example - I have a root node with two edges - I navigate through the branches of the first edges until there are no more edges - My next step will be the second edge of the root node - **Currently:** The parentId for `root.edges[1]` will be set to the very final node of `root.edges[0]` (previous node) - **This PR:** The parentId for `root.edges[1]` will be set to "_root" (parent node)
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.
Very cool prototype - happy for this to merge whenever since feature-flagged !
What does this PR do?
useSearch()
hook as a facade for this libraryWhy search in the frontend?
Why Fuse.js?
Next steps...
I'll pick up the below as follow up PRs -
getPathForFlow()
planx-core#463data.fn
anddata.val
Screen.Recording.2024-07-19.at.16.52.26.mov