feat(ui): add emoji picker with FlatList virtualization and improve input components
Some checks failed
Frontend CI / build-and-push-web (push) Failing after 2m43s
Frontend CI / ota-android (push) Successful in 10m32s
Frontend CI / build-android-apk (push) Successful in 47m43s

- Add full emoji picker with virtualized FlatList to CreatePostScreen and PostDetailScreen
- Add autoExpand prop to PostMentionInput for XHS-style content area
- Improve mention item styling with @ icon and hint text
- Fix HomeScreen tab switching race condition with requestAnimationFrame
- Fix PostRepository pagination to prefer cursor over page parameter
- Fix user store imports to use explicit UserManager path
- Refactor useCurrentUser hook to use sessionStore directly
This commit is contained in:
lafay
2026-04-24 16:44:01 +08:00
parent b2c3d5e54e
commit 738e75a79d
9 changed files with 277 additions and 75 deletions

View File

@@ -439,8 +439,18 @@ export const HomeScreen: React.FC = () => {
// Tab 切换时刷新数据并重置列表
useEffect(() => {
reset();
refresh();
let cancelled = false;
const run = async () => {
reset();
// reset 会清空 store 中的状态,但异步订阅可能有延迟;
// 等一帧确保 store 的订阅回调已传播到 useDifferentialPosts
await new Promise(resolve => requestAnimationFrame(resolve));
if (!cancelled) {
await refresh();
}
};
run();
return () => { cancelled = true; };
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [activeIndex, currentChannelId]);