fix(chat): repair Arco migration fallout in the chat page

The Phase 006 walkthrough surfaced four issues the automated checks could
not see. Dead naive-ui class names left behind by the migration stopped
matching, tooltips that carried their label as trailing default-slot text
leaked that text into the flex row, the workspace panel squeezed the chat
column until the input toolbar wrapped, and the Escape fallback still
looked for naive-ui's modal mask.

Tooltips now pass their label through the content prop, the tool panel
reserves a minimum width for the chat column, and Escape finds the visible
Arco modal and clicks its close button.
This commit is contained in:
2026-10-18 03:11:35 +08:00
parent effc29085c
commit c3eeea4187
10 changed files with 181 additions and 85 deletions
@@ -36,12 +36,14 @@ export function useKeyboard() {
closeSessionSearch()
return
}
// Close any open modals — naive-ui handles this internally
const modal = document.querySelector('.n-modal-mask')
if (modal) {
const closeBtn = modal.querySelector('.n-base-close') as HTMLElement
closeBtn?.click()
}
// 聊天页的弹窗已全部迁到 Arco(且都带 unmount-on-close),Esc 兜底要查
// Arco 的类名,否则模型选择、会话搜索这些弹窗在键盘下关不掉。
const openModal = Array.from(
document.querySelectorAll<HTMLElement>('.arco-modal'),
).find((el) => el.offsetParent !== null)
openModal
?.querySelector<HTMLElement>('.arco-modal-close-btn')
?.click()
}
}