diff --git a/src/components/agent/AgentAssistantPanel.vue b/src/components/agent/AgentAssistantPanel.vue index 9ee51b42..088cb9b7 100644 --- a/src/components/agent/AgentAssistantPanel.vue +++ b/src/components/agent/AgentAssistantPanel.vue @@ -228,6 +228,7 @@ const historyLoading = ref(false) const historyLoadingMore = ref(false) const historyPage = ref(1) const historyHasMore = ref(true) +const fullscreen = ref(false) const slashCommands = ref([]) const slashCommandsLoading = ref(false) const slashCommandsLoaded = ref(false) @@ -293,8 +294,10 @@ const recordingTimeText = computed(() => { return `${minutes}:${String(remainSeconds).padStart(2, '0')}` }) -// 窄屏下直接全屏,避免聊天内容被压成半屏窄栏。 -const drawerWidth = computed(() => (display.mdAndDown.value ? '100vw' : '30rem')) +// 窄屏下直接全屏,桌面端则允许用户按需扩展对话区域。 +const drawerWidth = computed(() => (display.mdAndDown.value || fullscreen.value ? '100vw' : '30rem')) +// 仅桌面宽屏展示全屏开关,窄屏已默认占满视口。 +const canToggleFullscreen = computed(() => !display.mdAndDown.value) const hasMessages = computed(() => messages.value.length > 0) const hasHistorySessions = computed(() => historySessions.value.length > 0) const currentUserName = computed(() => userStore.getUserName || t('common.user')) @@ -2180,6 +2183,11 @@ function closeDrawer() { isOpen.value = false } +// 在桌面侧栏与全屏对话模式之间切换。 +function toggleFullscreen() { + fullscreen.value = !fullscreen.value +} + // 同步面板打开状态到全局 DOM,供悬浮入口避让面板宽度。 function syncAgentAssistantOpenState(isOpen: boolean) { if (typeof document === 'undefined') return @@ -2238,10 +2246,12 @@ function handleInputKeydown(event: KeyboardEvent) { sendMessage() } +// 开始输入法组合输入,避免回车确认候选词时误发送消息。 function handleCompositionStart() { isComposing.value = true } +// 结束输入法组合输入,恢复回车发送能力。 function handleCompositionEnd() { isComposing.value = false } @@ -2288,7 +2298,11 @@ onScopeDispose(() => {