-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use search #2235
base: develop
Are you sure you want to change the base?
Use search #2235
Conversation
This ensures we build upon the new search abstraction, built via bpmn-io/diagram-js#916.
Test failures are due to the fact that we break the existing contract: We don't return un-matched tokens anymore. |
Depends on bpmn-io/diagram-js#932 to be fixed. |
Also depends on / users would benefit from restoring fuzzy search. |
I'm not sure I understand the prior behavior and its problems well enough to comment. Any chance I could get a demo with some explanation? Thank you! |
@lmbateman I'll give you a demo once I'm close to merging this, but it is important to me to mention you, so you're aware of UX improvement in search (popup menu, and global search). |
Proposed Changes
This plugs into the new
search
utility shipped with bpmn-io/diagram-js#916 / [email protected].Some observations:
The search syntax and what is required by
search-pad
are incompatible, and require manual conversion. This is inconvenient. I do regard the new format (token = { value, matched: boolean }
) to be supperior. Maybe we could makeSearchPadProvider
compatible with it?search
only returns tokens where they exist. This is inconvenient and requires me to manually check if tokens are return. Example: I test objects of the form{ name: string }
for the keylabel
, and expect the result to contain{ tokens: { label: [ ... ] } }
regardless of whether any of the objects had a label property. Today,undefined
is returned and must be accounted for.We only return matched tokens, and do not return what did not match. This leads to changes in the output (it does no longer show previously visible information (i.e. the ID, whether or not it matched):
Overall we can see that this is quite an improvement, removing the heavy matching / tokenization from implementors. Great job 🎖️
Checklist
To ensure you provided everything we need to look at your PR:
@bpmn-io/sr
toolCloses {LINK_TO_ISSUE}
orRelated to {LINK_TO_ISSUE}
Depends on bpmn-io/diagram-js#932