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
@@ -44,6 +44,9 @@ const activeWorkspaceSessionId = computed(() => chatStore.activeSession?.workspa
const activeWorkspacePath = computed(() => chatStore.activeSession?.workspace && !chatStore.activeSession.isLocalOnly ? chatStore.activeSession.workspace : null);
const TOOL_PANEL_MIN_WIDTH = 360;
const TOOL_PANEL_DEFAULT_WIDTH = 560;
// 工具栏要单行放下:附件 + 推理强度 + 设置 + 模型下拉(最长 190px)+ 语音 + 发送,
// 再加输入框左右内边距。窄于此值 Arco 按钮会被挤成竖排。
const CHAT_MAIN_MIN_WIDTH = 620;
const TOOL_PANEL_STORAGE_KEY = "hermes.chat.toolPanelWidth";
const toolPanelWidth = ref(loadToolPanelWidth());
const toolResizeStart = ref<{ x: number; width: number } | null>(null);
@@ -102,7 +105,9 @@ function toolPanelMaxWidth() {
if (typeof window === "undefined") return 1180;
if (isMobile.value) return window.innerWidth;
const available = chatContentWrapperRef.value?.clientWidth || window.innerWidth;
return Math.max(320, Math.min(Math.floor(available * 0.88), available - 120));
// 主区要放得下输入工具栏(附件 + 推理强度 + 设置 + 模型 + 语音 + 发送),
// 否则面板一展开工具栏就被压成竖排。
return Math.max(320, Math.min(Math.floor(available * 0.88), available - CHAT_MAIN_MIN_WIDTH));
}
function clampToolPanelWidth(width: number) {
@@ -2068,7 +2073,7 @@ async function handleSessionModelCustomSubmit() {
gap: 4px;
height: 22px;
.n-button {
.arco-btn {
display: inline-flex;
align-items: center;
justify-content: center;
@@ -2150,24 +2155,20 @@ async function handleSessionModelCustomSubmit() {
gap: 14px;
}
:deep(.new-chat-drawer .n-drawer-content) {
:deep(.new-chat-drawer .arco-drawer) {
height: 100%;
display: flex;
flex-direction: column;
}
:deep(.new-chat-drawer .n-drawer-header),
:deep(.new-chat-drawer .n-drawer-footer) {
:deep(.new-chat-drawer .arco-drawer-header),
:deep(.new-chat-drawer .arco-drawer-footer) {
flex-shrink: 0;
}
:deep(.new-chat-drawer .n-drawer-body) {
:deep(.new-chat-drawer .arco-drawer-body) {
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
}
:deep(.new-chat-drawer .n-drawer-body-content-wrapper) {
height: 100%;
overflow-y: auto;
}
@@ -2181,7 +2182,7 @@ async function handleSessionModelCustomSubmit() {
}
@media (max-width: $breakpoint-mobile) {
:deep(.new-chat-drawer .n-drawer-body-content-wrapper) {
:deep(.new-chat-drawer .arco-drawer-body) {
padding-top: 12px;
padding-bottom: 12px;
}