mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 23:57:11 -04:00
17451e75dd
After landing the imperative-timer fix and extracting `useDebouncedCallback`
into our own hook, the use-site count climbed past three and the case for
a single, battle-tested contract beat the case for in-tree code. Drops
both our `useDebouncedValue` and `useDebouncedCallback` and routes every
caller through `use-debounce@10.1.1` (1M+ weekly, ~3KB gzip).
API mapping at each use-site:
- value debounce: `useDebouncedValue(v, ms)` → `const [v] = useDebounce(v, ms)`
- callback debounce: `useDebouncedCallback(fn, ms)` → identical signature,
same `.cancel()`/`.isPending()` semantics we relied on, plus `.flush()`
and leading/trailing/maxWait options we now get for free.
Files touched (7 use-sites): data-table.tsx, input-search.tsx,
use-table-state.ts, use-table-query-filter.ts, knowledges-provider.tsx,
use-flow-files-search.ts, use-detail-navigation.ts.
pnpm + Vite gotcha: pnpm hoists into `.pnpm/<name>@<ver>/`, so any
transitive `import React from 'react'` from a third-party package can
resolve to its own physical copy. With one path through our code and
another through use-debounce, the runtime crashed at `useRef` with
"Cannot read properties of null (reading 'useRef')". Added
`resolve.dedupe: ['react', 'react-dom']` in vite.config.ts so the
bundle ships exactly one React.
Tests:
- new input-search.test.tsx (10 tests) covers collapsed/expanded
presentation, expand-on-click + rAF focus, burst-typing coalesce,
Esc-clear mid-debounce, two-stage Esc semantics, external-source-wins
race, Ctrl+F / Cmd+F global hotkey expansion.
- data-table.test.tsx +5 tests: deep-link initial filterValue,
6-keystroke burst coalesce, unmount-mid-debounce cleanup, two
independent DataTables on one page (settings/prompts shape),
back-button-style external clear, three-round type/clear stress.
- full suite: 541/541 passing, lint 0 errors.
Manual smoke via Chrome DevTools MCP on every page that mounts a
filter input — /flows, /templates, /settings/api-tokens,
/settings/prompts (both tables independent), /knowledges (filter
+ semantic search hitting the server through ?qs=). All scenarios
collapse to a single `[{v="", u=""}]` transition; no URL re-emit
after X, no leftover timer after Esc, no cross-table leakage.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
155 lines
5.7 KiB
JSON
155 lines
5.7 KiB
JSON
{
|
|
"name": "pentagi",
|
|
"type": "module",
|
|
"version": "0.2.0",
|
|
"scripts": {
|
|
"build": "tsc && vite build",
|
|
"commit": "commit",
|
|
"commitlint": "commitlint --edit",
|
|
"dev": "vite",
|
|
"graphql:generate": "graphql-codegen --config graphql-codegen.ts",
|
|
"lint": "eslint \"src/**/*.{ts,tsx,js,jsx}\"",
|
|
"lint:fix": "eslint \"src/**/*.{ts,tsx,js,jsx}\" --fix",
|
|
"prettier": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,scss}\"",
|
|
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,scss}\"",
|
|
"ssl:generate": "tsx --eval 'import { generateCertificates } from \"./scripts/generate-ssl.ts\"; generateCertificates();'",
|
|
"test": "vitest run",
|
|
"test:coverage": "vitest run --coverage",
|
|
"test:watch": "vitest"
|
|
},
|
|
"dependencies": {
|
|
"@apollo/client": "^4.1.9",
|
|
"@hookform/resolvers": "^5.2.2",
|
|
"@monaco-editor/react": "^4.7.0",
|
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
"@radix-ui/react-collapsible": "^1.1.12",
|
|
"@radix-ui/react-context-menu": "^2.2.16",
|
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
"@radix-ui/react-icons": "^1.3.2",
|
|
"@radix-ui/react-label": "^2.1.8",
|
|
"@radix-ui/react-popover": "^1.1.15",
|
|
"@radix-ui/react-progress": "^1.1.8",
|
|
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
"@radix-ui/react-select": "^2.2.6",
|
|
"@radix-ui/react-separator": "^1.1.8",
|
|
"@radix-ui/react-slot": "^1.2.4",
|
|
"@radix-ui/react-switch": "^1.2.6",
|
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
"@radix-ui/react-toggle": "^1.1.10",
|
|
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
"@react-pdf/renderer": "^4.5.1",
|
|
"@tanstack/react-table": "^8.21.3",
|
|
"@tiptap/core": "^3.23.4",
|
|
"@tiptap/extensions": "^3.23.4",
|
|
"@tiptap/pm": "^3.23.4",
|
|
"@tiptap/react": "^3.23.4",
|
|
"@tiptap/starter-kit": "^3.23.4",
|
|
"@xterm/addon-fit": "^0.11.0",
|
|
"@xterm/addon-search": "^0.16.0",
|
|
"@xterm/addon-unicode11": "^0.9.0",
|
|
"@xterm/addon-web-links": "^0.12.0",
|
|
"@xterm/addon-webgl": "^0.19.0",
|
|
"@xterm/xterm": "^6.0.0",
|
|
"anser": "^2.3.5",
|
|
"axios": "^1.16.1",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"cmdk": "^1.1.1",
|
|
"date-fns": "^4.1.0",
|
|
"github-slugger": "^2.0.0",
|
|
"graphql": "^16.14.0",
|
|
"graphql-ws": "^6.0.8",
|
|
"highlight.js": "^11.11.1",
|
|
"js-cookie": "^3.0.7",
|
|
"lodash": "^4.18.1",
|
|
"lowlight": "^3.3.0",
|
|
"lru-cache": "^11.3.6",
|
|
"lucide-react": "^1.16.0",
|
|
"marked": "^18.0.3",
|
|
"monaco-editor": "^0.55.1",
|
|
"motion": "^12.39.0",
|
|
"react": "^19.2.6",
|
|
"react-day-picker": "^10.0.1",
|
|
"react-diff-viewer-continued": "^4.2.2",
|
|
"react-dom": "^19.2.6",
|
|
"react-hook-form": "^7.76.0",
|
|
"react-markdown": "^10.1.0",
|
|
"react-resizable-panels": "^4.11.1",
|
|
"react-router-dom": "^7.15.1",
|
|
"react-textarea-autosize": "^8.5.9",
|
|
"recharts": "^3.8.1",
|
|
"rehype-highlight": "^7.0.2",
|
|
"rehype-raw": "^7.0.0",
|
|
"rehype-slug": "^6.0.0",
|
|
"remark-gfm": "^4.0.1",
|
|
"sonner": "^2.0.7",
|
|
"tailwind-merge": "^3.6.0",
|
|
"tiptap-markdown": "^0.9.0",
|
|
"tw-animate-css": "^1.4.0",
|
|
"use-debounce": "^10.1.1",
|
|
"vaul": "^1.1.2",
|
|
"zod": "^4.4.3"
|
|
},
|
|
"devDependencies": {
|
|
"@commitlint/cli": "^21.0.1",
|
|
"@commitlint/config-conventional": "^21.0.1",
|
|
"@eslint/eslintrc": "^3.3.5",
|
|
"@eslint/js": "^9.39.4",
|
|
"@graphql-codegen/cli": "^7.0.0",
|
|
"@graphql-codegen/client-preset": "^6.0.0",
|
|
"@graphql-codegen/near-operation-file-preset": "^5.2.1",
|
|
"@graphql-codegen/typescript": "^6.0.1",
|
|
"@graphql-codegen/typescript-operations": "^6.0.2",
|
|
"@graphql-codegen/typescript-react-apollo": "^4.4.2",
|
|
"@prettier/plugin-xml": "^3.4.2",
|
|
"@tailwindcss/postcss": "^4.3.0",
|
|
"@tailwindcss/typography": "^0.5.19",
|
|
"@testing-library/dom": "^10.4.1",
|
|
"@testing-library/jest-dom": "^6.9.1",
|
|
"@testing-library/react": "^16.3.2",
|
|
"@testing-library/user-event": "^14.6.1",
|
|
"@types/js-cookie": "^3.0.6",
|
|
"@types/lodash": "^4.17.24",
|
|
"@types/node": "^24.12.4",
|
|
"@types/react": "^19.2.14",
|
|
"@types/react-dom": "^19.2.3",
|
|
"@typescript-eslint/eslint-plugin": "^8.59.3",
|
|
"@typescript-eslint/parser": "^8.59.3",
|
|
"@vitejs/plugin-react-swc": "^4.3.1",
|
|
"@vitest/coverage-v8": "^4.1.6",
|
|
"eslint": "^9.39.4",
|
|
"eslint-config-prettier": "^10.1.8",
|
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
"eslint-plugin-perfectionist": "^5.9.0",
|
|
"eslint-plugin-react": "^7.37.5",
|
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
"jsdom": "^29.1.1",
|
|
"postcss": "^8.5.14",
|
|
"prettier": "^3.8.3",
|
|
"prettier-plugin-tailwindcss": "^0.8.0",
|
|
"tailwindcss": "^4.3.0",
|
|
"tsx": "^4.22.1",
|
|
"typescript": "^6.0.3",
|
|
"vite": "^8.0.13",
|
|
"vite-plugin-html": "^3.2.2",
|
|
"vite-tsconfig-paths": "^6.1.1",
|
|
"vitest": "^4.1.6"
|
|
},
|
|
"packageManager": "pnpm@10.32.1",
|
|
"pnpm": {
|
|
"onlyBuiltDependencies": [
|
|
"@swc/core",
|
|
"esbuild"
|
|
]
|
|
},
|
|
"eslintConfig": {
|
|
"extends": [
|
|
"plugin:storybook/recommended"
|
|
]
|
|
}
|
|
}
|