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

Use search #2235

Merged
merged 4 commits into from
Nov 5, 2024
Merged

Use search #2235

merged 4 commits into from
Nov 5, 2024

Conversation

nikku
Copy link
Member

@nikku nikku commented Sep 13, 2024

Proposed Changes

This plugs into the new search utility shipped with bpmn-io/diagram-js#916 / [email protected], now updated and fixed via bpmn-io/diagram-js#932:

capture iXVRwy_optimized

Try out via

npx @bpmn-io/sr bpmn-io/bpmn-js#use-search

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

Depends on bpmn-io/diagram-js#932

@nikku

This comment was marked as outdated.

@nikku

This comment was marked as outdated.

@nikku

This comment was marked as outdated.

@nikku nikku requested a review from lmbateman October 10, 2024 14:03
@lmbateman

This comment was marked as outdated.

@nikku

This comment was marked as outdated.

@nikku nikku added the ready Ready to be worked on label Oct 11, 2024 — with bpmn-io-tasks
@nikku nikku removed the in progress Currently worked on label Oct 11, 2024
nikku added a commit to bpmn-io/diagram-js that referenced this pull request Oct 31, 2024
We ensure that for every entry that is a match we _always_ provide
tokens. This ensures that a user can rely on these tokens being there,
i.e. to render the results.

Related to bpmn-io/bpmn-js#2235
nikku added a commit to bpmn-io/diagram-js that referenced this pull request Oct 31, 2024
This ensures we properly handle fuzzy results (again), i.e. when
providing multiple search strings, return results that match on a
best effort basis, rather than being overly strict:

items = [ 'foo', 'bar' ]
search = 'foo bar'
result = [ 'foo', 'bar' ]

The tokens allow folks to make sense of the actual parts of the results
matched, and allow them to refine the search as they see fit.

Along with this results are still scored, i.e. most reasonable results
are first shown to the users.

Related to bpmn-io/bpmn-js#2235
nikku added a commit to bpmn-io/diagram-js that referenced this pull request Oct 31, 2024
We ensure that for every entry that is a match we _always_ provide
tokens. This ensures that a user can rely on these tokens being there,
i.e. to render the results.

Related to bpmn-io/bpmn-js#2235
nikku added a commit to bpmn-io/diagram-js that referenced this pull request Oct 31, 2024
This ensures we properly handle fuzzy results (again), i.e. when
providing multiple search strings, return results that match on a
best effort basis, rather than being overly strict:

items = [ 'foo', 'bar' ]
search = 'foo bar'
result = [ 'foo', 'bar' ]

The tokens allow folks to make sense of the actual parts of the results
matched, and allow them to refine the search as they see fit.

Along with this results are still scored, i.e. most reasonable results
are first shown to the users.

Related to bpmn-io/bpmn-js#2235
nikku added a commit to bpmn-io/diagram-js that referenced this pull request Oct 31, 2024
We ensure that for every entry that is a match we _always_ provide
tokens. This ensures that a user can rely on these tokens being there,
i.e. to render the results.

Related to bpmn-io/bpmn-js#2235
nikku added a commit to bpmn-io/diagram-js that referenced this pull request Oct 31, 2024
This ensures we properly handle fuzzy results (again), i.e. when
providing multiple search strings, return results that match on a
best effort basis, rather than being overly strict:

items = [ 'foo', 'bar' ]
search = 'foo bar'
result = [ 'foo', 'bar' ]

The tokens allow folks to make sense of the actual parts of the results
matched, and allow them to refine the search as they see fit.

Along with this results are still scored, i.e. most reasonable results
are first shown to the users.

Related to bpmn-io/bpmn-js#2235
@nikku
Copy link
Member Author

nikku commented Nov 1, 2024

Upstream fixes most described isses: bpmn-io/diagram-js#932.

Try out the changes via

npx @bpmn-io/sr bpmn-io/bpmn-js#use-search

CC @lmbateman

nikku added a commit to bpmn-io/diagram-js that referenced this pull request Nov 1, 2024
This ensures we properly handle fuzzy results (again),
where parts of the search is matched across different
keys.

This ensures we're not overly strict in filtering things.

Related to bpmn-io/bpmn-js#2235
nikku added a commit to bpmn-io/diagram-js that referenced this pull request Nov 1, 2024
This ensures we properly handle fuzzy results (again),
where parts of the search is matched across different
keys.

This ensures we're not overly strict in filtering things.

Related to bpmn-io/bpmn-js#2235
@nikku nikku added the needs review Review pending label Nov 1, 2024 — with bpmn-io-tasks
@nikku nikku removed the ready Ready to be worked on label Nov 1, 2024
@nikku nikku added the fixed upstream Requires integration of upstream change label Nov 1, 2024 — with bpmn-io-tasks
@nikku nikku removed the needs review Review pending label Nov 1, 2024
nikku added a commit to bpmn-io/diagram-js that referenced this pull request Nov 4, 2024
We ensure that for every entry that is a match we _always_ provide
tokens. This ensures that a user can rely on these tokens being there,
i.e. to render the results.

Related to bpmn-io/bpmn-js#2235
nikku added a commit to bpmn-io/diagram-js that referenced this pull request Nov 4, 2024
This ensures we properly handle fuzzy results (again),
where parts of the search is matched across different
keys.

This ensures we're not overly strict in filtering things.

Related to bpmn-io/bpmn-js#2235
nikku added a commit to bpmn-io/diagram-js that referenced this pull request Nov 4, 2024
We ensure that for every entry that is a match we _always_ provide
tokens. This ensures that a user can rely on these tokens being there,
i.e. to render the results.

Related to bpmn-io/bpmn-js#2235
nikku added a commit to bpmn-io/diagram-js that referenced this pull request Nov 4, 2024
This ensures we properly handle fuzzy results (again),
where parts of the search is matched across different
keys.

This ensures we're not overly strict in filtering things.

Related to bpmn-io/bpmn-js#2235
nikku added a commit to bpmn-io/diagram-js that referenced this pull request Nov 4, 2024
We ensure that for every entry that is a match we _always_ provide
tokens. This ensures that a user can rely on these tokens being there,
i.e. to render the results.

Related to bpmn-io/bpmn-js#2235
nikku added a commit to bpmn-io/diagram-js that referenced this pull request Nov 4, 2024
This ensures we properly handle fuzzy results (again),
where parts of the search is matched across different
keys.

This ensures we're not overly strict in filtering things.

Related to bpmn-io/bpmn-js#2235
@nikku nikku added the needs review Review pending label Nov 4, 2024 — with bpmn-io-tasks
@nikku nikku removed the fixed upstream Requires integration of upstream change label Nov 4, 2024
@nikku nikku marked this pull request as ready for review November 4, 2024 20:48
@nikku nikku added the ux label Nov 4, 2024
@nikku
Copy link
Member Author

nikku commented Nov 4, 2024

Previous observations, addressed by this PR as well as bpmn-io/diagram-js#932:


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 make SearchPadProvider 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 key label, 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):

    capture wdEgza_optimized

Overall we can see that this is quite an improvement, removing the heavy matching / tokenization from implementors. Great job 🎖️

@nikku nikku requested review from a team, jarekdanielak and abdul99ahad and removed request for a team November 4, 2024 20:54
Copy link
Contributor

@philippfromme philippfromme left a comment

Choose a reason for hiding this comment

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

Great stuff! Glad to see this in bpmn-js finally! 🥇

@nikku nikku merged commit 911dbae into develop Nov 5, 2024
12 checks passed
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Nov 5, 2024
@nikku nikku deleted the use-search branch November 5, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants