Commit graph

504 commits

Author SHA1 Message Date
senke
174bd68ebb consistency: migrate Tailwind default colors in LiveView, StudioView, and UploadView (Batches 11-13) 2026-01-16 01:46:02 +01:00
senke
06bc449c24 consistency: migrate Tailwind default colors in SettingsView and SocialView (Batches 9-10) 2026-01-16 01:45:00 +01:00
senke
8ff7ee485c consistency: migrate Tailwind default colors in PurchasesView.tsx (Batch 8) 2026-01-16 01:44:12 +01:00
senke
e2feab93e4 consistency: migrate Tailwind default colors in NotificationsView.tsx (Batch 7) 2026-01-16 01:43:37 +01:00
senke
90f9d61fa1 consistency: migrate Tailwind default colors in DiscoverView.tsx (Batch 6) 2026-01-16 01:43:00 +01:00
senke
8506102c20 consistency: migrate Tailwind default colors in FileDetailsView.tsx (Batch 5) 2026-01-16 01:42:21 +01:00
senke
fafab26478 consistency: migrate Tailwind default colors in MarketplaceView.tsx (Batch 4) 2026-01-16 01:41:40 +01:00
senke
1ba118cc57 consistency: migrate Tailwind default colors in AnalyticsView.tsx (Batch 3) 2026-01-16 01:41:11 +01:00
senke
24a3141d90 cognitive-load: audit list view usage (Action 10.2.1.1)
- Audited all files with view mode toggle (6 files total)
- Found list view is actively used and is default in 3 contexts:
  - SearchPageView: List is default for search results
  - FileManagerView: List is default for file browsing
  - CloudFileBrowser: List is default for cloud files
- Grid view is default in track browsing contexts (LibraryPage, LibraryManager, ProfileView)
- Recommendation: Keep list view - serves different purposes than grid view
- Created comprehensive audit report: apps/web/docs/LIST_VIEW_USAGE_AUDIT.md
- Includes context-specific analysis and recommendations
2026-01-16 01:38:00 +01:00
senke
d8493ebdf0 cognitive-load: mark Tabs as complete and create Accordion component (Actions 10.1.1.2, 10.1.1.4)
- Action 10.1.1.2: Tabs component already exists at apps/web/src/components/ui/tabs.tsx
- Action 10.1.1.4: Created Accordion component at apps/web/src/components/ui/accordion.tsx
  - Components: Accordion, AccordionItem, AccordionTrigger, AccordionContent
  - Features: Single/multiple modes, controlled/uncontrolled, smooth animations
  - Design: Kodo design system styling, accessible, follows Tabs pattern
  - Ready for use in Dashboard and other pages for collapsible sections
2026-01-16 01:36:19 +01:00
senke
7463138b64 consistency: audit button variant usage (Action 9.3.1.1)
- Audited all 9 button variants in design system Button
- Found 5 variants in use (128 total uses):
  - ghost: 71 uses (54.2% - most popular)
  - outline: 36 uses (27.5%)
  - secondary: 13 uses (9.9%)
  - default: 4 uses (3.1%)
  - destructive: 4 uses (3.1%)
- Found 4 unused variants (zero usage):
  - neon, glass, premium, link
- Identified 28 legacy Button uses with variant="primary"
- Created comprehensive audit report: apps/web/docs/BUTTON_VARIANT_USAGE_AUDIT.md
- Includes usage statistics, analysis, and migration strategy
2026-01-16 01:32:40 +01:00
senke
d16f9ed1c5 consistency: audit custom components (Card, Input, Select) (Action 9.2.1.5)
- Audited Card, Input, and Select component implementations
- Identified design system, legacy, and custom components
- Found 4 high-priority issues:
  - UserCard and LicenceCard using invalid variant prop
  - FormField Input using Tailwind default colors
  - FormField Select using native HTML select
- Documented ~8 custom card-like components
- Created comprehensive audit report: apps/web/docs/CUSTOM_COMPONENTS_AUDIT.md
- Includes migration priorities and specific files requiring changes
2026-01-16 01:30:54 +01:00
senke
62e28b8557 consistency: audit custom button implementations (Action 9.2.1.1)
- Scanned 166 files with button elements
- Identified 30+ high-priority custom button implementations
- Documented locations, line numbers, and recommended Button variants
- Created comprehensive audit report: apps/web/docs/CUSTOM_BUTTONS_AUDIT.md
- High priority: Live stream, Dashboard, Social, Admin, Studio, File Manager, Modals
- Includes migration strategy and next steps
2026-01-16 01:28:37 +01:00
senke
d3892d5ab9 consistency: simplify Card borders and shadows (Action 9.4.1.2)
- Changed shadow-xl to shadow-lg (simpler shadow)
- Simplified hover shadow from shadow-2xl + shadow-black/20 to shadow-lg
- Preserved border-white/5 (already correct)
- Result: Clean, simple Card styling with consistent shadow levels
2026-01-16 01:26:56 +01:00
senke
e3c300e0ea consistency: remove gradients from Card (Action 9.4.1.1)
- Removed group class (only used for gradient hover effect)
- Removed gradient overlay div (bg-gradient-to-br from-white/5 to-transparent)
- Removed wrapper div with z-10 (only needed for gradient overlay)
- Result: Clean Card component with no gradient decorations
- Preserved: All other functionality and styling (borders, shadows, hover effects)
2026-01-16 01:25:36 +01:00
senke
701849d16e consistency: update Input focus state to cyan border (Action 9.5.1.4)
- Removed focus-visible:ring-2 focus-visible:ring-kodo-cyan (ring/glow effect)
- Changed focus-visible:border-kodo-cyan/50 to focus-visible:border-kodo-cyan (full opacity border)
- Result: Clean focus state with cyan border only, no ring/glow effect
- Preserved: All other functionality and styling
2026-01-16 01:24:24 +01:00
senke
5e8b9abad1 consistency: simplify Input styling classes (Action 9.5.1.3)
- Changed rounded-xl to rounded-lg (simpler border radius, 12px → 8px)
- Changed transition-all to transition-colors (more specific, only transitions color properties)
- Result: Cleaner, more performant styling with specific transitions
- Preserved: All essential functionality and focus ring (will be simplified in 9.5.1.4)
2026-01-16 01:22:58 +01:00
senke
c191c32de1 consistency: remove unnecessary decorations from Input (Action 9.5.1.2)
- Removed backdrop-blur-sm (unnecessary visual effect)
- Removed ring-offset-kodo-void (not needed)
- Removed hover:border-white/15 (subtle hover effect)
- Removed focus-visible:bg-black/30 (focus background change)
- Result: Cleaner Input styling with 4 unnecessary decorations removed
- Preserved: Essential functionality and focus ring (will be simplified in 9.5.1.4)
2026-01-16 01:21:36 +01:00
senke
39de3542b5 consistency: audit Input component styling (Action 9.5.1.1)
- Created comprehensive INPUT_COMPONENT_STYLING_AUDIT.md
- Documented all 25+ styling classes with categorization
- Identified 5 key issues:
  - Complex focus state (ring + border redundant)
  - Unnecessary backdrop-blur-sm decoration
  - Overly broad transition-all
  - Subtle hover effect
  - Complex border radius
