fix: tab switch loading state and full-view loading overlay#2
fix: tab switch loading state and full-view loading overlay#2obkim-hello wants to merge 1 commit intoandroidZzT:mainfrom
Conversation
obkim-hello
commented
Mar 19, 2026
- Tab switcher now calls selectSource() to trigger refresh + loading state
- selectSource() syncs activeTab so tab highlight stays in sync
- Add full-view loading overlay with TimelineView-based spinning ring
- Add L10n.loading for bilingual "Loading" / "加载中" text
- Tab switcher now calls selectSource() to trigger refresh + loading state - selectSource() syncs activeTab so tab highlight stays in sync - Add full-view loading overlay with TimelineView-based spinning ring - Add L10n.loading for bilingual "Loading" / "加载中" text Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
🤖 Code Review📋 概要修复 tab 切换时的加载状态,新增全局 loading 遮罩,tab 点击改为走 ✅ 优点
|
androidZzT
left a comment
There was a problem hiding this comment.
This PR needs to be rebased onto the latest main branch before it can be reviewed. Several PRs have been merged since this was opened (including significant refactoring of StatsViewModel in PR #6), so there will likely be conflicts that need resolving. Please rebase and force-push.
androidZzT
left a comment
There was a problem hiding this comment.
感谢提交这个 PR!Loading overlay 的方向是对的,但发现几个需要修复的问题:
需要修改的问题
1. Loading Overlay 重复(HIGH)
新增的全屏 loading overlay 与现有的 overlay(约 line 143-160)同时存在。当 isLoading == true 时两个 overlay 会叠加显示。
建议:移除旧的 overlay,只保留新的 TimelineView 版本。
2. 动画旋转速度过快(MEDIUM)
.rotationEffect(.degrees(timeline.date.timeIntervalSince1970 * 200))timeIntervalSince1970 是一个很大的数字(~1.7 billion),乘以 200 后旋转角度极大,虽然视觉上取模后可能看起来还行,但建议用 truncatingRemainder 控制旋转周期:
.rotationEffect(.degrees(timeline.date.timeIntervalSince1970.truncatingRemainder(dividingBy: 3.6) * 100))3. Tab 切换与数据刷新的时序(LOW)
selectSource() 中 activeTab 同步更新,但 refresh() 是异步的。在 refresh 完成前,tab 高亮已切换但数据还是旧的。建议确认这个中间状态的 UX 是否符合预期。
其他方面(L10n、代码风格)都没问题。修复 overlay 重复问题后可以合并。