Archon/PRPs
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
..
ai_docs feat: Phase 3 - Fix optimistic updates with stable UUIDs and visual indicators (#695) 2025-09-18 13:24:48 +03:00
templates Add PRP story task template and reorganize PRP commands (#508) 2025-08-27 14:10:25 +03:00