Merge remote-tracking branch 'origin/main' into codex/video-logo-resilience-20260811

This commit is contained in:
chenpei 2026-08-12 18:16:07 +08:00
commit d4fb3971e9
2 changed files with 34 additions and 0 deletions

View File

@ -905,6 +905,19 @@ export function WorkReviewReviewerWorkspace({
</div>
</div>
)}
<section
className="shrink-0 border-b border-[#dfe5ee] bg-[#f8fafc] px-3 py-3 sm:px-4"
aria-labelledby="work-review-description-title"
>
<div className="grid gap-1 sm:grid-cols-[auto_minmax(0,1fr)] sm:items-start sm:gap-4">
<h2 id="work-review-description-title" className="text-[12px] font-bold leading-5 text-[#344054]">
作品说明
</h2>
<p className="max-h-24 overflow-y-auto whitespace-pre-wrap break-words text-[12px] leading-5 text-[#526173] [overflow-wrap:anywhere]">
{project.description?.trim() || '未填写作品说明'}
</p>
</div>
</section>
<div className="relative min-h-0 flex-1 overflow-hidden">
<div
ref={comparisonRef}

View File

@ -63,6 +63,27 @@ const projectWithReference: WorkReviewProject = {
}
describe('WorkReviewReviewerWorkspace', () => {
test('shows the submitted work description above the image workspace', () => {
render(
<WorkReviewReviewerWorkspace
project={{
...project,
description: '用于测试新版视觉主图。\n重点关注标题层级与产品卖点。',
}}
onSubmitReview={jest.fn()}
/>,
)
const description = screen.getByText((_, element) => (
element?.tagName === 'P'
&& element.textContent === '用于测试新版视觉主图。\n重点关注标题层级与产品卖点。'
))
expect(screen.getByRole('heading', { name: '作品说明' })).toBeInTheDocument()
expect(description).toHaveClass('whitespace-pre-wrap', 'break-words')
expect(description.compareDocumentPosition(screen.getAllByText('作品图片')[0]))
.toBe(Node.DOCUMENT_POSITION_FOLLOWING)
})
test('keeps mobile box selection under app control and recovers after a cancelled gesture', async () => {
window.PointerEvent = MouseEvent as typeof PointerEvent
const user = userEvent.setup()