-
-
Notifications
You must be signed in to change notification settings - Fork 185
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:persistent (#201) #205
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/timc/kbar/Gaa229xJthkdLmXtxQ9yFE7qy591 |
Hey! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Thanks for putting this together @careless10! How did you end up going about this in your project? We just hit this very same issue where the We ended up copying over the Here's a snippet of the changes we ended up with: ...
export function useMatches() {
...
const [filtered, permanent] = React.useMemo(() => {
const [filtered, permanent] = _.partition(rootResults, (action) => {
// This is our own custom field so we have to ignore it
// @ts-ignore
return action.permanent !== true;
});
if (emptySearch) {
return [filtered, permanent];
}
return [getDeepResults(filtered), permanent];
}, [getDeepResults, rootResults, emptySearch]);
const fuse = React.useMemo(() => new Fuse(filtered, fuseOptions), [filtered]);
const matches = useInternalMatches(filtered, search, fuse).concat(
permanent.map((action) => ({ score: 1, action }))
);
...
}
... I was going to open up a PR when I came across yours. @timc1 any chance we can get something like this reopened and on the roadmap? |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hey! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Looks like this PR stalled out again. Is there anything I can do to help move this along? |
Adding a new attribute "persistent" to actions which keeps the item in the list regardless of what the search query value is,
can be helpful for items that are a response from a backend and related to the search query business wise but not keyword wise.
Suggestions are appreciated.