Archon/archon-ui-main/package.json
Wirasm 31cf56a685
feat: Phase 3 - Fix optimistic updates with stable UUIDs and visual indicators (#695)
* feat: Phase 3 - Fix optimistic updates with stable UUIDs and visual indicators

- Replace timestamp-based temp IDs with stable nanoid UUIDs
- Create shared optimistic utilities module with type-safe functions
- Add visual indicators (OptimisticIndicator component) for pending items
- Update all mutation hooks (tasks, projects, knowledge) to use new utilities
- Add optimistic state styling to TaskCard, ProjectCard, and KnowledgeCard
- Add comprehensive unit tests for optimistic utilities
- All tests passing, validation complete

* docs: Update optimistic updates documentation with Phase 3 patterns

- Remove outdated optimistic_updates.md
- Create new concise documentation with file references
- Document shared utilities API and patterns
- Include performance characteristics and best practices
- Reference actual implementation files instead of code examples
- Add testing checklist and migration notes

* fix: resolve CodeRabbit review issues for Phase 3 optimistic updates

Address systematic review feedback on optimistic updates implementation:

**Knowledge Queries (useKnowledgeQueries.ts):**
- Add missing createOptimisticEntity import for type-safe optimistic creation
- Implement filter-aware cache updates for crawl/upload flows to prevent items appearing in wrong filtered views
- Fix total count calculation in deletion to accurately reflect removed items
- Replace manual optimistic item creation with createOptimisticEntity<KnowledgeItem>()

**Project Queries (useProjectQueries.ts):**
- Add proper TypeScript mutation typing with Awaited<ReturnType<>>
- Ensure type safety for createProject mutation response handling

**OptimisticIndicator Component:**
- Fix React.ComponentType import to use direct import instead of namespace
- Add proper TypeScript ComponentType import for HOC function
- Apply consistent Biome formatting

**Documentation:**
- Update performance characteristics with accurate bundlephobia metrics
- Improve nanoid benchmark references and memory usage details

All unit tests passing (90/90). Integration test failures expected without backend.

Co-Authored-By: CodeRabbit Review <noreply@coderabbit.ai>

* Adjust polling interval and clean knowledge cache

---------

Co-authored-by: CodeRabbit Review <noreply@coderabbit.ai>
2025-09-18 13:24:48 +03:00

84 lines
3.8 KiB
JSON

{
"name": "archon-ui",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "npx vite",
"build": "npx vite build",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint:files": "eslint --ext .js,.jsx,.ts,.tsx",
"biome": "biome check",
"biome:fix": "biome check --write",
"biome:format": "biome format --write",
"biome:lint": "biome lint",
"biome:ai": "biome check --reporter=json",
"biome:ai-fix": "biome check --write --reporter=json",
"biome:ci": "biome ci",
"preview": "npx vite preview",
"test": "vitest",
"test:run": "vitest run",
"test:ui": "vitest --ui",
"test:integration": "vitest run --config vitest.integration.config.ts",
"test:coverage": "npm run test:coverage:run && npm run test:coverage:summary",
"test:coverage:run": "vitest run --coverage --reporter=dot --reporter=json",
"test:coverage:stream": "vitest run --coverage --reporter=default --reporter=json --bail=false || true",
"test:coverage:summary": "echo '\\n📊 ARCHON TEST & COVERAGE SUMMARY\\n═══════════════════════════════════════\\n' && node -e \"try { const data = JSON.parse(require('fs').readFileSync('coverage/test-results.json', 'utf8')); const passed = data.numPassedTests || 0; const failed = data.numFailedTests || 0; const total = data.numTotalTests || 0; const suites = data.numTotalTestSuites || 0; console.log('Test Suites: ' + (failed > 0 ? '\\x1b[31m' + failed + ' failed\\x1b[0m, ' : '') + '\\x1b[32m' + (suites - failed) + ' passed\\x1b[0m, ' + suites + ' total'); console.log('Tests: ' + (failed > 0 ? '\\x1b[31m' + failed + ' failed\\x1b[0m, ' : '') + '\\x1b[32m' + passed + ' passed\\x1b[0m, ' + total + ' total'); console.log('\\n✨ Results saved to coverage/test-results.json'); } catch(e) { console.log('⚠️ No test results found. Run tests first!'); }\" || true",
"test:coverage:force": "vitest run --coverage --passWithNoTests || true",
"seed:projects": "node --loader ts-node/esm ../scripts/seed-project-data.ts"
},
"dependencies": {
"@mdxeditor/editor": "^3.42.0",
"@radix-ui/react-alert-dialog": "^1.1.15",
"@radix-ui/react-dialog": "^1.1.15",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-popover": "^1.1.15",
"@radix-ui/react-select": "^2.2.6",
"@radix-ui/react-tabs": "^1.1.13",
"@radix-ui/react-toast": "^1.2.15",
"@radix-ui/react-tooltip": "^1.2.8",
"@tanstack/react-query": "^5.85.8",
"@tanstack/react-query-devtools": "^5.85.8",
"clsx": "latest",
"date-fns": "^4.1.0",
"fractional-indexing": "^3.2.0",
"framer-motion": "^11.5.4",
"lucide-react": "^0.441.0",
"nanoid": "^5.0.9",
"prismjs": "^1.30.0",
"react": "^18.3.1",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18.3.1",
"react-markdown": "^10.1.0",
"react-router-dom": "^6.26.2",
"tailwind-merge": "latest",
"zod": "^3.25.46"
},
"devDependencies": {
"@biomejs/biome": "2.2.2",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^14.3.1",
"@testing-library/user-event": "^14.5.2",
"@types/node": "^20.19.0",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/ui": "^1.6.0",
"autoprefixer": "latest",
"eslint": "^8.57.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.1",
"jsdom": "^24.1.0",
"postcss": "latest",
"tailwindcss": "3.4.17",
"ts-node": "^10.9.1",
"typescript": "^5.5.4",
"vite": "^5.2.0",
"vitest": "^1.6.0"
}
}