feat: 优化 AI 教练聊天和打卡功能
- 在 AI 教练聊天界面中添加会话缓存功能,支持冷启动时恢复聊天记录 - 实现轻量防抖机制,确保会话变动时及时保存缓存 - 在打卡功能中集成按月加载打卡记录,提升用户体验 - 更新 Redux 状态管理,支持打卡记录的按月加载和缓存 - 新增打卡日历页面,允许用户查看每日打卡记录 - 优化样式以适应新功能的展示和交互
This commit is contained in:
@@ -41,8 +41,15 @@ function ProgressBarImpl({
|
||||
}).start();
|
||||
}, [clamped, animated, animatedValue]);
|
||||
|
||||
const lastWidthRef = useRef<number>(0);
|
||||
const onLayout = (e: LayoutChangeEvent) => {
|
||||
setTrackWidth(e.nativeEvent.layout.width);
|
||||
const w = e.nativeEvent.layout.width || 0;
|
||||
// 仅在宽度发生明显变化时才更新,避免渲染-布局循环
|
||||
const next = Math.round(w);
|
||||
if (next > 0 && next !== lastWidthRef.current) {
|
||||
lastWidthRef.current = next;
|
||||
setTrackWidth(next);
|
||||
}
|
||||
};
|
||||
|
||||
const fillWidth = Animated.multiply(animatedValue, trackWidth || 1);
|
||||
|
||||
Reference in New Issue
Block a user