fix(app-iced): 退场窗口内 Esc 也被吃掉(补键盘入口的闸门)
模态退场期间逻辑状态已关(state.dialogs 空),但 Esc 走的是 Message::Agent(Key) 那条 独立路径,不经过 on_dialog 的 modal_closing 闸门 ⇒ 那 150ms 里 Esc 会落到 AI 栏去收起面板。 escape() 顶部加同一道闸门(返回 true = 被吃掉),并给退场用例补一条断言。
This commit is contained in:
1 parent
098f3b8946
commit
4a77f1b421
2 files changed
+15
-3
No files matched your search
@@ -145,6 +145,12 @@ pub(super) fn on_dialog(app: &mut App, message: DialogMessage) -> Task<crate::ap
|
||||
|
||||
/// `Esc` 关弹窗(有弹窗时**先吃这一条**,不让它落到 AI 栏的 Esc 收起上)。
|
||||
pub(super) fn escape(app: &mut App) -> bool {
|
||||
// M256:退场窗口里 Esc **也算被吃掉**。`on_dialog` 那道闸门管不到这里(Esc 走的是
|
||||
// `Message::Agent(Key)` 这条独立路径),而逻辑状态已经关掉 ⇒ 不加这一行,Esc 会落到
|
||||
// AI 栏去收起面板,用户看到的是「框还在缩、AI 栏先没了」。
|
||||
if motion::modal_closing() {
|
||||
return true;
|
||||
}
|
||||
let Some(current) = app.state.dialogs.current().map(|request| request.id) else {
|
||||
return false;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user