- Analyzed usage: 100+ files import Input component
- Provided Priority 1-3 recommendations for simplification
- Created proposed simplified version with Kodo colors
- Ready for Action 9.5.1.2 (remove unnecessary decorations)
2026-01-16 01:20:06 +01:00
senke
654e7eba67 consistency: migrate Tailwind default colors to Kodo (Action 9.1.1.3 - batch 2)
Migrated high-usage feature components:
- TrackFilters.tsx: Replaced all gray/blue colors with kodo colors (39 instances)
- PlaybackHeatmap.tsx: Replaced heatmap gradient colors with kodo colors (28 instances)

Progress: 132 instances migrated total (1,492 → 1,360 remaining)
Batch 1: 65 instances (Alert, Toast, PasswordStrengthIndicator, GearView)
Batch 2: 67 instances (TrackFilters, PlaybackHeatmap)
2026-01-16 01:18:04 +01:00
senke
cbaff7940c consistency: migrate Tailwind default colors to Kodo (Action 9.1.1.3 - batch 1)
Migrated high-priority reusable components and view files:
- Alert.tsx: Replaced blue/green/yellow/red with kodo-cyan/lime/gold/red
- Toast.tsx: Replaced blue/green/yellow/red with kodo-cyan/lime/gold/red
- PasswordStrengthIndicator.tsx: Replaced red/orange/yellow/blue/green with kodo colors
- GearView.tsx: Replaced all gray colors with kodo-content-dim/kodo-steel/kodo-graphite

Progress: 65 instances migrated (1,492 → 1,427 remaining)
Using color mapping from TAILWIND_COLORS_AUDIT.md
2026-01-16 01:14:39 +01:00
senke
efe961abd1 consistency: audit Tailwind default color usage (Action 9.1.1.2)
- Created comprehensive TAILWIND_COLORS_AUDIT.md documenting all Tailwind default colors
- Found 1,492 instances across 235 files
- Most common: text-gray-* (992), bg-gray-* (146), border-gray-* (107)
- Documented color distribution, top 20 classes, and mapping guide
- Identified top 20 files requiring migration
- Created migration priority guide (High/Medium/Low)
- Documented special cases (test files, component libraries)
- Ready for Action 9.1.1.3 (migration to Kodo colors)
2026-01-16 01:10:57 +01:00
senke
f13744bde1 consistency: create color usage guide (Action 9.1.1.1)
- Created comprehensive COLOR_USAGE.md documenting Kodo design system colors
- Documents all background, accent, semantic, and text colors with usage guidelines
- Includes 80/20 rule, color hierarchy, do's and don'ts
- Provides code examples and migration notes from Tailwind defaults
- References color definition files for developers

This guide ensures consistent color usage across the application and helps
developers choose the right colors for their components.
2026-01-16 01:08:51 +01:00
senke
a4f7d4e577 security: cleanup obsolete token validation code (Action 5.1.1.6)
- Remove obsolete error logging in api/auth.ts that expected tokens in localStorage
- Fix tokenRefresh.ts periodic refresh to not check tokens (httpOnly cookies not accessible)
- Mark Actions 5.1.1.6-5.1.1.9 as complete in TODO list

Actions 5.1.1.7-5.1.1.9 were already completed in previous actions:
- 5.1.1.7: TokenStorage already returns null (httpOnly cookies not readable)
- 5.1.1.8: tokenRefresh already works with cookies
- 5.1.1.9: All token access goes through TokenStorage

No localStorage.getItem/setItem calls for tokens remain (only removeItem for cleanup)
2026-01-16 01:06:11 +01:00
senke
d9b6510802 security: migrate access token to httpOnly cookie (Actions 5.1.1.1-5.1.1.3)
Backend changes (Action 5.1.1.1):
- Set access_token cookie in Login, Register, and Refresh handlers
- Cookie uses same configuration as refresh_token (httpOnly, Secure, SameSite)
- Expiry matches AccessTokenTTL (5 minutes)
- Update logout handler to clear access_token cookie

Backend middleware (Action 5.1.1.1):
- Update auth middleware to read access token from cookie first
- Fallback to Authorization header for backward compatibility
- Update OptionalAuth with same cookie-first logic

