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
This commit is contained in:
lafay
2026-03-21 20:55:36 +08:00
parent 25071d2303
commit d273569911
30 changed files with 4395 additions and 572 deletions

View File

@@ -502,10 +502,9 @@ interface UseMessageListRefreshReturn {
* 从 ChatScreen 返回时MessageManager 内存状态已经是最新的markAsRead 乐观更新),
* 无需再请求服务器(避免时序竞争覆盖已读状态)。
* 仅在用户主动下拉刷新时才触发服务器请求。
* @deprecated isFocused 参数保留仅为向后兼容,不再触发焦点刷新
* 注意:isFocused 参数已移除,不再触发焦点刷新
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function useMessageListRefresh(_isFocused?: boolean): UseMessageListRefreshReturn {
export function useMessageListRefresh(): UseMessageListRefreshReturn {
const [isRefreshing, setIsRefreshing] = useState(false);
const lastRefreshTimeRef = useRef<number>(0);