Files
insomnia/packages/insomnia-data/package.json
Bingbing 8a1dc1ef62 perf: rewrite command palette search to eliminate UI freezes and stale results (#10257)
* perf: rewrite command palette search to eliminate UI freezes and stale results

Problems fixed:
- clientLoader blocked navigation on every palette open, freezing the UI during
  full sequential DB scan
- no AbortController: stale searches could overwrite newer results mid-type
- no debounce: every keystroke triggered a full DB traversal immediately
- React Aria's default contains filter re-filtered server-side fuzzy results,
  silently dropping valid matches and making fuzzy work redundant
- no warm baseline: palette started blank until the entire load completed

Changes:
- move fuzzyMatch/fuzzyMatchAll → insomnia-data/common-src/search.ts (shared,
  testable in node)
- move search logic → insomnia-data/node-src/services/helpers/command-search.ts
  - per-request AbortController cancellation via abort(requestId)
  - recursion depth guard (max 20) on request group traversal
  - safeParent() replaces non-null assertions, safe against orphaned documents
- add CommandSearchResult type in insomnia-data/src/command-search-types.ts
- add useCommandSearch hook: 250ms debounce + abort on filter change + warm
  baseline on mount
- add defaultFilter={() => true} to ComboBox, delegating all filtering to the
  service
- delete routes/commands.tsx

* fix

* fix
2026-07-17 01:07:38 +00:00

51 lines
1.3 KiB
JSON

{
"private": true,
"name": "insomnia-data",
"license": "Apache-2.0",
"version": "12.5.1-alpha.0",
"author": "Kong <office@konghq.com>",
"description": "Insomnia data functionalities",
"repository": {
"type": "git",
"url": "git+https://github.com/Kong/insomnia.git",
"directory": "packages/insomnia-data"
},
"bugs": {
"url": "https://github.com/kong/insomnia/issues"
},
"homepage": "https://github.com/Kong/insomnia#readme",
"exports": {
".": {
"import": "./src/index.ts",
"types": "./src/index.ts"
},
"./node": {
"import": "./node-src/index.ts",
"types": "./node-src/index.ts"
},
"./common": {
"import": "./common-src/index.ts",
"types": "./common-src/index.ts"
}
},
"scripts": {
"lint": "eslint . --ext .ts,.tsx --cache",
"type-check": "tsc -p src/tsconfig.json && tsc -p common-src/tsconfig.json && tsc -p node-src/tsconfig.json && tsc -p tsconfig.test.json",
"test": "vitest run"
},
"dependencies": {
"@seald-io/nedb": "^4.1.1",
"deep-equal": "2.2.3",
"fuzzysort": "^1.9.0",
"graphql": "^16.10.0",
"uuid": "^9.0.1"
},
"devDependencies": {
"@getinsomnia/node-libcurl": "3.2.2",
"@modelcontextprotocol/sdk": "^1.17.5",
"@types/deep-equal": "^1.0.4",
"mocha": "^11.7.5",
"type-fest": "^4.40.0"
}
}