Commit Graph

58 Commits

Author SHA1 Message Date
lafay
c98f1917f7 refactor(LocalDataSource, PostRepository, ChatScreen): enhance database handling and message loading
Some checks failed
Frontend CI / build-and-push-web (push) Successful in 2m41s
Frontend CI / ota-android (push) Successful in 12m45s
Frontend CI / build-android-apk (push) Has been cancelled
- Introduced a promise-based initialization mechanism in LocalDataSource to prevent concurrent initialization issues.
- Updated PostRepository to utilize an enqueueWrite method for database operations, ensuring thread-safe writes.
- Refactored ChatScreen to improve message loading logic, including preloading history and managing scroll behavior more effectively.
- Enhanced message rendering logic to maintain correct indices in inverted lists and optimize user experience during scrolling.
2026-03-23 23:06:19 +08:00
lafay
7305254e11 refactor(PostCard, ImageGrid, SmartImage): enhance post editing display and image handling
All checks were successful
Frontend CI / build-and-push-web (push) Successful in 4m39s
Frontend CI / ota-android (push) Successful in 10m59s
Frontend CI / build-android-apk (push) Successful in 59m29s
- Introduced a new method to determine the last edited time for posts, prioritizing content_edited_at for better accuracy in display.
- Updated PostCard and PostDetailScreen components to utilize the new editing display logic.
- Enhanced ImageGrid and SmartImage components to support additional preview URLs and improve image loading behavior, including lazy loading optimizations for web.
- Modified Post and PostDTO interfaces to include contentEditedAt for better tracking of post edits.
2026-03-23 14:21:22 +08:00
lafay
d97df0b2d4 refactor(MessageManager): enhance conversation list handling and integrate local source fallback
Some checks failed
Frontend CI / build-and-push-web (push) Successful in 4m34s
Frontend CI / ota-android (push) Successful in 10m57s
Frontend CI / build-android-apk (push) Has been cancelled
- Update MessageManager to support both remote and local conversation list sources, improving data retrieval and offline capabilities.
- Refactor hooks and components to utilize the new MessageManager structure, ensuring seamless integration of cursor pagination and local caching.
- Introduce new types and methods for better management of conversation data and loading states.
- Modify MessageListScreen to leverage the updated hooks for fetching conversations, enhancing user experience with improved loading and pagination handling.
2026-03-23 13:40:48 +08:00
lafay
26ae288470 refactor: standardize pagination response structure and enhance cursor handling
All checks were successful
Frontend CI / build-and-push-web (push) Successful in 5m8s
Frontend CI / ota-android (push) Successful in 11m22s
Frontend CI / build-android-apk (push) Successful in 45m46s
- Update various services and hooks to replace 'items' with 'list' for consistency in pagination responses.
- Modify PostRepository, commentService, groupService, messageService, and postService to align with the new response structure.
- Enhance cursor pagination logic in hooks and components to ensure proper handling of pagination states.
- Refactor HomeScreen, PostDetailScreen, SearchScreen, and other components to utilize the updated pagination structure.
2026-03-23 03:58:26 +08:00
lafay
88510aa6ae feat(api): implement token auto-refresh mechanism and enhance token management
Some checks failed
Frontend CI / ota-android (push) Successful in 10m55s
Frontend CI / build-and-push-web (push) Failing after 13m25s
Frontend CI / build-android-apk (push) Successful in 56m26s
- Add support for proactive token refresh when nearing expiration to improve user experience.
- Introduce a refresh lock to prevent concurrent token refresh requests.
- Update token handling in API client to ensure valid tokens are used for requests.
- Modify authService to handle refresh token requests with improved error handling and response management.
2026-03-23 00:34:26 +08:00
lafay
cee120a6f8 refactor(PostRepository): update PostsListApiResponse structure and handle response mapping
Some checks failed
Frontend CI / build-and-push-web (push) Failing after 5m21s
Frontend CI / ota-android (push) Successful in 10m57s
Frontend CI / build-android-apk (push) Has been cancelled
- Change 'posts' to 'list' in PostsListApiResponse for consistency with API response.
- Introduce optional fields: 'page', 'page_size', and 'total_pages' for enhanced pagination support.
- Update response handling in PostRepository methods to accommodate new structure and ensure default values for 'hasMore'.
2026-03-23 00:16:10 +08:00
lafay
69e21471fe fix(groupService): add missing closing brace
Some checks failed
Frontend CI / ota-android (push) Successful in 10m53s
Frontend CI / build-and-push-web (push) Failing after 16m53s
Frontend CI / build-android-apk (push) Successful in 1h16m19s
2026-03-21 21:13:34 +08:00
lafay
d273569911 refactor: migrate post operations to use case architecture with differential updates
Some checks failed
Frontend CI / build-and-push-web (push) Failing after 3m11s
Frontend CI / ota-android (push) Failing after 16m3s
Frontend CI / build-android-apk (push) Has been cancelled
Migrate post-related operations from direct service/store calls to a new use case architecture featuring differential updates. Key changes include: (1) introduce ProcessPostUseCase to handle like, unlike, favorite, unfavorite, delete, and fetch operations with proper state management, (2) add useDifferentialPosts hook for efficient list rendering with minimal re-renders, (3) add PostDiffCalculator and PostUpdateBatcher in infrastructure layer for incremental updates, (4) deprecate NotificationItem component in favor of SystemMessageItem, (5) remove deprecated interactive methods from userStore, (6) add posts_cache table to local datasource, (7) clean up legacy MessageDTO and ConversationDTO types, (8) remove deprecated hook useBreakpointCheck, (9) refactor MessageBubble to use measureInWindow directly for better React Native compatibility
2026-03-21 20:55:36 +08:00
lafay
25071d2303 ci: 添加Gradle缓存、node_modules缓存和Docker构建缓存
Some checks failed
Frontend CI / ota-android (push) Successful in 14m5s
Frontend CI / build-android-apk (push) Successful in 51m52s
Frontend CI / build-and-push-web (push) Failing after 9m50s
2026-03-21 14:15:41 +08:00
lafay
37ddfa8ed6 feat(ui): redesign system message item with card-style layout and add title validation
All checks were successful
Frontend CI / build-and-push-web (push) Successful in 2m39s
Frontend CI / ota-android (push) Successful in 12m4s
Frontend CI / build-android-apk (push) Successful in 44m0s
- Refactor SystemMessageItem with modern card design, gradient colors, and improved visual hierarchy
- Add unread indicator, status badges, and enhanced avatar badges for message types
- Update CreatePostScreen to require title input and improve placeholder text
- Add Android back button handling for notification screens in embedded mode
- Replace manual shadow styles with theme shadow utilities across message screens
2026-03-21 12:08:45 +08:00
lafay
a8c78f0c3f feat: 同步dev分支并保留当前修改
Some checks failed
Frontend CI / build-and-push-web (push) Failing after 1m35s
Frontend CI / ota-android (push) Successful in 13m3s
Frontend CI / build-android-apk (push) Successful in 39m23s
2026-03-21 03:22:28 +08:00
lafay
2c65330837 Merge remote-tracking branch 'origin/dev' into release/v1.0.11
Some checks failed
Frontend CI / build-and-push-web (push) Successful in 3m35s
Frontend CI / ota-android (push) Successful in 10m58s
Frontend CI / build-android-apk (push) Has been cancelled
2026-03-21 01:44:58 +08:00
lafay
97c7762f2b feat(navigation): add profile stack navigator and fix API endpoints
- Add ProfileStackNavigatorComponent with full navigation stack (Profile, Settings, EditProfile, AccountSecurity, MyPosts, Bookmarks, NotificationSettings, BlockedUsers)
- Add null checks for response data in authService login, register, and refreshToken methods
- Fix postService API routes to use correct endpoints (/posts instead of /posts/cursor)
- Remove completed cursor pagination design document
2026-03-21 01:36:40 +08:00
001140c7e1 Merge pull request 'release/v1.0.11' (#4) from release/v1.0.11 into dev
All checks were successful
Frontend CI / build-and-push-web (push) Successful in 4m32s
Frontend CI / ota-android (push) Successful in 18m36s
Frontend CI / build-android-apk (push) Successful in 46m8s
Reviewed-on: #4
2026-03-20 23:04:50 +08:00
lafay
8a0aea1c59 feat(pagination): implement cursor-based pagination across the app
Add useCursorPagination hook and update multiple screens and services
to use cursor-based pagination for better performance and consistency.

- Add useCursorPagination hook with deduplication and caching support
- Add cursor pagination types to infrastructure layer
- Refactor HomeScreen, PostDetailScreen, SearchScreen for posts/comments
- Refactor GroupMembersScreen, JoinGroupScreen for groups/members
- Refactor MessageListScreen, NotificationsScreen for messages
- Update post, message, group, comment, notification services with cursor endpoints
- Add CursorPaginationRequest/Response DTOs
- Remove deprecated OPTIMIZATION_DESIGN.md documentation
2026-03-20 23:00:27 +08:00
lafay
a005fb0a15 feat: add QR code login and enhance chat experience
- Add QR code login flow with scanner and confirmation screens
- Implement swipe-to-reply in chat with SwipeableMessageBubble
- Replace FlatList with FlashList for chat performance optimization
- Add Schedule stack navigator with CourseDetail screen support
- Configure deep linking for QR code login (carrotbbs://qrcode/login/:sessionId)
- Update branding from 胡萝卜 to 萝卜社区
- Display dynamic app version in settings
2026-03-20 19:28:42 +08:00
lafay
59877e6ae3 chore: bump version to 1.0.11 2026-03-20 12:23:26 +08:00
lafay
7d9670e973 ci: use android-builder runner for APK build
Some checks failed
Frontend CI / ota-android (push) Successful in 13m14s
Frontend CI / build-and-push-web (push) Failing after 35m39s
Frontend CI / build-android-apk (push) Successful in 1h3m35s
2026-03-19 10:57:24 +08:00
lafay
de94447844 fix(frontend): 修复 TypeScript 类型错误,与后端 API 响应结构对齐
Some checks failed
Frontend CI / build-android-apk (push) Has been cancelled
Frontend CI / build-and-push-web (push) Has been cancelled
Frontend CI / ota-android (push) Has been cancelled
- 修复 UserDTO 类型定义,字段改为非 nullable 类型
- 修复 PostMapper 使用正确的 snake_case 字段名
- 修复 UserMapper 移除不存在的 is_blocked 和 updated_at 字段
- 修复 MessageMapper 使用 segments 替代已移除的字段
- 修复 MessageSyncService 正确处理 API 响应类型
- 修复 LocalDataSource SQLite 参数类型问题
- 修复导航相关类型错误
- 修复 PostDetailScreen 和 EditProfileScreen 的 null/undefined 类型不匹配
2026-03-19 10:53:09 +08:00
lan
a91637466c refactor(messaging): replace WebSocket with SSE for real-time message handling
Some checks failed
Frontend CI / build-android-apk (push) Has been cancelled
Frontend CI / build-and-push-web (push) Has been cancelled
Frontend CI / ota-android (push) Has been cancelled
Frontend CI / ota-android (pull_request) Has been skipped
Frontend CI / build-and-push-web (pull_request) Has been cancelled
Frontend CI / build-android-apk (pull_request) Has been cancelled
Replace WebSocket-based real-time communication with Server-Sent Events (SSE) across the messaging infrastructure. This includes:

- Create new SSEClient datasource to manage SSE connections
- Create new SSEMessageHandler to process SSE events
- Update ProcessMessageUseCase to use SSEClient instead of WebSocketClient
- Update MessageManager and MessageStateManager to work with SSE handlers
- Rename connection state variables from `isWebSocketConnected` to `isSSEConnected`
- Update type definitions in dto.ts (WSEventType → SSEEventType, etc.)
- Delete obsolete WebSocketClient and WebSocketMessageHandler files
- Update comments and documentation to reflect SSE terminology

This refactoring aligns with the backend's SSE implementation for better compatibility with React Native's networking capabilities.
2026-03-19 00:56:41 +08:00
lafay
62b55aec31 feat(infrastructure): add pagination, cache, and sync infrastructure
All checks were successful
Frontend CI / ota-android (push) Successful in 14m38s
Frontend CI / build-android-apk (push) Successful in 1h0m2s
Frontend CI / build-and-push-web (push) Successful in 10m29s
- Add pagination infrastructure with usePagination and usePaginationManager hooks
- Add connection state management hook for network status tracking
- Add media caching infrastructure with useMediaCache hook
- Add differential message synchronization infrastructure
- Export new hooks from central index file
- Remove backup file MainNavigator.tsx.bak
2026-03-18 23:05:28 +08:00
lafay
a9c514f664 fix(post): prevent duplicate submission and fix navigation after posting
All checks were successful
Frontend CI / ota-android (push) Successful in 13m26s
Frontend CI / build-android-apk (push) Successful in 54m22s
Frontend CI / build-and-push-web (push) Successful in 10m44s
- add guard clause to prevent duplicate clicks when posting is in progress
- replace navigation.goBack() with navigation.reset to Main screen for cleaner navigation stack after post creation, update, and voting post submission
2026-03-18 21:09:55 +08:00
lafay
b11e6548d5 ci(build): optimize Android build performance with parallel execution and increased memory limits
Some checks failed
Frontend CI / ota-android (push) Failing after 7m8s
Frontend CI / build-android-apk (push) Successful in 1h11m44s
Frontend CI / build-and-push-web (push) Successful in 19m12s
Increase Gradle heap size from 2GB to 8GB, enable parallel builds with 4 workers, and update JVM options for faster CI pipeline execution. This reduces build times by utilizing more available resources in the build container.
2026-03-18 15:46:50 +08:00
lafay
2321c2dc06 refactor(navigation): replace direct navigation with navigation service
Some checks failed
Frontend CI / ota-android (push) Has been cancelled
Frontend CI / build-android-apk (push) Has been cancelled
Frontend CI / build-and-push-web (push) Has been cancelled
Replace direct `navigation.navigate()` and `navigation.getParent()?.navigate()` calls with centralized `navigationService.navigate()` across multiple screens. Convert screen component functions from JSX elements to array-returning functions in RootNavigator to fix React key warnings and improve render consistency.

- HomeScreen: use navigationService for post and user navigation
- PrivateChatInfoScreen: use navigationService for profile navigation
- ChatScreen: use navigationService for avatar press and user profile navigation
- RootNavigator: convert PublicScreens and AuthenticatedScreens to getPublicScreens() and getAuthenticatedScreens() functions returning arrays with proper keys
2026-03-18 14:52:58 +08:00
lafay
a8f7e907b6 chore: update package-lock.json for expo-linking
Some checks failed
Frontend CI / ota-android (push) Successful in 11m14s
Frontend CI / build-and-push-web (push) Has been cancelled
Frontend CI / build-android-apk (push) Has been cancelled
2026-03-18 14:28:18 +08:00
lafay
937e8112f4 fix: 修复安卓端帖子卡片点击事件冲突问题
Some checks failed
Frontend CI / ota-android (push) Failing after 4m51s
Frontend CI / build-and-push-web (push) Has been cancelled
Frontend CI / build-android-apk (push) Has been cancelled
- 为嵌套TouchableOpacity添加stopPropagation防止事件冒泡
- 修复grid模式下图片和用户头像点击事件
- 修复列表模式下所有交互按钮点击事件
- 优化手势配置添加shouldCancelWhenOutside
2026-03-18 14:21:24 +08:00
lafay
a6cdb97e24 refactor: 架构重构 - 解耦过度耦合模块
主要改动:
1. 创建乐观更新工具函数 (optimisticUpdate.ts)
   - 消除 userStore.ts 中的重复代码

2. 拆分 useResponsive.ts (485行 -> 12个专注模块)
   - useBreakpoint: 断点检测
   - useOrientation: 方向检测
   - usePlatform: 平台检测
   - useScreenSize: 屏幕尺寸
   - useResponsiveValue: 响应式值
   - useResponsiveStyle: 响应式样式
   - useMediaQuery: 媒体查询
   - useColumnCount: 列数计算
   - useResponsiveSpacing: 响应式间距

3. 整理数据层 (Repository 层)
   - ApiDataSource: API数据源
   - LocalDataSource: 本地数据源
   - CacheDataSource: 缓存数据源
   - MessageRepository: 消息仓库

4. 重构 messageManager.ts (2194行 -> 4个模块)
   - MessageStateManager: 状态管理
   - WebSocketMessageHandler: WebSocket处理
   - MessageSyncService: 消息同步
   - ReadReceiptManager: 已读管理

5. 导航解耦 (MainNavigator.tsx: 1118行 -> 100行)
   - 创建 NavigationService 解耦层
   - 拆分多个 Navigator 组件

架构改进:
- 单一职责原则: 每个模块职责明确
- 依赖倒置: 通过接口解耦
- 代码复用: 工具函数可被多处使用
- 可测试性: 各模块可独立测试
2026-03-18 12:11:49 +08:00
lafay
1ffbb63753 fix: 统一修复所有屏幕的安全区域问题
Some checks failed
Frontend CI / ota-android (push) Successful in 10m56s
Frontend CI / build-android-apk (push) Failing after 33m45s
Frontend CI / build-and-push-web (push) Failing after 46s
- 有 header 的屏幕使用 edges={['bottom']}(React Navigation 自动处理顶部)
- 没有 header 的屏幕使用 edges={['top', 'bottom']}(需要自己处理顶部)
- 修复了以下屏幕:
  - HomeScreen: edges={['bottom']} → ['top', 'bottom']
  - MessageListScreen: edges={['top']} → ['top', 'bottom']
  - ScheduleScreen: edges={['top']} → ['top', 'bottom']
  - ProfileScreen: edges={['top', 'bottom']} ✓ 已正确
  - PostDetailScreen: 空状态添加 edges={['bottom']}
  - UserScreen: 空状态添加 edges={['bottom']}
  - NotificationsScreen: edges={[]} → ['bottom']
  - SearchScreen: edges={['left', 'right']} → ['bottom']
  - BlockedUsersScreen: 加载状态添加 edges={['bottom']}
  - GroupInfoScreen: edges={['bottom']} ✓ 已正确
  - PrivateChatInfoScreen: 加载状态添加 edges={['bottom']}
2026-03-18 10:58:41 +08:00
lafay
e230e35ca2 fix: 修复安卓端发帖界面未避让状态栏的问题
Some checks failed
Frontend CI / ota-android (push) Successful in 10m53s
Frontend CI / build-android-apk (push) Failing after 10m15s
Frontend CI / build-and-push-web (push) Failing after 3m28s
2026-03-18 10:22:41 +08:00
lafay
23931df1da Merge branch 'feature/adap-pc' into dev
Some checks failed
Frontend CI / ota-android (push) Successful in 11m5s
Frontend CI / build-and-push-web (push) Has been cancelled
Frontend CI / build-android-apk (push) Has been cancelled
2026-03-18 10:00:00 +08:00
lafay
01796ac695 fix(ci): optimize memory settings for CI stability
Some checks failed
Frontend CI / ota-android (push) Successful in 11m31s
Frontend CI / build-android-apk (push) Failing after 42m46s
Frontend CI / build-and-push-web (push) Failing after 1m47s
Reduce JVM heap and metaspace allocation to fit runner limits.
Add NODE_OPTIONS and restrict NDK/CMake parallelism to prevent
out-of-memory errors during build.
2026-03-18 01:54:14 +08:00
lan
6c032cefbf fix(ci): 移除 dependencyResolutionManagement 让项目使用 build.gradle 仓库配置
Some checks failed
Frontend CI / ota-android (push) Successful in 11m5s
Frontend CI / build-android-apk (push) Failing after 43m29s
Frontend CI / build-and-push-web (push) Failing after 1m37s
2026-03-18 00:51:58 +08:00
71b4f8a679 修复了课程表和发帖按钮 2026-03-18 00:25:46 +08:00
lan
9fb78bb5ee fix(ci): 修复 Gradle 配置,使用完整的 settings.gradle 和 build.gradle 文件替换
Some checks failed
Frontend CI / ota-android (push) Successful in 11m19s
Frontend CI / build-android-apk (push) Failing after 19m34s
Frontend CI / build-and-push-web (push) Failing after 1m12s
2026-03-18 00:19:22 +08:00
lan
8a95dbcb59 fix(ci): 修复 YAML 格式问题,使用 heredoc 正确配置 Maven 镜像
Some checks failed
Frontend CI / ota-android (push) Successful in 12m14s
Frontend CI / build-android-apk (push) Failing after 7m26s
Frontend CI / build-and-push-web (push) Failing after 1m39s
2026-03-17 23:48:57 +08:00
lan
6ba24c59aa fix(ci): 添加阿里云 Maven 镜像解决网络不可达问题 2026-03-17 23:44:54 +08:00
lan
544a7ea156 fix(ci): 只编译 arm64 APK 并修复构建问题
Some checks failed
Frontend CI / ota-android (push) Successful in 11m18s
Frontend CI / build-android-apk (push) Failing after 7m49s
Frontend CI / build-and-push-web (push) Successful in 5m19s
2026-03-17 23:18:07 +08:00
lan
530f54a4a3 fix(ci): 只编译 arm64 APK 并修复 codegen 构建问题 2026-03-17 23:15:36 +08:00
lafay
3d1d7857df ci: 增加Metaspace到1g,移除clean任务减少内存消耗
Some checks failed
Frontend CI / ota-android (push) Successful in 12m36s
Frontend CI / build-android-apk (push) Failing after 23m12s
Frontend CI / build-and-push-web (push) Failing after 1m2s
2026-03-17 20:03:57 +08:00
lafay
4f4c190c3a ci: 修复hermesEnabled属性未定义问题
Some checks failed
Frontend CI / ota-android (push) Successful in 12m39s
Frontend CI / build-android-apk (push) Failing after 19m35s
Frontend CI / build-and-push-web (push) Successful in 3m37s
2026-03-17 19:25:56 +08:00
lafay
b4e4f33e3b ci: 进一步限制Gradle内存使用,设置workers.max=1,添加NODE_ENV
Some checks failed
Frontend CI / ota-android (push) Successful in 10m50s
Frontend CI / build-android-apk (push) Failing after 12m5s
Frontend CI / build-and-push-web (push) Successful in 2m46s
2026-03-17 16:57:16 +08:00
lafay
b010aefbe2 ci: 修复Gradle构建崩溃问题,禁用并行和守护进程
Some checks failed
Frontend CI / ota-android (push) Successful in 11m2s
Frontend CI / build-android-apk (push) Failing after 18m20s
Frontend CI / build-and-push-web (push) Has been cancelled
2026-03-17 16:25:21 +08:00
lan
4ec56de988 ci: 修复Android APK构建前置步骤
Some checks failed
Frontend CI / ota-android (push) Successful in 10m55s
Frontend CI / build-android-apk (push) Failing after 22m57s
Frontend CI / build-and-push-web (push) Successful in 3m2s
在 CI 的 APK 构建任务中增加 expo prebuild 以生成 android 工程,避免仓库未包含原生目录时构建失败。

Made-with: Cursor
2026-03-17 15:43:46 +08:00
lan
f328b2fd31 ci: 修复前端镜像仓库登录凭据
将前端 workflow 的容器仓库登录凭据改为与后端一致的 GIT_USERNAME/GIT_TOKEN,避免登录步骤缺少用户名或密码导致失败。

Made-with: Cursor
2026-03-17 15:26:12 +08:00
lan
f7fd849cb1 ci: 优化Android APK构建环境
Some checks failed
Frontend CI / ota-android (push) Failing after 6m30s
Frontend CI / build-android-apk (push) Failing after 9m13s
Frontend CI / build-and-push-web (push) Failing after 14s
将 APK 构建任务切换到预装 Android SDK 的容器镜像,移除在线安装 SDK 步骤以提升稳定性并避免许可证管道失败。

Made-with: Cursor
2026-03-17 15:24:10 +08:00
lan
ef955db99f ci: 增加前端构建发布流水线
Some checks failed
Frontend CI / ota-android (push) Failing after 9m24s
Frontend CI / build-android-apk (push) Failing after 7m12s
Frontend CI / build-and-push-web (push) Failing after 23s
新增 Gitea CI,覆盖 Android OTA 发布与校验、Android Release APK 打包,以及 Web Docker 镜像构建推送。

Made-with: Cursor
2026-03-17 15:04:12 +08:00
e626eb182b Merge pull request 'PC端的部分适配。登录,注册,首页导航栏竞态条件,搜索栏,系统消息解耦,群聊部分界面' (#2) from feature/adap-pc into master
Reviewed-on: #2
2026-03-17 14:45:34 +08:00
b50bd9abb3 修复了课表周数硬编码 2026-03-17 12:29:04 +08:00
582589d252 Merge remote-tracking branch 'origin/master' into feature/adap-pc 2026-03-16 19:27:05 +08:00
cb2087f779 PC端的部分适配 2026-03-16 17:47:10 +08:00