Repository navigation
Conversation
| bool restored = false; | ||
| if (windowState != null) { | ||
| if (savedState != null) { | ||
| restored = await windowState.restoreNormalLayout( |
There was a problem hiding this comment.
WARNING: If layout restoration throws, the window stays hidden
The window is hidden until windowManager.show() on line 103, and nothing guards the restoration code before it. restoreNormalLayout catches errors from its first attempt, but its fallback _restoreDefaultLayout (_prepareNormalWindow, setSize, center) runs inside the catch block with no guard of its own. If any of those plugin calls throws, for example isMinimized or isMaximized failing a second time, the exception escapes this callback. show(), focus() and startListening() then never run. waitUntilReadyToShow doesn't await the callback, so the process keeps running with no visible window. Before this PR the callback only called show/focus, so this failure mode is new.
Put the restoration in a try and call show()/focus()/startListening() in a finally, or catch errors from the default-layout fallback inside restoreNormalLayout.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (12 files)
Fix these issues in Kilo Cloud Reviewed by claude-opus-5.5 · Input: 0 · Output: 0 · Cached: 0 |
描述
在 Windows 平台增加窗口布局记忆功能,启动时恢复上次正常窗口的大小、位置及最大化状态。
关联的 Issues
#1080 #1316 #2147
PR 类型
AI 辅助开发
AI 辅助模型:
OpenAI GPT-6.1 Sol
提交前检查
附注
本次窗口布局记忆功能仅针对 Windows 实现。由于缺少 Linux 和 macOS 的实机测试环境,暂未将该功能扩展到这两个平台。
为了统一,三个桌面平台共用的桌面 PiP 比例更新流程和默认尺寸函数有所调整。