feat: implement label management with color filtering

This commit is contained in:
2026-01-04 22:47:54 +01:00
parent a154192410
commit dfa88c5b63
20 changed files with 674 additions and 177 deletions

View File

@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
## [Unreleased] - 2026-01-04
### Added
- **Label Management System**: Complete redesign of label/tag management
- Added `Label` model to Prisma schema with centralized database storage
- Created `LabelContext` for global state management with React Context API
- Added `useLabels` hook for easy access to label functionality
- Implemented full CRUD API for labels (GET, POST, PUT, DELETE)
- Updated all components to use the new context instead of localStorage
### Fixed
- **Tests**: Fixed Playwright drag-and-drop tests to work with dynamically generated note IDs
- Changed selectors from hardcoded text (`text=Note 1`) to flexible attribute selectors (`[data-draggable="true"]`)
@@ -11,13 +19,22 @@ All notable changes to this project will be documented in this file.
- Replaced UI-based cleanup with API-based cleanup using `request.delete()` for more reliable test cleanup
### Database
- Cleaned up 38 accumulated test notes from the database using MCP memento tool
- Cleaned up 38 accumulated test notes from database using MCP memento tool
- Retained only essential notes: "test" and 2x "New AI Framework Released"
- Added migration `20260104203746_add_labels_table` for new Label model
### Technical Details
- The drag-and-drop functionality itself was working correctly
- The issue was in the Playwright tests which expected exact text matches but notes were created with unique IDs (e.g., `test-1767557327567-Note 1`)
- Tests now properly handle the dynamic note generation system
- **Label Management**:
- Labels now stored in database with colors, eliminating localStorage duplication
- All label operations are centralized through LabelContext
- Automatic synchronization across all components
- Better performance with single source of truth
- Support for user-specific labels (userId field for future auth)
- **Tests**:
- The drag-and-drop functionality itself was working correctly
- The issue was in Playwright tests which expected exact text matches but notes were created with unique IDs (e.g., `test-1767557327567-Note 1`)
- Tests now properly handle the dynamic note generation system
## [Previous Versions]