Commit graph

88 commits

Author SHA1 Message Date
senke
086ba8e6e7 api-contracts: complete type cleanup audit and clarify obsolete types
- Action 1.1.3.10: Clarified that Track/User/ApiError are NOT obsolete
  * ApiError already imported from schemas (not in api.ts)
  * Track and User are necessary extended types with UI-specific fields
  * Cannot be deleted without breaking functionality
- Action 1.1.3.11: Audited all type files for obsolete content
  * No empty or redundant files found
  * All type files serve a purpose (dto.ts, v2-v3-types.ts, backend-types.ts, api.ts)
  * Future migration can replace DTOs with generated types (separate task)
- Both actions complete - no cleanup needed at this time
2026-01-15 17:16:47 +01:00
senke
6d43c7c902 api-contracts: mark pre-commit hook task as complete
- Pre-commit hook already exists and is configured correctly
- Hook runs type generation script before each commit
- Renumbered duplicate Action 1.1.3.13 to 1.1.3.15 for clarity
- Action 1.1.3.15 complete - no changes needed
2026-01-15 17:15:46 +01:00
senke
a1a621a11f api-contracts: complete duplicate property analysis for type extensions
- Analyzed all extended types (User, Track) for duplicate properties
- No true duplicates found - all re-declarations serve a purpose:
  * Type narrowing (making optional fields required)
  * Type overrides (backward compatibility, type safety)
  * UI-specific extensions (aliases, computed fields)
- Action 1.1.3.14 complete - no properties to remove
2026-01-15 17:15:04 +01:00
senke
e17712825c api-contracts: update feature-specific auth types to use generated types
- Replace RefreshResponse with VezaBackendApiInternalDtoTokenResponse
- Replace ResendVerificationRequest with VezaBackendApiInternalDtoResendVerificationRequest
- Keep AuthResponse as is (uses extended User/AuthTokens)
- Keep form data types (frontend-specific)
- Tracks types already updated, roles/chat/settings kept as is
2026-01-15 17:13:43 +01:00
senke
2d70c1a64b api-contracts: update barrel exports to document generated type usage
- Add documentation noting User, Track extend generated types
- Export generated types directly for advanced use cases
- Update comments to reflect ApiError location (schemas)
- All existing imports continue to work via barrel exports
2026-01-15 17:11:23 +01:00
senke
61ad3e0602 api-contracts: replace User interface with generated type base
- Update User type in types/api.ts to extend VezaBackendApiInternalModelsUser
- Preserve UI-specific computed fields (avatar_url, stats, roles, status, etc.)
- Make required fields actually required (id, username, email, role, etc.)
- All existing imports continue to work via barrel exports
- No User-specific TypeScript errors introduced
2026-01-15 17:09:14 +01:00
senke
617cdb95f8 api-contracts: replace Track interface with generated type base
- Update Track type in types/api.ts to extend VezaBackendApiInternalModelsTrack
- Update Track type in features/tracks/types/track.ts to extend generated type
- Preserve UI-specific computed fields (coverUrl, plays, likes, etc.)
- Support backward compatibility for duration (number|string)
- All existing imports continue to work without changes
- No Track-specific TypeScript errors introduced
2026-01-15 17:07:50 +01:00
senke
4cc73b0d12 api-contracts: replace ApiError interface with Zod-inferred type
- Replace manual ApiError interface with Zod-inferred type from apiSchemas
- Update all imports (15+ files) to use ApiError from @/schemas/apiSchemas
- Remove ApiError interface from types/api.ts
- Update ApiResponse to import ApiError from schemas
- All TypeScript checks pass for ApiError-related code
2026-01-15 17:03:35 +01:00
senke
c1e139de04 api-contracts: add type generation to pre-commit hook
- Install husky as dev dependency
- Create pre-commit hook to run type generation script
- Ensures types are always up-to-date with backend API before commit
- Hook runs from apps/web directory to execute generate-types.sh
2026-01-15 17:00:30 +01:00
senke
ef400ce6f1 api-versioning: add X-API-Deprecated header and frontend deprecation warning
- Backend: Add X-API-Deprecated header alongside existing X-API-Version-Deprecated
- Frontend: Show deprecation warning toast when deprecated API version detected
- Warning shown only once per session to avoid spam
- Includes sunset date in warning message if available
2026-01-15 16:56:21 +01:00
senke
e4711d684b state-ownership: replace all useAuthStore().user with useUser() hook
- Migrated all hooks: useAuth, useChat, useLogin
- Migrated all components: Header, ProfileForm, FollowButton, LikeButton, PlaylistFollowButton, ChatMessage, ChatMessages, CommentThread, CommentSection, PlaylistList, ChatSidebar, SettingsPage, DashboardPage
- Updated storeSelectors.ts useAuthUser() to use React Query
- All production code now uses useUser() hook instead of Zustand store
- Action 4.1.1.3 and 4.1.1.4 complete
2026-01-14 01:45:42 +01:00
senke
671826b6db state-ownership: audit all files using useAuthStore().user
Found 24 files using user from authStore:
- 18 components (Header, DashboardPage, Chat components, etc.)
- 4 hooks (useAuth, useChat, useLogin)
- 2 utilities (stateHydration, storeSelectors docs)