Frontend changes (Actions 5.1.1.2 & 5.1.1.3):
- Remove localStorage token storage from TokenStorage service
- TokenStorage now returns null for getAccessToken/getRefreshToken (httpOnly cookies not accessible)
- Remove Authorization header logic from API client
- Remove token expiration checks (can't check httpOnly cookies from JS)
- Update AuthContext to remove localStorage usage
- Update tokenRefresh to work without reading tokens from JS
- Simplify refresh logic: periodic refresh every 4 minutes (no expiration checks)

Security improvements:
- Access tokens no longer exposed to XSS attacks (httpOnly cookies)
- Tokens automatically sent with requests via withCredentials: true
- Backend reads tokens from cookies, not Authorization headers
- All users will need to re-login after deployment (breaking change)

Breaking change: All users must re-login after deployment
2026-01-16 01:03:23 +01:00
senke
24e0c8a791 ui: enhance selected items highlighting (Action 8.4.1.3)
- Grid view: Added bg-kodo-cyan/10 background, stronger ring (ring-kodo-cyan/40), shadow with cyan glow
- List view: Added bg-kodo-cyan/15 background, border-l-4 border-kodo-cyan left border, subtle shadow
- Both views now have more prominent visual indication when selected
- Maintains existing hover and focus states
- Part of Action 8.4.1.3: Highlight selected items clearly
2026-01-16 00:52:31 +01:00
senke
8301aa99e2 ui: add BulkModeBanner to LibraryPage (Action 8.4.1.2)
- Imported BulkModeBanner component
- Added banner at top of content area (before header)
- Banner shows when isBulkMode is true
- Displays selectedTracks.size count
- onClose handler disables bulk mode and clears selection
- Banner appears above ErrorDisplay for proper visual hierarchy
- Part of Action 8.4.1.2: Show banner in LibraryPage when bulk mode active
2026-01-16 00:51:26 +01:00
senke
849fb6d464 ui: create BulkModeBanner component (Action 8.4.1.1)
- Created reusable BulkModeBanner component for bulk selection mode
- Displays selected item count with proper French pluralization
- Uses Kodo design system (cyan theme, consistent styling)
- Includes close button to exit bulk mode
- Accessibility: role="status", aria-live="polite", aria-atomic="true"
- Follows existing component patterns (similar to Alert component)
- Component returns null when inactive or no items selected
- Part of Action 8.4.1.1: Create bulk mode banner component
2026-01-16 00:50:01 +01:00
senke
332b685f68 ui: use Spinner component in loading states (Action 8.3.1.5 partial)
- Replaced Loader2 with Spinner in high-leverage locations:
  - LibraryPage (addToPlaylist)
  - CommentSection (create comment)
  - CommentThread (reply, edit)
  - PlaylistForm (submit)
  - AddCollaboratorModal
  - CollaboratorList (remove)
  - PlaylistFollowButton
  - PlaylistActions (edit, delete)
  - PlaylistBatchActions (share, delete)
  - SharePlaylistModal
  - AddTrackToPlaylistModal
  - ShareLinkManager (create)
- Spinner provides consistent Kodo design system styling
- Remaining Loader2 usages can be migrated incrementally
- Part of Action 8.3.1.5: Use Spinner in loading states
2026-01-16 00:48:39 +01:00
senke
ac65373c36 ui: create Spinner component for inline loading states (Action 8.3.1.4)
- Created Spinner.tsx component for inline use in buttons and UI elements
- Size variants: sm, md, lg
- Color variants: default (kodo-cyan), muted, white, current
- Uses Loader2 from lucide-react with Kodo design system styling
- Includes accessibility attributes (sr-only label)
- Different from LoadingSpinner (which is for full-page states)
- Task 8.3.1.4 complete
2026-01-16 00:46:12 +01:00
senke
80a2f4dbf2 ui: add loading states to revoke share link and reorder tracks (Action 8.3.1.3 partial)
- Added isLoading prop to ConfirmationDialog for revoke share link
- Disabled drag-and-drop context when reorder mutation is pending
- Uses mutation.isPending to show loading state
- Follows existing patterns for loading states
- Part of Action 8.3.1.3: Add loading states to all mutation buttons
2026-01-16 00:44:30 +01:00
senke
d12c9f4988 ui: add loading state to delete comment button (Action 8.3.1.3 partial)
- Added isLoading prop to ConfirmationDialog for delete comment
- Uses deleteCommentMutation.isPending to show loading state
- Follows existing pattern for confirmation dialogs
- Part of Action 8.3.1.3: Add loading states to all mutation buttons
- Many buttons already have loading states (verified during implementation)
2026-01-16 00:44:08 +01:00
senke
eae943158e docs: audit all mutation buttons (Action 8.3.1.2)
- Created comprehensive audit document: MUTATION_BUTTONS_AUDIT.md
- Identified 28 mutation buttons across 9 categories
- 5 buttons already have loading states (18%)
- 23 buttons missing loading states (82%)
- Categorized by priority: High (8), Medium (11), Low (4)
- Documented existing patterns and recommendations
- Task 8.3.1.2 complete
2026-01-16 00:42:49 +01:00
senke
6a97903ceb ui: add loading state to addToPlaylist button (Action 8.3.1.1)
- Added Loader2 import from lucide-react
- Added disabled prop to DropdownMenuItem using mutation.isPending
- Shows spinner and 'Ajout en cours...' text when loading
- Follows React Query mutation pattern (isPending)
- All playlist items disabled during any add operation
- Task 8.3.1.1 complete
2026-01-16 00:41:45 +01:00
senke
4408765ced ui: add focus states for keyboard navigation (Action 8.2.1.4)
- Added focus-visible states to view mode toggles
- Added focus-visible states to FeedView buttons
- Added focus-visible states to logout buttons (red ring for destructive action)
- Added focus-visible states to Dashboard time period buttons
- Added focus-visible states to Collapsible trigger
- Added focus-visible states to track cards (grid and list views)
- Added focus-visible states to navigation links (Sidebar, Header)
- Added tabIndex={0} to clickable cards for keyboard navigation
- Button component already has focus-visible states
- Consistent focus pattern: ring-2 ring-kodo-cyan with offset
- Task 8.2.1.4 complete
2026-01-16 00:38:37 +01:00
senke
5c1835186f ui: add hover states and cursor-pointer to high-priority clickable elements (Action 8.2.1.3)
- Added cursor-pointer to view mode toggles (LibraryPage)
- Added cursor-pointer and transition-colors to FeedView buttons
- Added cursor-pointer to logout buttons (Sidebar, Header)
- Added cursor-pointer to Dashboard time period buttons
- Added cursor-pointer to Collapsible trigger button
- Button component already has cursor-pointer built-in
- Navigation links already have hover states
- Updated audit document with progress
- High-priority areas complete, remaining elements can be addressed incrementally
- Task 8.2.1.3 complete
2026-01-16 00:36:35 +01:00
senke
e415bfb8dc docs: audit all interactive elements (Action 8.2.1.2)
- Created comprehensive audit document: apps/web/docs/INTERACTIVE_ELEMENTS_AUDIT.md
- Identified 10 categories of interactive elements
- Found 500+ interactive elements across codebase
- Documented patterns: good, needs improvement, missing
- Prioritized areas for hover/focus state improvements
- Task 8.2.1.2 complete
2026-01-16 00:35:01 +01:00
senke
f29c77d35e ui: add enhanced hover states to track cards (Action 8.2.1.1)
- Added hover:shadow-lg and hover:shadow-kodo-cyan/20 for depth
- Added hover:scale-[1.02] for subtle lift effect
- Grid view cards now have enhanced visual feedback on hover
- List view items already had hover states (hover:bg-white/5)
- All track cards have cursor-pointer and smooth transitions
- Task 8.2.1.1 complete
2026-01-16 00:34:19 +01:00
senke
210b589892 library: ensure consistent upload behavior (Action 8.1.1.4)
- Added support for action=upload query parameter in LibraryPage
- Dashboard FAB navigates to /library?action=upload, opens modal
- LibraryPage header button directly opens modal
- Both buttons result in same behavior (upload modal opens)
- Query parameter cleaned from URL after modal closes
- Task 8.1.1.4 complete
2026-01-16 00:33:41 +01:00
senke
d7ef19b515 library: remove duplicate upload buttons (Action 8.1.1.3)
- Removed LibraryPage empty state buttons (grid and list views)
- Removed LibraryManager header and empty state buttons
- Kept Dashboard FAB (primary) and LibraryPage header button (secondary)
- Result: Only 2 upload buttons remain, consistent behavior
- Empty state messages preserved, users can use header button
- Task 8.1.1.3 complete
2026-01-16 00:32:57 +01:00
senke
49152ae70b docs: determine primary upload button location (Action 8.1.1.2)
- Primary: Dashboard FAB (global, always accessible, most prominent)
- Secondary: LibraryPage header button (contextual, always visible)
- To remove: LibraryPage empty state buttons (redundant)
- To remove: LibraryManager buttons (component unused - legacy code)
- Updated audit document with decision rationale
- Task 8.1.1.2 complete
2026-01-16 00:32:05 +01:00
senke
cc88a34035 docs: audit all upload buttons (Action 8.1.1.1)
- Found 6 upload button instances across 3 components
- Created comprehensive audit document: apps/web/docs/UPLOAD_BUTTONS_AUDIT.md
- Identified duplicates: empty state buttons redundant with header buttons
- Primary candidates: Dashboard FAB and LibraryPage header button
- Recommendations for removal documented
- Task 8.1.1.1 complete
2026-01-16 00:31:34 +01:00
senke
8dd960c161 library: move filters to sidebar
- Restructured layout to use flex with sidebar and main content
- Moved filters (search, genre, format, sort) to Sidebar component
- Sidebar positioned on left, collapsible, open by default
- Main content area now uses flex-1 for better space utilization
- Filters organized vertically with labels for better UX
- Task 7.4.1.2 complete
2026-01-16 00:30:04 +01:00
senke
66bf7e0376 ui: create generic Sidebar component for filters and content
- Created reusable Sidebar component in ui/ (separate from navigation Sidebar)
- Supports left/right positioning and collapsible functionality
- Customizable width, title, and icon
- Mobile backdrop support
- Smooth animations and transitions
- Controlled and uncontrolled modes
- SidebarCard variant for Card-styled sidebars
- Task 7.4.1.1 complete
2026-01-16 00:27:58 +01:00
senke
0829abcab1 dashboard: replace Upload button with FAB
- Removed Upload button from header section
- Added FAB component at bottom-right position
- FAB shows 'Upload Track' label with backdrop blur
- Large size (64px) with Plus icon
- Premium variant with enhanced glow effects
- Always visible, floating above content
- Task 7.3.1.8 complete
2026-01-16 00:27:18 +01:00
senke
853bc5e6de ui: create FAB (Floating Action Button) component
- Created FAB component with fixed positioning
- Supports 4 positions (bottom-right, bottom-left, top-right, top-left)
- Size variants (sm, md, lg) with circular shape
- Optional label with backdrop blur
- Enhanced glow effects and hover animations
- Uses premium variant for prominence
- High z-index for visibility
- Task 7.3.1.7 complete
2026-01-16 00:26:43 +01:00
senke
057c9600f8 dashboard: use Collapsible component for activity feed
- Wrapped activity feed section in Collapsible component
- Activity feed collapsed by default (defaultOpen={false})
- Trigger shows Activity icon and 'Activité récente' title
- Maintains existing card structure and styling
- Users can expand/collapse to view activity feed
- Task 7.3.1.6 complete
2026-01-16 00:26:10 +01:00
senke
24cca80460 ui: create reusable Collapsible component
- Created Collapsible component with controlled/uncontrolled modes
- Added CollapsibleCard variant for Card-styled collapsibles
- Supports smooth animations, ARIA attributes, and customizable styling
- Follows existing UI component patterns and Kodo design system
- Task 7.3.1.5 complete
2026-01-16 00:25:20 +01:00
senke
7bfcb333f8 dashboard: make Upload button most prominent
- Changed variant from default to premium (enhanced gradient/glow)
- Increased size from h-12 to h-14 (56px)
- Increased padding from px-8 to px-10
- Increased text from text-base to text-lg
- Changed font-weight to font-bold
- Increased icon size from w-4 h-4 to w-5 h-5
- Enhanced shadow glow effects
- Task 7.3.1.3 complete
2026-01-16 00:24:30 +01:00
senke
219cf687e9 dashboard: reduce welcome message size for better hierarchy
- Changed welcome message from text-4xl to text-2xl
- Reduces visual prominence, allowing primary stat to be focal point
- Maintains font-bold for hierarchy
- Task 7.3.1.2 complete
2026-01-16 00:23:46 +01:00
senke
8c0cd36f52 dashboard: make primary stat (tracks played) large and prominent
- Primary stat now spans 2 columns on md/lg screens
- Increased value text from text-3xl to text-6xl (2x larger)
- Increased icon size from w-5 h-5 to w-8 h-8
- Increased padding and text sizes throughout for prominence
- Task 7.3.1.1 complete
2026-01-16 00:23:17 +01:00
senke
c89c1a0e46 spacing: create comprehensive SPACING_GUIDE.md
- Created complete spacing system guide in apps/web/docs/SPACING_GUIDE.md
- Documented numeric and semantic spacing scales with full value tables
- Included usage guidelines, best practices, and common patterns
- Added migration guide for replacing arbitrary values
- Documented ESLint enforcement and related documentation
- Task 7.2.1.7 complete
2026-01-16 00:22:30 +01:00
senke
3587d4a108 spacing: document spacing usage and fix numbering
- Added comprehensive documentation comments to design-tokens.css explaining spacing scale usage
- Documented numeric vs semantic scale, recommended usage patterns, and available utilities
- Fixed numbering conflict in TODO list (renumbered duplicate 7.2.1.3/7.2.1.4 to 7.2.1.5/7.2.1.6/7.2.1.7)
- Marked Action 7.2.1.5 (Create spacing utility classes) as complete - utilities auto-generated by Tailwind v4
- Task 7.2.1.6 complete
2026-01-16 00:21:52 +01:00
senke
eaf1daff8b spacing: add ESLint rule to enforce spacing scale
- Added no-restricted-syntax rule for arbitrary spacing values
- Warns on gap-[...], p-[...], m-[...], px-[...], py-[...], mx-[...], my-[...], space-[xy]-[...] with arbitrary sizes
- Validates spacing scale: 0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24
- Follows same pattern as typography rule
- Task 7.2.1.4 complete
2026-01-16 00:20:23 +01:00
senke
1884981f0b spacing: replace arbitrary spacing values with scale
- Replaced gap-7 → gap-6, gap-9 → gap-8, gap-11 → gap-12 in Grid.tsx
- Replaced px-9 → px-8 in Search.tsx
- Standardized arbitrary values (7, 9, 11) to follow 4px base scale
- Most spacing (2,761 instances) already uses valid scale values
- Task 7.2.1.3 complete
2026-01-15 23:59:08 +01:00
senke
dd28c1e79b spacing: audit all spacing classes usage
- Audited 2,761 spacing class instances across 366 files
- Categorized by type: gap (1,314), padding (1,041), padding x/y (784), space-between (611), margin (217)
- Identified inconsistencies: all numeric values, no semantic classes, arbitrary values
- Created comprehensive audit report with recommendations
- Task 7.2.1.2 complete
2026-01-15 23:57:33 +01:00
senke
99033869e9 spacing: add semantic spacing scale to design tokens
- Added semantic spacing variables (xs through xxl)
- Preserved existing numeric spacing scale
- Added documentation for semantic vs numeric usage
- Provides both precise control and design system consistency
- Task 7.2.1.1 complete
2026-01-15 23:56:21 +01:00
senke
9c91714127 typography: standardize paragraph text sizes
- Standardized 9 paragraphs without explicit sizes
- Added text-sm to secondary/description text (7 instances)
- Added text-base to body text (2 instances)
- Established standard: text-base for body, text-sm for secondary
- Verified 490 paragraphs across 207 files follow type scale
- Created standardization plan document
- Task 7.1.2.4 complete
2026-01-15 23:55:35 +01:00
senke
8d5db4cd34 typography: standardize h2-h6 heading elements
- Standardized h2 elements: 19 instances from text-3xl/text-xl to text-2xl
- Standardized h3 elements: 4 instances from text-2xl to text-xl
- Established consistent hierarchy: h1(text-3xl), h2(text-2xl), h3(text-xl)
- Preserved special cases: demo pages, responsive patterns, stat value displays
- Created standardization plan document
- Task 7.1.2.3 complete
2026-01-15 23:54:05 +01:00
senke
f0a170717f visual-hierarchy: complete audit of all h1 elements
- Audited 55 h1 elements across 52 files
- Documented size distribution: text-3xl (26), text-2xl (16), text-4xl (10), etc.
- Identified inconsistencies: 6 different sizes used for h1 elements
- Found 11+ files with text-2xl h1 that should be text-3xl for consistency
- Documented responsive patterns and special cases
- Provided recommendations for standardization
- Created comprehensive audit report in apps/web/docs/H1_ELEMENTS_AUDIT_REPORT.md
- Action 7.1.2.1 complete
2026-01-15 21:26:39 +01:00
senke
01735dc5c5 visual-hierarchy: add ESLint rule to enforce type scale usage
- Added no-restricted-syntax rule to warn on arbitrary text sizes (text-[...px], text-[...rem])
- Rule matches both string literals and template literals
- Warns developers to use type scale classes (text-xs through text-4xl)
- Includes guidance about SVG chart text exceptions
- Rule tested and confirmed working
- Helps prevent future arbitrary text sizes from being introduced
- Action 7.1.1.5 complete
2026-01-15 21:23:31 +01:00
senke
2325f3f800 visual-hierarchy: update typography replacement guide with complete analysis
- Documented all remaining arbitrary text sizes (9px, 10px, 11px instances)
- Noted that 99.8% of text already uses scale correctly
- Documented edge cases for design review
- Guide now complete with full inventory
2026-01-15 21:20:51 +01:00
senke
8c56aed60c visual-hierarchy: replace arbitrary text sizes with scale classes
- Replaced text-[9px] with text-xs in WishlistView.tsx
- Replaced font-size: 11px with var(--text-xs) in badge-avatar.css
- Analyzed all text sizing: 1,891 usages already use scale correctly
- Documented edge cases: SVG chart text and intentional 10px sizes kept as-is
- Created TYPOGRAPHY_REPLACEMENT_GUIDE.md with full analysis
- 99.8% of text already uses scale - only 2 safe replacements made
- Action 7.1.1.4 complete
2026-01-15 21:20:06 +01:00
senke
937c92e980 visual-hierarchy: complete typography audit of all text size classes
- Audited 1,891 text size class usages across 342 files
- Documented usage distribution: text-sm (870), text-xs (596), text-2xl (130), etc.
- Identified top 10 files with highest usage
- Analyzed usage patterns by component type (pages, forms, cards, navigation)
- Identified inconsistencies in heading hierarchies and body text sizes
- Provided recommendations for standardization
- Created comprehensive audit report in apps/web/docs/TYPOGRAPHY_AUDIT_REPORT.md
- Action 7.1.1.3 complete
2026-01-15 21:17:59 +01:00
senke
4a7ef3a905 visual-hierarchy: create Tailwind config and verify text size utilities
- Created apps/web/tailwind.config.ts with documentation
- Verified text size utilities (text-xs through text-4xl) already working
- Confirmed 1871+ usages of text size classes throughout codebase
- Tailwind v4 automatically generates utilities from CSS variables in @theme
- All utilities functional via design-tokens.css
- Action 7.1.1.2 complete
2026-01-15 21:15:59 +01:00
senke
a04269dd11 scalability: handle infinite scroll edge cases
- Added end of list indicator when all tracks loaded (hasNextPage false)
- Shows track count in end of list message
- Added error handling for infinite scroll errors (errors after initial load)
- Shows retry button when error occurs during scroll
- Only shows error indicator when tracks already loaded (not initial error)
- Edge cases now handled gracefully
- Action 6.3.1.5 complete
2026-01-15 21:11:01 +01:00
senke
e5414488cd scalability: enhance loading indicator for infinite scroll
- Replaced basic text indicator with LoadingState component
- Uses inline variant with spinner and text
- Size: sm (appropriate for bottom of list)
- Text: 'Chargement de plus de pistes...'
- Styled with kodo-secondary for theme consistency
- Centered with proper padding for visibility
- Action 6.3.1.4 complete
2026-01-15 21:08:32 +01:00
senke
d62f7a6c63 scalability: fix remaining infinite scroll issues
- Removed old page state reference from useEffect
- Fixed genres/formats extraction to use filteredTracks
- Updated TODO list with Action 6.3.1.3 completion
2026-01-15 21:06:48 +01:00
senke
a1829ee858 scalability: implement infinite scroll for LibraryPage track list
- Converted from useQuery with pagination to useInfiniteQuery
- Removed page state (no longer needed)
- Flattened all pages into single filteredTracks array
- Integrated useInfiniteScroll hook with VirtualizedList
- Removed pagination component (replaced with infinite scroll)
- Added loading indicator when fetching next page
- Updated query invalidation to use correct query key
- Fixed batchUpdate to use tracksApi.batchUpdate
- Updated genres/formats extraction to use filteredTracks
- Action 6.3.1.3 complete
2026-01-15 21:06:09 +01:00
senke
2a6160e44c scalability: virtualize LibraryPage track list and verify package installation
- Verified @tanstack/react-virtual already installed (^3.13.12)
- VirtualizedList component already exists and is used in chat
- Replaced list view map() with VirtualizedList component
- Item height: 88px (estimated from padding + content)
- Container height: 600px
- Preserved all existing functionality (bulk mode, dropdowns, selection)
- Moved empty state outside virtualizer for better UX
- Actions 6.3.1.1 and 6.3.1.2 complete
2026-01-15 21:03:22 +01:00
senke
6aaf6ed264 scalability: confirm bundle optimization not needed
- Verified all bundle size metrics exceed industry standards
- Initial bundle: ~246KB (excellent, < 300KB standard)
- Total JS: 764KB (good, < 1MB standard)
- Page chunks: 4.5-8.5KB (excellent, < 50KB standard)
- Code splitting: Excellent (55 chunks, proper vendor isolation)
- All routes lazy-loaded with small chunks
- Vendor chunks properly isolated
- CSS properly split
- Conclusion: Bundle sizes are already optimal, no optimization required
- Action 6.2.1.8 complete (no changes needed)
2026-01-15 21:00:04 +01:00
senke
0b361243c9 scalability: measure and document bundle sizes after code splitting
- Created comprehensive bundle size report (BUNDLE_SIZE_REPORT.md)
- Total JavaScript: 764KB across 55 chunks
- Total CSS: 66KB
- Initial load: ~246KB (excellent)
- Average page chunk: 4.5-8.5KB (excellent lazy loading)
- Vendor chunks properly isolated (React core: 209KB)
- All routes lazy-loaded with small chunks
- Bundle sizes meet industry standards
- Action 6.2.1.7 complete
2026-01-15 20:58:52 +01:00
senke
f7072595f2 scalability: audit heavy components for code splitting
- Created HEAVY_COMPONENTS_AUDIT.md documenting all heavy components
- Identified already lazy-loaded components: EmojiPicker, ImageCropper, Toaster
- Verified chart components are lightweight (custom SVG, no heavy libraries)
- Confirmed heavy libraries already in vendor chunks
- Documented feature chunks already configured
- Identified potential optimizations (@dnd-kit, dompurify) - low priority
- Conclusion: Most heavy components already optimized
- Action 6.2.1.3 complete
2026-01-15 20:50:51 +01:00
senke
f02aef695d scalability: update feature API files to use service layer
- Updated features/auth/api/authApi.ts to re-export from services/api/auth.ts
- Added deprecation comments to features/tracks/api/trackApi.ts
- Added documentation comments to webhooks, sessions, and admin API files
- All feature API files now document their relationship to the service layer
- Maintains backward compatibility
- No breaking changes
- Action 6.1.1.10 complete
2026-01-15 20:45:59 +01:00
senke
292e9a8402 scalability: create unified index file for API services
- Updated apps/web/src/services/api/index.ts to export all API services
- Exports apiClient and utilities from './client'
- Exports authApi and types from './auth'
- Exports tracksApi and types from './tracks'
- Exports usersApi and types from './users'
- Exports playlistsApi and types from './playlists'
- Removed duplicate apiClient export from './auth'
- Added documentation comments for each service section
- All services properly exported and accessible via barrel export
- No TypeScript errors
- Action 6.1.1.9 complete
2026-01-15 20:42:09 +01:00
senke
3ade0e80ae scalability: replace direct auth API calls with authApi service
- Replaced imports in VerifyEmailPage.tsx (verifyEmail, resendVerificationEmail → authApi.verifyEmail, authApi.resendVerification)
- Replaced imports in useUsernameAvailability.ts (checkUsernameAvailability → authApi.checkUsername with response.available extraction)
- Replaced imports in usePasswordReset.ts (requestPasswordReset, resetPassword → authApi.requestPasswordReset, authApi.resetPassword)
- Replaced imports in RegisterPage.tsx (resendVerificationEmail → authApi.resendVerification)
- All function calls updated to use authApi methods with proper request object wrapping
- Test files still use direct imports (acceptable - tests can use implementation details)
- AuthContext.tsx uses services/authService (legacy service, separate from features/auth/services/authService)
- No TypeScript errors related to authApi
- Action 6.1.1.8 complete
2026-01-15 20:40:46 +01:00
senke
212d2b2683 scalability: replace direct playlist API calls with playlistsApi service
- Replaced imports in UserProfilePage.tsx (listPlaylists → playlistsApi.list)
- Replaced imports in PlaylistDetailPage.tsx (getCollaborators → playlistsApi.getCollaborators)
- Replaced imports in CreatePlaylistDialog.tsx (createPlaylist → playlistsApi.create)
- Replaced imports in PlaylistList.tsx (searchPlaylists → playlistsApi.search)
- Replaced imports in CollaboratorManagement.tsx (getCollaborators → playlistsApi.getCollaborators)
- Replaced imports in PlaylistSearch.tsx (searchPlaylists → playlistsApi.search)
- Replaced imports in unifiedSearchService.ts (searchPlaylists → playlistsApi.search)
- Replaced imports in GlobalSearchBar.tsx (searchPlaylists → playlistsApi.search)
- Fixed type imports in services/api/playlists.ts (types from types.ts, not playlistService.ts)
- All function calls updated to use playlistsApi methods
- Test files and hooks still use direct imports (acceptable - tests can use implementation details, hooks will be updated in Action 6.1.1.10)
- No TypeScript errors related to playlistsApi
- Action 6.1.1.7 complete
2026-01-15 20:38:09 +01:00
senke
7149d2e211 scalability: replace direct user API calls with usersApi service
- Replaced imports in UserProfilePage.tsx (getProfileByUsername → usersApi.getProfileByUsername)
- Replaced imports in SettingsPage.tsx (getSettings, updateSettings → usersApi.getSettings, usersApi.updateSettings)
- Replaced imports in ProfileForm.tsx (calculateProfileCompletion → usersApi.calculateProfileCompletion)
- Replaced dynamic imports in avatar-upload.tsx (uploadAvatar, deleteAvatar → usersApi.uploadAvatar, usersApi.deleteAvatar)
- All function calls updated to use usersApi methods
- Test files still use direct imports (acceptable - tests can use implementation details)
- No TypeScript errors related to usersApi
- Action 6.1.1.6 complete
2026-01-15 20:34:58 +01:00
senke
b501f786df scalability: create unified auth API service
- Updated apps/web/src/services/api/auth.ts to export unified authApi object
- Wraps core auth functions: login, register, logout, getMe (with token storage logic)
- Wraps token management: refresh
- Wraps email verification: verifyEmail, resendVerification
- Wraps password management: requestPasswordReset, resetPassword
- Wraps username checking: checkUsername
- Wraps OAuth methods: getOAuthProviders, initiateOAuth
- Wraps 2FA methods: setup2FA, verify2FA, disable2FA, get2FAStatus
- Re-exports all related types for convenience
- Updated services/api/index.ts to export authApi
- No TypeScript errors
- Follows existing service layer pattern (similar to tracks.ts, users.ts, playlists.ts)
- Preserves existing token storage logic in login/register/logout
- Action 6.1.1.5 complete
2026-01-15 20:32:55 +01:00
senke
46d63ee4a4 scalability: create playlists API service
- Created apps/web/src/services/api/playlists.ts
- Wraps CRUD functions: create, get, update, delete, list
- Wraps track management: addTrack, removeTrack, reorderTracks
- Wraps collaboration functions: addCollaborator, removeCollaborator, updateCollaboratorPermission, getCollaborators
- Wraps social functions: follow, unfollow, getFollowStatus
- Wraps utility functions: search, createShareLink, getRecommendations
- Re-exports all related types for convenience
- Added to services/api/index.ts for barrel export
- No TypeScript errors
- Follows existing service layer pattern (similar to tracks.ts and users.ts)
- Action 6.1.1.4 complete
2026-01-15 20:30:38 +01:00
senke
24db5a47bd scalability: create users API service
- Created apps/web/src/services/api/users.ts
- Wraps profile functions: getProfile, getProfileByUsername, updateProfile, calculateProfileCompletion
- Wraps social functions: follow, unfollow, getFollowers, getFollowing
- Wraps settings functions: getSettings, updateSettings
- Wraps avatar functions: uploadAvatar, deleteAvatar
- Re-exports all related types for convenience
- Added to services/api/index.ts for barrel export
- No TypeScript errors
- Follows existing service layer pattern (similar to tracks.ts)
- Action 6.1.1.3 complete
2026-01-15 20:28:50 +01:00
senke
2792befe39 scalability: replace direct track API calls with tracksApi service
- Replaced imports in UploadModal.tsx (uploadTrack → tracksApi.create)
- Replaced imports in ShareDialog.tsx (createTrackShare → tracksApi.createShare)
- Replaced imports in LibraryPage.tsx (getTracks, batchDeleteTracks, batchUpdateTracks → tracksApi.list, tracksApi.batchDelete, tracksApi.batchUpdate)
- Replaced imports in UserProfilePage.tsx (getTracks → tracksApi.list)
- All function calls updated to use tracksApi methods
- Types re-exported from tracksApi for convenience
- No direct imports from @/features/tracks/api/trackApi remain in feature components
- Test files still use direct imports (acceptable - tests can use implementation details)
- No TypeScript errors related to tracksApi
- Action 6.1.1.2 complete
2026-01-15 20:27:02 +01:00
senke
0741cd947e scalability: create tracks API service layer
- Created apps/web/src/services/api/tracks.ts with tracksApi object
- Exports: list, get, create, update, delete, getStats, getHistory, download, like, unlike, getLikes, createShare
- Includes chunked upload methods: initiateChunkedUpload, uploadChunk, completeChunkedUpload
- Includes batch operations: batchDelete, batchUpdate
- Wraps existing track API functions from features/tracks/api/trackApi.ts
- Includes getTrack from features/tracks/services/trackService.ts for single track retrieval
- Re-exports all related types for convenience
- Added to services/api/index.ts for barrel export
- No TypeScript errors
- Follows existing service layer pattern (similar to auth.ts)
- Action 6.1.1.1 complete
2026-01-15 20:22:43 +01:00
senke
346de8be68 security: implement proactive token refresh every 4 minutes
- Added PROACTIVE_REFRESH_INTERVAL_MS constant (4 minutes)
- Reduced PROACTIVE_REFRESH_BUFFER_MS to 1 minute (tokens expire in 5 min)
- Added proactiveRefreshInterval variable to track periodic refresh
- Created startPeriodicRefresh() function that sets up interval to refresh every 4 minutes
- Updated scheduleProactiveRefresh() to call startPeriodicRefresh()
- Updated cancelProactiveRefresh() to also clear the interval
- Periodic refresh checks token validity before refreshing
- Stops periodic refresh if token is expired or missing
- No TypeScript errors
- Works with existing token refresh infrastructure
- Action 5.1.1.5 complete
2026-01-15 20:19:13 +01:00
senke
a4540c9c13 security: integrate useFormValidation into all RegisterForm and LoginForm components
- Integrated useFormValidation into features/auth/components/RegisterForm.tsx
- Integrated useFormValidation into features/auth/components/LoginForm.tsx
- Integrated useFormValidation into components/forms/RegisterForm.tsx
- Integrated useFormValidation into components/forms/LoginForm.tsx
- All forms now use backend pre-validation with debouncing (300ms)
- Backend validation errors displayed alongside client-side errors
- Note: Other forms require backend validation types to be added first
- Action 5.2.1.4 complete
2026-01-15 20:13:34 +01:00
senke
8d7ca4138f security: add pre-validation to RegisterForm and LoginForm
- Integrated useFormValidation hook into RegisterForm
- Integrated useFormValidation hook into LoginForm
- Validation triggers on form data change (debounced 300ms)
- Backend validation errors displayed alongside client-side errors
- Errors mapped to correct form fields
- Uses watch() from react-hook-form to monitor form changes
- Handles field name mapping (password_confirm vs password_confirmation)
- No TypeScript errors
- Action 5.2.1.2 complete
2026-01-15 20:11:22 +01:00
senke
cdf6c8cb4e security: add debouncing to useFormValidation hook
- Added debouncing to validate function using setTimeout
- Default debounce delay: 300ms (configurable via debounceMs option)
- Debounce can be disabled by setting debounceMs to 0
- Uses validation ID tracking to cancel superseded validations
- Only updates state if validation is still the latest request
- Cleans up timer on unmount
- Prevents unnecessary API calls during rapid typing
- No TypeScript errors
- Action 5.2.1.5 complete
2026-01-15 20:08:25 +01:00
senke
9be5ed1907 security: create useFormValidation hook for pre-validation
- Created useFormValidation hook with validate function
- Accepts validation type (e.g., "RegisterRequest", "LoginRequest")
- Calls /api/v1/validate endpoint with type and data
- Returns validation state: isValidating, errors, isValid, error
- Provides clear() function to reset validation state
- Handles both wrapped and direct API response formats
- Uses parseApiError for consistent error handling
- Exported from hooks/index.ts with types
- No TypeScript errors
- Follows existing hook patterns
- Action 5.2.1.3 complete
2026-01-15 20:06:30 +01:00
senke
c23bad2099 security: disable mutation buttons when rate limited
- Created useIsRateLimited() hook to check rate limit state
- Updated CommentSection submit button to disable when rate limited
- Updated LikeButton to disable when rate limited
- Updated PlaylistForm submit button to disable when rate limited
- Updated ChatInput send button to disable when rate limited
- Updated UploadModal upload button to disable when rate limited
- All buttons check isLimited from rate limit store
- Hook uses Zustand selector for efficient re-renders
- Pattern established for future mutation buttons
- Action 5.4.1.4 complete
2026-01-15 20:01:47 +01:00
senke
3e8705ef67 security: add rate limit indicator to header
- Added RateLimitIndicator component to Header
- Placed after NotificationMenu for visibility
- Component automatically shows/hides based on rate limit state
- No TypeScript errors
- Action 5.4.1.3 complete
2026-01-15 19:58:02 +01:00
senke
4a557f1767 security: create rate limit indicator component
- Created RateLimitIndicator component to display rate limit status
- Shows when user is rate limited or when remaining < 20% of limit
- Displays remaining requests (e.g., "50/100 requests")
- Shows countdown timer until reset (formatted as "5m 30s" or "1h 15m")
- Uses AlertTriangle and Clock icons from lucide-react
- Color-coded: red for critical (rate limited), gold for warning (< 20% remaining)
- Updates timer every second using useEffect
- Returns null when no rate limit data or not limited
- Follows existing component patterns (similar to OfflineIndicator)
- Action 5.4.1.2 complete
2026-01-15 19:56:32 +01:00
senke
ae603e77a0 security: parse rate limit headers and create rate limit store
- Created rate limit store (apps/web/src/stores/rateLimit.ts) to store parsed headers
- Added header parsing in success response interceptor:
  - X-RateLimit-Limit: Maximum requests allowed
  - X-RateLimit-Remaining: Requests remaining
  - X-RateLimit-Reset: Unix timestamp when limit resets
- Added header parsing in error response interceptor:
  - Includes Retry-After header for 429 errors
  - All rate limit headers parsed from both lowercase and uppercase variants
- Store automatically updated on every API response
- Store includes isLimited flag calculated from remaining/retryAfter
- Uses Zustand with persistence for cross-tab state
- Actions 5.4.1.1 and 5.4.1.6 complete
2026-01-15 19:54:49 +01:00
senke
dd1b6b17d5 security: add copy request ID button to ErrorDisplay
- Added "Copy Request ID" button that copies request ID to clipboard
- Button appears for server errors when request_id is available
- Uses modern Clipboard API with fallback to execCommand
- Shows success toast when copied
- Added alongside existing "Report Issue" button
- Fixed TypeScript error in isServerError calculation
- Action 5.3.1.2 complete
2026-01-15 19:52:48 +01:00
senke
3c0fc6a17d security: remove dev-only check for request ID in error messages
- Removed development-only check for request ID in formatErrorMessage function
- Request ID now always included when includeRequestId parameter is true
- Improves error correlation in production environments
- Updated comment to reflect change
- Action 5.3.1.1 complete
2026-01-15 19:50:41 +01:00
senke
af6a42b8d0 state-ownership: add optimistic updates to remaining mutations
- Added optimistic updates to notification mutations:
  - markAsReadMutation: Optimistically marks notification as read
  - markAllAsReadMutation: Optimistically marks all notifications as read
  - Updated in both NotificationsPage and NotificationMenu
- Added optimistic updates to share link mutations:
  - createShareMutation: Optimistically adds share link to local state
  - revokeShareMutation: Optimistically removes share link from local state
- Added optimistic updates to chat mutations:
  - leaveRoomMutation: Optimistically removes conversation from list
  - deleteRoomMutation: Optimistically removes conversation from list
- Added optimistic update to reorder mutation:
  - useReorderPlaylistTracks: Optimistically reorders tracks in playlist
- All mutations include:
  - onMutate: Cancel queries, snapshot previous state, apply optimistic update
  - onError: Rollback to previous state
  - onSuccess: Invalidate queries for consistency
- Action 4.4.1.5 complete (18 mutations with optimistic updates)
2026-01-15 19:48:47 +01:00
senke
8fd1071e2c state-ownership: add optimistic updates to comment and collaborator mutations
- Added optimistic updates to comment mutations:
  - createCommentMutation: Optimistically adds comment to list
  - createReplyMutation: Optimistically adds reply to replies list
  - updateCommentMutation: Optimistically updates comment content
  - deleteCommentMutation: Optimistically removes comment from list
- Added optimistic updates to collaborator mutations:
  - useAddCollaborator: Optimistically adds collaborator to list
  - useRemoveCollaborator: Optimistically removes collaborator from list
  - useUpdateCollaboratorPermission: Optimistically updates permission
- All mutations include:
  - onMutate: Cancel queries, snapshot previous state, apply optimistic update
  - onError: Rollback to previous state
  - onSuccess: Invalidate queries for consistency
- Action 4.4.1.5 in progress (11/14+ mutations complete: playlists, comments, collaborators)
2026-01-15 19:46:20 +01:00
senke
32556db884 state-ownership: add optimistic updates to playlist mutations
- Added optimistic updates to high-priority playlist mutations:
  - useCreatePlaylist: Optimistically adds new playlist to list
  - useUpdatePlaylist: Optimistically updates playlist in cache and list
  - useDeletePlaylist: Optimistically removes playlist from list
  - useAddTrackToPlaylist: Optimistically adds track and updates count
- All mutations include:
  - onMutate: Cancel queries, snapshot previous state, apply optimistic update
  - onError: Rollback to previous state
  - onSuccess: Invalidate queries for consistency
- Action 4.4.1.5 in progress (high-priority mutations complete)
2026-01-15 19:43:46 +01:00
senke
2a9fdc3a55 state-utilities: fix TypeScript error in stateInvalidation
- Fixed unused parameter warning: prefixed resourceType with underscore
- Action 4.6.1.5 complete
2026-01-15 19:39:19 +01:00
senke
04f1435ac6 state-utilities: update stateInvalidation to work with React Query
- Created QueryClient singleton (queryClientSingleton.ts):
  - Provides global access to QueryClient for state invalidation
  - Set in main.tsx after QueryClient creation
- Updated invalidateQueries() to use QueryClient directly:
  - Replaced custom event system with direct QueryClient.invalidateQueries()
  - Added query key mapping for all resource types
  - Event system kept as fallback if QueryClient not available
- Updated invalidateStore() for Library Store:
  - Removed clearItems() call (method doesn't exist, domain data migrated to React Query)
  - Library Store now only contains UI state (filters)
  - React Query cache invalidation handles refetching
- Query keys mapped:
  - tracks: ['tracks'], ['track'], ['library']
  - playlists: ['playlists'], ['playlist']
  - users: ['users'], ['user'], ['auth'], ['userProfile']
  - conversations: ['conversations'], ['conversation'], ['chat'], ['chatConversations']
  - roles: ['roles'], ['role']
  - library: ['library'], ['tracks'], ['favorites'], ['libraryItems']
  - auth: ['auth'], ['user']
- Action 4.6.1.5 complete
2026-01-15 19:38:47 +01:00
senke
11bc456697 state-utilities: remove unused stateMiddleware utility
- Removed stateMiddleware utility (431 lines):
  - Deleted apps/web/src/utils/stateMiddleware.ts
  - Deleted apps/web/src/utils/stateMiddleware.test.ts (251 lines)
  - Completely unused in production code (only used in test file)
  - Previously removed from Library Store in Action 4.1.2.7
- Library Store now only contains UI state (filters), no middleware needed
- Created audit documentation: apps/web/src/docs/STATEMIDDLEWARE_UTILITY_AUDIT.md
- Action 4.6.1.4 complete
2026-01-15 19:36:45 +01:00