Commit Graph

108 Commits

Author SHA1 Message Date
imeepos d0b8a29698 fix: bug 2026-01-28 20:18:17 +08:00
imeepos e699e5cada fix: ensure async API calls are awaited in VideoSocialButton
- Make callback handlers async and await the API calls
- Add localLoading state to prevent duplicate clicks
- Add ActivityIndicator during loading
- Fix issue where API might not be called properly
2026-01-28 20:16:57 +08:00
imeepos 0d83020926 fix: pass initial count to hooks for correct optimistic update
- Add initialLikeCount and initialFavoriteCount parameters
- Use item.likeCount/item.favoriteCount as fallback
- Fixes issue where count resets to 0 on first click
2026-01-28 20:14:45 +08:00
imeepos 458027934a fix: add optimistic updates for like/favorite actions
- Immediately update store state on user action (no delay)
- Increment/decrement count optimistically for instant feedback
- Rollback on API error
- Use server-returned count for final accuracy
- Remove local useState, only use store for state
2026-01-28 20:12:40 +08:00
imeepos 46b45872c1 fix: export templateSocialStore as callable object
- Export templateSocialStore with all methods via getState()
- Allows hooks to call store methods directly
- Fix 'setLiked is not a function' error
2026-01-28 20:10:59 +08:00
imeepos 20459ffd1d fix: improve VideoSocialButton styling
- Use vertical layout with icon above count (TikTok style)
- Show correct liked/favorited state with filled icons
- Add count formatting (1.5k, 2.8w)
- Improve button background and positioning
- Update tests for new component structure
2026-01-28 20:09:59 +08:00
imeepos e6416ee604 fix: sync store state when like/favorite actions complete
- Update templateSocialStore when like/unlike succeeds
- Update templateSocialStore when favorite/unfavorite succeeds
- Sync likeCount and favoriteCount from API response
- Ensure state consistency across video page and detail page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:23:11 +08:00
imeepos 30625bc820 feat: add double-tap to like animation
- Implement double-tap detection on video area
- Show heart animation on double-tap (similar to TikTok/Douyin)
- Toggle like/unlike on double-tap
- Add Animated and Ionicons imports
- Add tests for double-tap functionality
- Add videoPressable and heartAnimation styles

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:21:44 +08:00
imeepos d89575e150 feat: integrate social buttons in video page
- Add VideoSocialButton to VideoItem component
- Connect like/favorite actions with existing hooks
- Use Zustand store for state management
- Extend templateSocialStore to support favoriteCount
- Update tests for social button integration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:16:06 +08:00
imeepos ab79a9f200 feat: add VideoSocialButton component for video page
- Create vertical social button layout similar to TikTok/Kuaishou
- Support like and favorite actions with proper state management
- Include loading state handling
- Add comprehensive tests covering all props and interactions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 19:11:57 +08:00
imeepos 6fc87d59de fix: bug 2026-01-28 19:05:25 +08:00
imeepos 7f84a348a7 fix: bug 2026-01-28 18:54:38 +08:00
imeepos 7c50d396e9 fix: bug 2026-01-28 18:46:44 +08:00
imeepos e478b126cd fix: bug 2026-01-28 17:38:49 +08:00
imeepos d6cc74ab00 fix: bug 2026-01-28 17:30:01 +08:00
imeepos 0399bba83f fix: bug 2026-01-28 16:09:21 +08:00
imeepos ef629713eb fix: bug 2026-01-28 16:07:20 +08:00
imeepos ffed84a90c fix: bug 2026-01-28 16:04:14 +08:00
imeepos efd4aba8c1 fix: bug 2026-01-28 15:57:40 +08:00
imeepos 7d73cfbc3e fix: bug 2026-01-28 15:26:00 +08:00
imeepos 4bf364d955 fix: bug 2026-01-28 14:53:13 +08:00
imeepos 17d0cfa54e fix: bug 2026-01-28 14:49:56 +08:00
imeepos ea53d8d70e fix: bug 2026-01-28 14:46:12 +08:00
imeepos ca63868282 fix: bug 2026-01-28 14:39:46 +08:00
imeepos b46ad76161 fix: bug 2026-01-28 14:15:33 +08:00
imeepos 30fa29b0ac fix: bug 2026-01-28 14:08:56 +08:00
imeepos 1080fb131c fix: bug 2026-01-28 13:55:22 +08:00
imeepos c5641c1d3c fix: 修复表单相册上传失败bug,优化FormData构造方式
- 移除uploadFile.ts中不必要的Platform判断逻辑
- 保持原始URI不做修改,让React Native底层处理平台差异
- 添加uploadFile单元测试,覆盖主要上传场景
- 简化代码结构,提高可维护性

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 13:46:35 +08:00
imeepos cd1a4f6841 feat: update RefreshControl mocks in tests and improve error handling in useChangePassword hook 2026-01-27 17:18:54 +08:00
imeepos 8f00d4644a feat: implement pull-to-refresh and load more functionality in "My" page, add WebP image support 2026-01-27 17:08:11 +08:00
imeepos c78ad352ba feat: update TAB_BAR_HEIGHT to improve tab layout and add channel definitions in eas.json 2026-01-27 15:00:06 +08:00
imeepos f323d2bea7 feat: remove API integration development plan and report files
- Deleted the `api_integration_development_plan.md` and `api_integration_report.md` files as they are no longer needed.
- Removed `findings.md`, `message-adaptation-plan.md`, `progress.md`, `prompt.md`, and `task_plan.md` files to streamline project documentation.
- Ensured all related code and references are updated accordingly.
2026-01-27 14:19:38 +08:00
imeepos a0beb146d7 feat: update runtimeVersion to use APP_VERSION for better version management 2026-01-27 12:04:27 +08:00
imeepos 3bc113bf9c feat: implement app update checks and add app configuration file 2026-01-27 11:52:59 +08:00
imeepos 533b58ccf4 feat: update TabLayout to improve tab bar styling and handle safe area insets 2026-01-26 18:55:07 +08:00
imeepos 65b61ce05e feat: enhance TabLayout and HomeScreen with safe area insets and optimized refresh handling 2026-01-26 18:36:18 +08:00
imeepos 818f6e8591 feat: optimize home screen data loading with pagination and refresh functionality 2026-01-26 17:33:21 +08:00
imeepos 23fae07a58 feat: add useCategoriesWithTags hook and associated store for category management
- 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.
2026-01-26 17:05:44 +08:00
imeepos a529dc03e1 fix: update @repo/sdk to version 1.0.14 and adjust build scripts for production
feat: modify TemplateCard and TemplateGrid to handle optional id and filter templates
refactor: clean up use-template-filter to use CategoryTemplate type
2026-01-26 16:40:32 +08:00
imeepos 01865d94c2 feat: add image picker utility and integrate image upload in DynamicForm component 2026-01-26 13:04:14 +08:00
imeepos 3fd445bb6e feat: implement user balance management with hooks and store 2026-01-26 12:57:21 +08:00
imeepos 2757b68756 feat: add TemplateGrid and TitleBar components with tests
- 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.
2026-01-26 12:43:20 +08:00
imeepos bf11241d68 feat: 实现用户名和头像编辑功能
使用 Better Auth 的 updateUser API 更新用户信息,使用 SDK 的 FileController 上传头像。

