fix(ai): let assistant messages fill chat width

This commit is contained in:
digua committed 2026-06-10 00:15:25 +08:00
1 parent 1290ae6569
commit e71956ae3c
4 files changed
+13 -3

No files matched your search

+2 -1
View File
@@ -367,6 +367,7 @@ watch(
:class="{
'flex min-h-full flex-col justify-center px-4 pb-32 pt-4 space-y-0!':
messages.length === 0 && !isAIThinking,
'px-4': messages.length > 0 || isAIThinking,
}"
>
<!-- 空状态 Hero 区域 -->
@@ -509,7 +510,7 @@ watch(
<!-- 输入框区域 -->
<div class="px-4 pb-2">
<div class="mx-auto max-w-3xl">
<div class="mx-auto max-w-[740px]">
<AIChatInput
ref="chatInputRef"
:session-id="sessionId"
@@ -3,6 +3,15 @@ import { readFileSync } from 'node:fs'
import { describe, it } from 'node:test'
describe('ChatMessage plan validation rendering', () => {
it('lets assistant messages fill the available row while keeping user bubbles constrained', () => {
const source = readFileSync(new URL('./ChatMessage.vue', import.meta.url), 'utf8')
assert.ok(
source.includes("isUser && !isEditing ? 'max-w-[85%] min-w-0' : 'w-full min-w-0'"),
'assistant messages should use full width while user messages keep the existing max width'
)
})
it('does not render a manual step number inside the ordered validation list', () => {
const source = readFileSync(new URL('./ChatMessage.vue', import.meta.url), 'utf8')
const validationSection = source.slice(
+1 -1
View File
@@ -457,7 +457,7 @@ async function handleCopyMarkdown() {
:class="[isUser && !isEditing ? 'flex-row-reverse' : '', isSummary ? 'justify-center' : '']"
>
<!-- 消息内容 -->
<div :class="[isSummary || isEditing ? 'w-full min-w-0' : 'max-w-[85%] min-w-0']">
<div :class="[isUser && !isEditing ? 'max-w-[85%] min-w-0' : 'w-full min-w-0']">
<!-- System 消息:可折叠的上下文总结 -->
<template v-if="isSummary">
<details
+1 -1
View File
@@ -141,7 +141,7 @@ export function useScreenCapture() {
const originalMinWidth = element.style.minWidth
const originalMaxWidth = element.style.maxWidth
element.style.padding = '16px'
element.style.padding = '16px 40px'
element.style.paddingBottom = '48px' // 为水印留出空间
const computedPosition = window.getComputedStyle(element).position
if (computedPosition === 'static') {