refactor(component): cmdk ordering (#5722)

Replace internal CMDK command filtering/sorting logic.
The new implementation includes the following for command scoring:
- categories weights
- highlighted fragments
- original command score value

The new logic should be much cleaner and remove some hacks in the original implementation.

Not sure if this is optimal yet. Could be changed later.

fix https://github.com/toeverything/AFFiNE/issues/5699
This commit is contained in:
Peng Xiao
2024-02-16 13:20:24 +00:00
parent 9e7eb5629c
commit d1c4e6141a
13 changed files with 304 additions and 189 deletions

View File

@@ -25,7 +25,8 @@ export type CommandCategory =
| 'affine:layout'
| 'affine:updates'
| 'affine:help'
| 'affine:general';
| 'affine:general'
| 'affine:results';
export interface KeybindingOptions {
binding: string;