Created comprehensive audit document with migration strategy.

Action 4.1.1.2 complete
2026-01-14 01:40:42 +01:00
senke
0be96d207d state-ownership: mark middleware removal actions as complete
Actions 4.1.2.5, 4.1.2.6, and 4.1.2.7 were already completed in Action 4.1.2.4:
- undoRedo middleware removed (no domain data to track)
- stateNormalization utilities removed (React Query handles normalization)
- stateMiddleware wrapper removed (no domain data to track)

All middlewares were removed when domain data was removed from library store.

Actions 4.1.2.5, 4.1.2.6, 4.1.2.7 complete
2026-01-14 01:39:53 +01:00
senke
5b35ebd1e3 state-ownership: remove domain data from library store
- Remove items, favorites, pagination, isLoading, error from LibraryState
- Remove fetchItems, fetchFavorites, uploadFile, toggleFavorite, deleteItem, clearItems, setLoading, setError from LibraryActions
- Remove undoRedo and stateMiddleware wrappers (no domain data to track)
- Update useLibraryActions() to use React Query for all domain data actions
- Store now only contains filters (UI state)
- Update useLibraryItemsNormalized() and useLibraryFavoritesNormalized() to return empty state (deprecated)
- Update useLibraryPagination() to return both camelCase and snake_case for compatibility

Action 4.1.2.4 complete
2026-01-14 01:39:23 +01:00
senke
efce991cae state-ownership: mark Action 4.1.2.8 as complete
All components using library store domain data have been migrated:
- DashboardPage components use selectors from storeSelectors.ts
- Selectors have been migrated to React Query hooks (Action 4.1.2.3.3)
- No direct access to store domain data found
- Components automatically migrated via selector abstraction layer

Action 4.1.2.8 complete
2026-01-12 13:45:11 +01:00
senke
0b4cd9065e state-ownership: update storeSelectors.ts to use React Query hooks
- Replace useLibraryItems() with React Query hook
- Replace useLibraryFavorites() with React Query hook
- Replace useLibraryPagination() to extract from React Query response
- Replace useLibraryStatus() to use React Query status
- Update useLibraryActions() to use queryClient.refetchQueries()
- Maintain same interface for backward compatibility
- Migrates DashboardPage components automatically

