Commit Graph

19 Commits

Author SHA1 Message Date
imeepos 3171b7c3bf docs: add hooks review and finalize task plan
- 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>
2026-01-21 12:22:02 +08:00
imeepos 1f34b4c273 feat: integrate UI components into Search pages with pagination and loading
- 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>
2026-01-21 12:20:11 +08:00
imeepos 10ee380051 feat: integrate UI components into Works List with pagination and refresh
- 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>
2026-01-21 12:15:53 +08:00
imeepos 9703bb8fce feat: add retry functionality to use-template-actions hook
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>
2026-01-21 12:00:07 +08:00
imeepos 7ebd225976 test: add comprehensive tests for use-template-detail hook
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>
2026-01-21 11:57:17 +08:00
imeepos c65d368656 test: verify use-templates hook has complete functionality
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>
2026-01-21 11:54:34 +08:00
imeepos 7fd5f3da44 chore: remove incorrect use-videos hook
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>
2026-01-21 11:48:22 +08:00
imeepos 100f059bb7 feat: add use-videos hook for video list management
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>
2026-01-21 11:39:34 +08:00
imeepos a1544ec85f fix: 修复 Jest 测试配置和 useCategories hook 实现
- 修复 jest.setup.js 中不存在的 NativeAnimatedHelper 模块引用
- 优化 jest.config.js 配置,分离 js 和 ts/tsx 的转换配置
- 添加 @testing-library/react 依赖
- 导出 useCategoriesStore 以供测试使用
- 修复 useCategories hook 的参数合并逻辑,确保 inputParams 正确覆盖默认参数
- 修复错误处理时 data 状态设置为 null
- 更新 CategoriesState 类型定义,允许 data 为 null

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-19 11:46:51 +08:00
imeepos 687cfcf725 fix: 修复 use-categories 测试中的 TypeScript 类型错误
为 load() 函数调用添加所需的必填参数 (orderBy, order, ownerId) 以符合 ListCategoriesInput 类型要求。

- 在 "merge custom params with default params" 测试中添加必填参数
- 在 "override initial params" 测试中添加必填参数

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-19 11:45:25 +08:00
imeepos 1f9b6e22d6 feat: 添加测试框架和优化项目结构
- 添加 Jest 配置和测试设置
- 添加 use-categories hook 的单元测试
- 更新 CLAUDE.md 添加包管理工具说明
- 优化首页、视频页和频道页的组件结构
- 添加 .claude 命令配置文件
- 移除 bun.lock 和 package-lock.json,统一使用 bun
- 更新 package.json 依赖

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-19 10:53:54 +08:00
imeepos dcdab410c6 fix: bug 2026-01-16 15:16:49 +08:00
imeepos fce99a57bf fix: 修复所有 TypeScript 类型错误
- 修复 useTemplates hook 中缺失的必需参数 (page, limit)
- 修复 searchResults 中 execute 和 refetch 的参数类型
- 修复 aspectRatio 类型从 string 转换为 number
- 修复 loadTags 中缺失的必需参数
- 移除 useTags 中不存在的 isActive 属性
- 修复 useTemplateActions 返回值类型

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-16 14:14:05 +08:00
imeepos 4270973652 refactor: 优化代码和添加类型检查脚本
- 统一 OWNER_ID 导入,从 lib/auth 导入而非环境变量
- 添加 type-checks 脚本用于 TypeScript 类型检查
- 对接 my 页面后端接口,使用 useTemplateGenerations
- 添加 MySkeleton 骨架屏组件
- 添加下拉刷新功能
- 添加空状态提示文案

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-16 12:34:27 +08:00
imeepos 755a374b67 feat: 对接 generateVideo 页面后端接口
- 新增 uploadFile 工具函数用于图片上传
- 更新 useTemplateActions hook 使用 handleError 统一错误处理
- 实现 generateVideo 页面视频生成功能
  - 根据 formSchema.startNodes 动态构建请求数据
  - 支持图片和文本输入
  - 添加 loading 状态和错误提示
  - 生成成功后显示通知并返回

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-16 12:33:05 +08:00
imeepos 4d1e901032 fix: 修复所有 TypeScript 类型错误
- 修复 webpPreviewUrl -> previewUrl 字段名错误
- 修复 video.tsx 中的 useTemplates 参数类型问题
- 修复 video.tsx 中 position 重复定义问题
- 修复 searchResults.tsx 中的 SearchResultItem 类型不匹配
- 修复 SearchResultsGrid.tsx 中不存在的 scrollContent 样式
- 修复 use-templates.ts 中 page 可能是 undefined 的类型问题
- 添加 tsconfig.json 的 exclude 配置
- 修复 use-template-actions.ts 中 null 不能赋值给 ApiError 的问题

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-16 12:14:04 +08:00
imeepos ae120f24d3 feat: 对接 templateDetail 页面后端接口
- 创建 hooks/use-error.ts 统一错误处理
- 创建 hooks/use-template-detail.ts 获取模板详情
- 创建 hooks/use-template-generations.ts 获取模板生成记录
- 更新 hooks 使用 handleError 统一错误处理
- 优化 SearchResultsGrid 组件,复用 TemplateGeneration 类型
- 删除不必要的类型转换和重复代码

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-16 11:56:38 +08:00
imeepos fb719c6ea2 fix: 对接退出登录 2026-01-13 17:03:14 +08:00
imeepos 02d0c807cd Initial commit: expo-popcore-app 2025-12-25 16:25:55 +08:00