## 新增功能
- 创建 useUpdateProfile hook 处理用户信息更新
- 支持选择图片上传头像(使用 expo-image-picker)
- 先上传头像到 S3,再更新用户信息

## 更新文件
- lib/auth.ts: 导出 updateUser 方法
- hooks/use-update-profile.ts: 新建更新资料 hook
- hooks/index.ts: 导出 useUpdateProfile
- components/drawer/EditProfileDrawer.tsx:
  - 添加头像选择功能(点击相机按钮)
  - 调用 updateProfile API 保存更改
  - 添加加载状态和禁用状态
  - 更新 onSave 回调参数类型
- app/(tabs)/my.tsx:
  - 传递 initialAvatar 给编辑抽屉
  - 显示用户真实头像(如有)
  - 更新 onSave 回调处理

## 功能流程
1. 点击相机按钮选择图片
2. 调用 uploadFile 上传到 S3
3. 调用 updateUser 更新用户信息
4. 保存成功后刷新 session

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 19:42:13 +08:00
imeepos e4b249f502 fix: 个人中心显示当前登录用户的真实用户名和ID
- 使用 useSession hook 获取当前登录用户信息
- 用户名从 session.user.name 或 session.user.username 获取
- 用户ID显示真实用户ID的前8位
- 添加 useEffect 监听 session 变化自动更新

修复前:显示硬编码的 "乔乔乔乔" 和 "ID 12345678"
修复后:显示当前登录用户的真实信息

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 19:28:41 +08:00
imeepos 7d160d55ea fix: 移除对 @tanstack/react-query 的依赖,使用项目现有 hooks 模式
项目未安装 @tanstack/react-query,将 useWorksSearch hook 改为使用项目现有的模式:
- 使用 useState 管理状态
- 使用 useCallback 封装逻辑
- 使用 useEffect 自动执行搜索
- 使用 handleError 统一错误处理

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 19:26:24 +08:00
imeepos e1340fa101 feat: 实现 API 接口对接功能 (删除作品、作品搜索、修改密码)
按照 TDD 规范完成三个核心功能的接口对接:

## 新增功能

### 1. 删除作品功能 (app/generationRecord.tsx)
- 新增 use-template-generation-actions.ts hook
- 支持单个删除和批量删除作品
- 删除确认对话框
- 删除成功后自动刷新列表
- 完整的错误处理和加载状态

### 2. 作品搜索功能 (app/searchWorksResults.tsx)
- 新增 use-works-search.ts hook
- 替换模拟数据为真实 SDK 接口
- 支持关键词搜索和分类筛选
- 支持分页加载
- 完整的加载、错误、空结果状态处理

### 3. 修改密码功能 (app/changePassword.tsx)
- 新增 use-change-password.ts hook
- 使用 Better Auth 的 changePassword API
- 客户端表单验证(密码长度、确认密码匹配等)
- 成功后自动返回并提示

## 技术实现
- 严格遵循 TDD 规范(先写测试,后写实现)
- 新增 3 个 hooks 和对应的单元测试
- 更新中英文翻译文件
- 更新 jest.setup.js 添加必要的 mock

## 文档
- 新增 api_integration_report.md - API 对接分析报告
- 新增 api_integration_development_plan.md - 开发计划和完成汇总

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 19:15:24 +08:00
imeepos 4c01d8e9e7 fix: bug 2026-01-21 16:25:26 +08:00
imeepos 54867492a7 test: add unit tests for HomeScreen to ensure proper rendering
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>
2026-01-21 15:28:18 +08:00
imeepos 57b92ac52f fix: replace FlashList with FlatList to fix black screen in ScrollView
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>
2026-01-21 15:24:52 +08:00
imeepos a8b5ee5256 fix: add estimatedItemSize to FlashList to fix black screen issue
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>
2026-01-21 15:22:48 +08:00