Action 4.1.2.3.3 complete
2026-01-12 13:37:02 +01:00
senke
c13dbcf9a6 state-ownership: audit components using library store domain data - found 2 DashboardPage components and storeSelectors utility 2026-01-11 18:21:08 +01:00
senke
96fb01c4f3 state-ownership: create React Query hooks for library items (useLibraryItems, useLibraryFavorites) 2026-01-11 18:19:52 +01:00
senke
f4823dd9c8 state-ownership: mark field categorization complete (done in audit) 2026-01-11 18:18:56 +01:00
senke
c83f9de2f5 state-ownership: audit library store domain data - identified 3 domain fields and 3 UI state fields 2026-01-11 18:18:45 +01:00
senke
f54003ed9f state-ownership: audit track queries React Query usage - only comments/likes use React Query 2026-01-11 18:18:15 +01:00
senke
fa5285c2be state-ownership: update STATE_SELECTORS.md with correct auth store import path 2026-01-11 18:17:45 +01:00
senke
54bba07dad state-ownership: mark stateCleanup audit actions as complete (already deleted) 2026-01-11 18:17:10 +01:00
senke
e4fac6470c state-ownership: update STATE_DEBUGGING.md to reflect current store structure (Action 4.6.1.7) 2026-01-11 18:04:42 +01:00
senke
da08b67dff state-ownership: remove obsolete state utilities (stateCleanup, stateVersioning, statePersistence) 2026-01-11 18:03:58 +01:00
senke
42dc022e0a state-ownership: mark cartStore and playerStore migrations as not needed (Actions 4.5.1.7, 4.5.1.9) 2026-01-11 18:00:35 +01:00
senke
cc0380ecbb state-ownership: mark store audit actions complete (4.5.1.6, 4.5.1.8, 4.5.1.10) 2026-01-11 17:58:31 +01:00
senke
9d94ca378c state-ownership: verify stores/auth.ts is removed (Action 4.5.1.3) 2026-01-11 17:57:19 +01:00
senke
5ec174695c state-ownership: categorize stores as UI state vs domain data (Action 4.5.1.2) 2026-01-11 17:56:45 +01:00
senke
ae47a2fbb2 state-ownership: list all Zustand stores (Action 4.5.1.1) 2026-01-11 17:56:31 +01:00
senke
bb1f1adcb9 state-ownership: audit all mutations for optimistic updates (Action 4.4.1.4) 2026-01-11 17:55:39 +01:00
senke
506f694793 state-ownership: audit custom optimistic updates (Action 4.4.1.1) 2026-01-11 17:43:51 +01:00
senke
b86db19bc3 state-ownership: create React Query hook for user (Action 4.1.1.1) 2026-01-11 17:43:07 +01:00
senke
618058e5fd error-propagation: integrate offline detection utility with error handler 2026-01-11 17:42:04 +01:00
senke
52493aeb30 error-propagation: add offline detection utility 2026-01-11 17:41:37 +01:00
senke
cc529f63ad error-propagation: enhance network error detection to distinguish timeout, connection refused, and offline 2026-01-11 17:41:08 +01:00
senke
bef60625b9 error-propagation: audit all mutation error handlers 2026-01-11 17:33:30 +01:00
senke
9088a2659e error-propagation: enhance error boundary logging for monitoring 2026-01-11 17:33:03 +01:00
senke
e585869f61 error-propagation: update ErrorBoundary to use ErrorDisplay component 2026-01-11 17:32:25 +01:00
senke
b7cc9281ff error-propagation: audit existing ErrorBoundary usage 2026-01-11 17:31:41 +01:00
senke
bb7178f9e9 error-propagation: highlight form fields on validation errors 2026-01-11 17:31:12 +01:00
senke
2ac5c84c74 error-propagation: redirect to login on auth errors 2026-01-11 17:29:55 +01:00
senke
a54f57f648 error-propagation: integrate issue reporting with ErrorDisplay 2026-01-11 17:29:11 +01:00
senke
744d87c630 error-propagation: create support issue reporting utility 2026-01-11 17:27:45 +01:00
senke
8a77a5c65d error-propagation: show offline indicator on network errors 2026-01-11 17:16:49 +01:00
senke
7fd3b2837d error-propagation: add getErrorCategory function for error categorization 2026-01-11 17:14:49 +01:00
senke
5a70fa3709 error-propagation: mark Action 3.1.1.7 as complete (no duplicate error displays found) 2026-01-11 17:13:40 +01:00
senke
6f698bf1f2 error-propagation: mark Action 3.1.1.6 as complete (13 files migrated, API client noted separately) 2026-01-11 17:13:27 +01:00
senke
c33ceb0da6 error-propagation: update PlaylistErrorBoundary to use ErrorDisplay component 2026-01-11 17:04:42 +01:00
senke
b03431c2ab error-propagation: update PlayerError to use ErrorDisplay component 2026-01-11 17:03:55 +01:00