Commit Graph

73 Commits

Author SHA1 Message Date
imeepos f6f28a4cb4 fix: bug 2026-02-02 18:57:05 +08:00
imeepos 95dd556ded fix: search bug 2026-02-02 15:21:59 +08:00
imeepos 8f33ade8df fix: type error 2026-01-29 18:46:34 +08:00
imeepos 5a4d1ac1bd fix: app 2026-01-29 18:33:03 +08:00
imeepos 5e4a9c82cd fix: bug 2026-01-29 18:16:00 +08:00
imeepos 6ca686f2c9 fix: bug 2026-01-29 16:51:13 +08:00
imeepos a087cafc99 fix: bug 2026-01-29 16:42:42 +08:00
imeepos 1ccdc23355 fix: bug 2026-01-29 16:20:01 +08:00
imeepos 7c3b3c066c fix: bug 2026-01-29 16:00:21 +08:00
imeepos 7e6de68891 fix: bug 2026-01-29 15:51:39 +08:00
imeepos b716198d4b fix: use isLiked/isFavorited from API data for initial state
- Get store state separately from API data
- Merge strategy: store takes priority (for optimistic updates), fallback to API data
- Use item.isLiked and item.isFavorited for initial state
- Match the implementation pattern used in home page
2026-01-28 20:19:59 +08:00
imeepos d0b8a29698 fix: bug 2026-01-28 20:18:17 +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 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 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 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 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 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 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 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
imeepos 0b344b6b5f debug: add detailed logging for template filtering
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>
2026-01-21 15:20:58 +08:00
imeepos a344410374 fix: change type parameter from array to single value for API compatibility
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>
2026-01-21 15:15:47 +08:00
imeepos 4868ff8660 feat: integrate real message data with SDK in message page
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>
2026-01-21 14:58:32 +08:00