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

refactor(core): new quick search service #7214

Open
wants to merge 1 commit into
base: eyhn/feat/t_split_split
Choose a base branch
from

Conversation

EYHN
Copy link
Member

@EYHN EYHN commented Jun 13, 2024

No description provided.

Copy link

graphite-app bot commented Jun 13, 2024

Your org has enabled the Graphite merge queue for merging into canary

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Member Author

EYHN commented Jun 13, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @EYHN and the rest of your teammates on Graphite Graphite

@github-actions github-actions bot added mod:infra Environment related issues and discussions mod:i18n Related to i18n test Related to test cases app:core labels Jun 13, 2024
Copy link

nx-cloud bot commented Jun 13, 2024

@EYHN EYHN force-pushed the eyhn/feat/t_split_split_split branch from a775505 to 96ab490 Compare June 13, 2024 07:04
@EYHN EYHN force-pushed the eyhn/feat/t_split_split_split branch from 96ab490 to 1f9b0ef Compare June 13, 2024 07:56
Copy link

codecov bot commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 3.52113% with 411 lines in your changes missing coverage. Please review.

Project coverage is 57.29%. Comparing base (6b570e6) to head (0bc1be3).

Files Patch % Lines
...ontend/core/src/modules/quicksearch/views/cmdk.tsx 3.40% 85 Missing ⚠️
...end/core/src/modules/quicksearch/impls/commands.ts 2.27% 43 Missing ⚠️
.../core/src/modules/quicksearch/utils/highlighter.ts 0.00% 42 Missing ⚠️
...e/src/modules/quicksearch/entities/quick-search.ts 0.00% 40 Missing ⚠️
...rontend/core/src/modules/quicksearch/impls/docs.ts 0.00% 38 Missing ⚠️
...d/core/src/modules/quicksearch/views/container.tsx 2.85% 34 Missing ⚠️
...tend/core/src/modules/quicksearch/services/cmdk.ts 0.00% 25 Missing ⚠️
.../block-suite-editor/specs/custom/spec-patchers.tsx 0.00% 20 Missing ⚠️
.../core/src/modules/quicksearch/impls/collections.ts 5.26% 18 Missing ⚠️
...re/src/modules/docs-search/services/docs-search.ts 5.88% 16 Missing ⚠️
... and 11 more
Additional details and impacted files
@@                     Coverage Diff                     @@
##           eyhn/feat/t_split_split    #7214      +/-   ##
===========================================================
- Coverage                    58.32%   57.29%   -1.04%     
===========================================================
  Files                          873      897      +24     
  Lines                        38707    39372     +665     
  Branches                      4280     4423     +143     
===========================================================
- Hits                         22575    22557      -18     
- Misses                       15779    16468     +689     
+ Partials                       353      347       -6     
Flag Coverage Δ
server-test 77.99% <ø> (+0.07%) ⬆️
unittest 28.91% <3.52%> (-1.44%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@EYHN EYHN marked this pull request as ready for review June 13, 2024 08:15
@EYHN EYHN force-pushed the eyhn/feat/t_split_split_split branch from 1f9b0ef to 63f8441 Compare June 13, 2024 08:30
@EYHN EYHN force-pushed the eyhn/feat/t_split_split_split branch from 63f8441 to 0d0f361 Compare June 13, 2024 14:22
@EYHN EYHN force-pushed the eyhn/feat/t_split_split_split branch from 0d0f361 to 14805f5 Compare June 13, 2024 14:35
@EYHN EYHN force-pushed the eyhn/feat/t_split_split_split branch from 14805f5 to 8196916 Compare June 13, 2024 15:19
@EYHN EYHN force-pushed the eyhn/feat/t_split_split_split branch from 8196916 to fa3fae8 Compare June 14, 2024 07:50
Comment on lines +150 to +155
const fuse = new Fuse(commands, {
keys: [{ name: 'label.title', weight: 2 }, 'label.subTitle'],
includeMatches: true,
includeScore: true,
threshold: 0.4,
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it better to wrap Fuse with a proper abstraction instead of accessing it directly?

Copy link
Collaborator

Choose a reason for hiding this comment

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

As a benefit, we can easily switch the underlying indexer engine and evaluate/compare the performance among them.

}),
onStart(() => {
this.items$.next([]);
// loading
Copy link
Collaborator

Choose a reason for hiding this comment

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

it seems isLoading$ should be used here

}
}

const docs = await this.docSearchService.search(query);
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you think if it is a good idea to emit the link result immediately in line 73?

@EYHN EYHN force-pushed the eyhn/feat/t_split_split_split branch from 2c0c6bc to 7c2e6c2 Compare June 19, 2024 07:15
@EYHN EYHN force-pushed the eyhn/feat/t_split_split_split branch from 7c2e6c2 to 9825a7c Compare June 20, 2024 04:59
@EYHN EYHN force-pushed the eyhn/feat/t_split_split_split branch from 9825a7c to 7576ff5 Compare June 21, 2024 03:38
@EYHN EYHN force-pushed the eyhn/feat/t_split_split_split branch from 7576ff5 to 4ccb5e9 Compare June 23, 2024 05:20
@EYHN EYHN force-pushed the eyhn/feat/t_split_split_split branch from 4ccb5e9 to db385be Compare June 24, 2024 09:34
@EYHN EYHN force-pushed the eyhn/feat/t_split_split_split branch 2 times, most recently from 3c17fd6 to 8a86fbd Compare June 24, 2024 14:33
@EYHN EYHN force-pushed the eyhn/feat/t_split_split branch from b88337b to 6b570e6 Compare July 1, 2024 05:39
@EYHN EYHN force-pushed the eyhn/feat/t_split_split_split branch from 8a86fbd to 0bc1be3 Compare July 1, 2024 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:core app:electron Related to electron app mod:component mod:dev mod:env mod:i18n Related to i18n mod:infra Environment related issues and discussions test Related to test cases
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

2 participants