- Implemented useCategoriesWithTags hook to fetch categories with tags.
- Created zustand store for managing categories and tags state.
- Added error handling and loading states for improved user experience.
test: add comprehensive tests for useCategoryTemplates hook
- Developed unit tests for useCategoryTemplates to ensure correct functionality.
- Included tests for loading states, error handling, pagination, and category ID changes.
- Verified that templates are fetched and merged correctly based on category ID.
feat: create useCategoryTemplates hook for managing category templates
- Introduced useCategoryTemplates hook to fetch templates based on category ID.
- Implemented pagination and loading states for template fetching.
- Added refetch and loadMore functionalities to enhance data retrieval.
feat: modify TemplateCard and TemplateGrid to handle optional id and filter templates
refactor: clean up use-template-filter to use CategoryTemplate type
- Implemented TemplateGrid component for displaying templates in a grid layout.
- Added calculateCardWidth helper function for dynamic card sizing.
- Created TitleBar component for displaying the title and points with interaction.
- Added unit tests for TemplateGrid and TitleBar components to ensure proper functionality.
- Introduced useStickyTabs and useTabNavigation hooks with tests for managing sticky tab behavior and navigation logic.
- Implemented useTemplateFilter hook for filtering templates based on video content.
- Added comprehensive tests for all new hooks and components to validate behavior and edge cases.
Following TDD principles (RED-GREEN-REFACTOR):
- RED: Created failing tests for HomeScreen rendering
- Verify RED: Confirmed tests failed due to missing mocks
- GREEN: Added necessary mocks for all dependencies
- Verify GREEN: All 4 tests passing (4/4)
Tests cover:
- Title bar rendering with app name
- Category tabs rendering when data is loaded
- Template cards rendering when category has templates
- Loading state not showing when data is loaded
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
FlashList cannot be nested inside ScrollView. Changed to FlatList with scrollEnabled=false to allow proper rendering within the parent ScrollView.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
FlashList requires estimatedItemSize prop to properly render content. Without it, the list may appear blank even when data is present.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add console logs to track template filtering process on home and video pages to diagnose black screen issue. Logs include all preview URL fields and filtering decisions.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
SDK API only accepts single MessageType value, not array. Updated to use client-side filtering for Tab-based message type filtering (all/notice/other) instead of server-side filtering.
Changes:
- hooks/use-messages.ts: Changed type parameter from array to single value
- app/(tabs)/message.tsx: Replaced getMessageTypeByTab with filterMessagesByTab for client-side filtering
- Removed useEffect dependency on activeTab to prevent unnecessary refetches
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace mock data with useMessages hook and useMessageActions for real-time message management. Add support for tab-based filtering (all/notice/other), pull-to-refresh, infinite scroll pagination, and mark-as-read functionality. Integrate LoadingState, ErrorState, and PaginationLoader components for better UX.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add useAnnouncementActions hook for marking announcements as read and useAnnouncementUnreadCount hook for fetching unread announcement count. Both hooks follow TDD principles with complete test coverage.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement useMessageActions and useMessageUnreadCount hooks following strict TDD principles (RED → GREEN → REFACTOR).
useMessageActions provides:
- markRead(id) - mark single message as read
- batchMarkRead(ids) - batch mark messages as read
- deleteMessage(id) - delete message
- Independent loading/error states for each operation
useMessageUnreadCount provides:
- Fetch total unread count and counts by message type
- refetch() method for manual refresh
- loading and error state management
All operations use MessageController from SDK with proper error handling.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement useAnnouncements hook following TDD principles and use-templates golden standard pattern. Includes complete test coverage for pagination, loading states, error handling, and refetch functionality.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace ChatController.chat() with MessageController.list() and import types from @repo/sdk. Updated tests to match new implementation. All tests passing (8/8).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added comprehensive hooks/REVIEW.md analyzing all 15 hooks
- Marked all completed phases in task_plan.md
- Documented SDK limitations and TODO items
All major development work completed:
- 4 UI components created with TDD
- 3 hooks enhanced with tests
- 7 pages integrated with new components
- All with proper pagination, refresh, and error handling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary of completed work:
- Phase 2: Enhanced 3 existing hooks with tests and retry functionality
- Phase 6: Created 4 reusable UI components (all with TDD)
- Phase 4-5: Integrated UI components into 7 pages with pagination/refresh
- Added TODO comments for features requiring backend API support
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add useDebounce hook for future search optimization
- Integrate LoadingState, ErrorState, RefreshControl, and PaginationLoader into searchResults.tsx
- Add pull-to-refresh functionality with RefreshControl component
- Implement pagination with loadMore and PaginationLoader
- Add error handling with retry functionality using ErrorState
- Update SearchResultsGrid to support refreshControl, onEndReached, and ListFooterComponent props
- Add scroll event handling for pagination trigger
- Add TODO comment in searchWorksResults.tsx for backend API integration
- Reduce initial search limit from 50 to 20 for better performance
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add useWorksList hook for data fetching with pagination support
- Integrate RefreshControl for pull-to-refresh functionality
- Add LoadingState for initial loading display
- Add ErrorState with retry functionality
- Add PaginationLoader for load more indication
- Update WorksGallery to support refresh control and pagination
- Add comprehensive tests for worksList screen and hook
- Use useMemo for performance optimization
TODO: Replace mock API with actual backend endpoint when available
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Transform Generation Record from static detail view to dynamic list with:
- useTemplateGenerations hook for data fetching
- RefreshControl for pull-to-refresh functionality
- LoadingState and ErrorState for proper state handling
- PaginationLoader for infinite scroll
- FlatList with onEndReached for pagination
- Comprehensive test coverage following TDD principles
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace inline LoadingState, ErrorState, and FooterLoading components with reusable UI components (LoadingState, ErrorState, RefreshControl, PaginationLoader). Add retry functionality to ErrorState and maintain consistent styling with #FFE500 color theme.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace custom loading/error states with reusable components (RefreshControl, LoadingState, ErrorState). Add pull-to-refresh functionality and remove duplicate styles.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add retry function to handle failed template operations by storing last params in ref and allowing retry without re-passing parameters. Includes comprehensive test coverage.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add complete test coverage for use-template-detail hook including:
- Initial state verification
- Execute function with success and error cases
- Loading state management
- Refetch functionality
- Error handling and clearing
All tests passing (10/10). Hook already has complete loading states and refetch functionality as documented in REVIEW.md.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Verified that use-templates hook already implements all required features:
- loading and loadingMore states
- error handling with proper state management
- pagination with loadMore function
- hasMore flag for infinite scroll
- refetch function for pull-to-refresh
- 17 comprehensive tests covering all scenarios
All tests pass successfully. Hook follows gold standard pattern per hooks/REVIEW.md.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Mark video list hook as not needed (already uses useTemplates)
- Document SDK limitations: no message list API, no user info API
- Add SDK Support column to findings.md
- Clarify which features need backend customization
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Removed use-videos.ts that incorrectly used ProjectController.
Video tab already uses useTemplates hook with TemplateController which is correct.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement video list hook following TDD principles and use-templates.ts pattern.
Supports pagination, loading states, error handling, and data refresh.
- Add useVideos hook with execute, loadMore, and refetch functions
- Add comprehensive test suite with 11 test cases
- Follow DI pattern using ProjectController from @repo/sdk
- Calculate pagination using total/limit for hasMore flag
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add minimal PaginationLoader component for infinite scroll/pagination scenarios. Displays small ActivityIndicator with optional text, supports theme colors, and is designed for use in FlatList ListFooterComponent.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add minimal ErrorState component for displaying error messages with optional retry functionality. Supports light/dark themes via TailwindCSS and follows project patterns. All 6 tests passing.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add minimal LoadingState component for displaying loading states across the app. Includes ActivityIndicator, optional message text, theme support, and comprehensive test coverage.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add minimal RefreshControl wrapper component for pull-to-refresh functionality across screens. Includes theme colors for light/dark mode support.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>