style: 优化剧集阅读吸顶标题

This commit is contained in:
GouJ
2026-09-22 19:29:27 +08:00
parent a442087ea9
commit 65e8f9c3ba
4 changed files with 15 additions and 24 deletions
@@ -71,7 +71,14 @@ describe('连续剧本阅读器', () => {
expect(content).toContain('padding: 32px')
expect(content).toContain('text-align: left')
expect(content).not.toContain('auto')
expect(css).toMatch(/@media \(max-width: 800px\)[\s\S]*?\.reader-content\s*\{\s*padding-inline:\s*18px/)
expect(css).toMatch(
/\.reader-chapter-heading\s*\{[^}]*position:\s*sticky;[^}]*top:\s*0;[^}]*z-index:\s*2;[^}]*background:\s*var\(--app-surface\)/
)
expect(css).toMatch(
/\.reader-chapter-heading\s*\{[^}]*margin-inline:\s*calc\(var\(--reader-gutter\) \* -1\);[^}]*padding:\s*14px var\(--reader-gutter\) 18px;/
)
expect(css).toMatch(/@media \(max-width: 800px\)[\s\S]*?\.reader-content\s*\{[^}]*padding-inline:\s*18px/)
expect(css).toMatch(/@media \(max-width: 800px\)[\s\S]*?\.reader-content\s*\{[^}]*--reader-gutter:\s*18px/)
expect(css).toMatch(/@media \(max-width: 800px\)[\s\S]*?\.episode-reader\s*\{[^}]*72px/)
})
+2 -13
View File
@@ -21,7 +21,6 @@ import {
} from '@/features/storyboard/testing/fixtures'
import { getStoryboardSession } from '@/features/storyboard/model'
import { getOperation } from '@/features/workflows/operations'
import { readAllStyles } from '@/testing/styles'
import SubjectImagesPage from '@/features/subject-images/SubjectImagesPage.vue'
import { formFixture, imageFixture } from '@/features/subject-images/testing/fixtures'
import { getImageSession } from '@/features/subject-images/model'
@@ -1452,9 +1451,6 @@ describe('工作台页面交互', () => {
wrapper = mount(CreateProjectDialog, { attachTo: document.body })
button('新建剧本').click()
await flushPromises()
const title = document.querySelector<HTMLInputElement>('#title')!
title.value = ' 记忆当铺 '
title.dispatchEvent(new Event('input', { bubbles: true }))
const topic = document.querySelector<HTMLTextAreaElement>('#topic')!
topic.value = ' 雨夜来信 '
topic.dispatchEvent(new Event('input', { bubbles: true }))
@@ -1465,7 +1461,6 @@ describe('工作台页面交互', () => {
await flushPromises()
expect(wrapper.emitted('created')).toEqual([['created']])
expect(JSON.parse(fetcher.mock.calls[0]![1]!.body as string)).toEqual({
title: '记忆当铺',
topic: '雨夜来信',
style: '',
episodeCount: 6
@@ -1504,13 +1499,6 @@ describe('工作台页面交互', () => {
expect(provided.refresh).toHaveBeenCalledOnce()
})
it('窄屏隐藏进入拆解,选择器需压过工具栏文字按钮', () => {
const css = readAllStyles()
expect(css).toMatch(
/@media \(max-width: 800px\)[\s\S]*?\.tabs-toolbar-actions \.script-next-link\s*\{[^}]*display:\s*none/
)
})
it('切换剧本标签保留阅读容器和位置,执行记录按需展开', async () => {
wrapper = mount(CreateDramaPage, {
attachTo: document.body,
@@ -1518,7 +1506,8 @@ describe('工作台页面交互', () => {
})
const suffix = wrapper.get('.script-section .n-tabs-nav__suffix')
expect(suffix.findAll('button').map(item => item.attributes('aria-label'))).toEqual(['剧本更多操作'])
expect(suffix.get('router-link-stub').attributes('to')).toBe(`/projects/${fixture.id}/breakdown`)
expect(suffix.find('router-link-stub').exists()).toBe(false)
expect(suffix.text()).not.toContain('进入拆解')
const reader = wrapper.get<HTMLElement>('.reader-scroll .n-scrollbar-container').element
reader.scrollTop = 120
expect(wrapper.find('.history-panel').exists()).toBe(false)