优化自动折叠逻辑稳定性、引入 UI 补救机制并增强日志系统 #365
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
核心逻辑重构与稳定性增强
边距检测。若检测到状态不一致,将强制重新执行收纳动画,大幅提升了 UI 表现的可靠性。
交互鲁棒性提升
中完善了状态锁判断,严格限制了在收纳/展开动画播放期间的重复触发,避免了因用户快速点击或短时间内多次触发导致的动画重叠和逻辑混乱。
物理边距以及自动折叠的识别结果。这为后续排查特定软件环境下的自动折叠失效提供了精确的数据支持。
旧版的逻辑像是一个不断打补丁的列表,通过一个巨大的 if-else if 链来运行:
没藏好,旧逻辑会直接跳过,导致侧边栏“卡”在屏幕中间。
新版通过“逻辑解耦”将检测和执行分开了:
为什么要合并这些更改?
本次修改主要解决了之前在频繁切换前台窗口的情况下有概率不能正确触发自动收纳,并显著增强了代码的健壮性和可调试性。