feat: v0.10.5 文件夹顶部布局重构、字符粒度统计、换目录状态重置与跨模式搜索一致 - 头部操作区6按钮竖排(约200px)改横排单行+快照归组下拉(约50px,列表可视高度+6行)、DiffSummary增charsAdded/charsDeleted码点统计(行级与字符级路径收敛summarize单一实现,字符级模式工具栏+徽章与三格式报告统计行同步,超长防护行不计)、重新选择新目录对后搜索/过滤/折叠/变迁过滤重置(同目录重扫保留,修复残留静默生效缺陷)、Ctrl+F跨模式聚焦分流+文件夹搜索框Esc清空+两个搜索框一键清空按钮,新增19单测(658全过覆盖率97.92/93.5/93.48/97.92)+E2E 30全过含滚动稳定性回归锚,文档四件套同步
This commit is contained in:
+18
-8
@@ -106,13 +106,16 @@ test.describe('比较选项端到端', () => {
|
||||
await app.close()
|
||||
})
|
||||
|
||||
test('字符级对比:跨行重组判为一致', async () => {
|
||||
test('字符级对比:跨行重组判为一致,字符粒度统计徽章出现(0.10.5)', async () => {
|
||||
const { app, window } = await launchApp()
|
||||
await pasteText(window, 'left', 'ab cd')
|
||||
await pasteText(window, 'right', 'ab\ncd')
|
||||
await expect(window.getByText('有差异')).toBeVisible()
|
||||
await window.getByLabel('字符级对比').check()
|
||||
await expect(window.getByText('两文件内容完全一致')).toBeVisible()
|
||||
// 字符级模式追加字符粒度增删徽章(一致场景为 +0 字 / −0 字)
|
||||
await expect(window.getByText('+0 字')).toBeVisible()
|
||||
await expect(window.getByText('−0 字')).toBeVisible()
|
||||
await app.close()
|
||||
})
|
||||
|
||||
@@ -604,10 +607,12 @@ test.describe('文件夹对比(主进程真实扫描链路)', () => {
|
||||
await expect(window.getByText('相同 1')).toBeVisible()
|
||||
await expect(window.getByText('不同 1')).toBeVisible()
|
||||
|
||||
// 保存快照(真实写盘):v2 结构含差异条目双侧内容(0.10.0 内容级对照)
|
||||
// 保存快照(真实写盘):v2 结构含差异条目双侧内容(0.10.0 内容级对照);
|
||||
// 快照归组下拉(0.10.5 布局重构):先开「快照」下拉再点菜单项
|
||||
const snapPath = join(root, 'baseline.json')
|
||||
await stubSaveDialog(app, snapPath)
|
||||
await window.getByRole('button', { name: '保存快照' }).click()
|
||||
await window.getByRole('button', { name: '快照' }).click()
|
||||
await window.getByText('保存快照…').click()
|
||||
await expect(window.getByText(/快照已保存/)).toBeVisible()
|
||||
const snapRaw = await readFile(snapPath, 'utf-8')
|
||||
expect(snapRaw).toContain('"version": 2')
|
||||
@@ -624,7 +629,8 @@ test.describe('文件夹对比(主进程真实扫描链路)', () => {
|
||||
|
||||
// 加载快照对照:diff.txt 已修复、new.txt 新文件
|
||||
await stubOpenDialogSeq(app, [[snapPath]])
|
||||
await window.getByRole('button', { name: '加载快照' }).click()
|
||||
await window.getByRole('button', { name: '快照' }).click()
|
||||
await window.getByText('加载快照…').click()
|
||||
await expect(window.getByText(/已加载快照/)).toBeVisible()
|
||||
await expect(window.getByText('已修复 1')).toBeVisible()
|
||||
await expect(window.getByText('新文件 1')).toBeVisible()
|
||||
@@ -673,7 +679,8 @@ test.describe('文件夹对比(主进程真实扫描链路)', () => {
|
||||
// 保存快照(v2):差异条目双侧内容写入 JSON
|
||||
const snapPath = join(root, 'baseline.json')
|
||||
await stubSaveDialog(app, snapPath)
|
||||
await window.getByRole('button', { name: '保存快照' }).click()
|
||||
await window.getByRole('button', { name: '快照' }).click()
|
||||
await window.getByText('保存快照…').click()
|
||||
await expect(window.getByText(/快照已保存/)).toBeVisible()
|
||||
const snapRaw = await readFile(snapPath, 'utf-8')
|
||||
expect(snapRaw).toContain('"version": 2')
|
||||
@@ -687,7 +694,8 @@ test.describe('文件夹对比(主进程真实扫描链路)', () => {
|
||||
|
||||
// 加载快照对照 → 双击 diff.txt 进入内容对照(左=快照基线,右=当前左侧文件)
|
||||
await stubOpenDialogSeq(app, [[snapPath]])
|
||||
await window.getByRole('button', { name: '加载快照' }).click()
|
||||
await window.getByRole('button', { name: '快照' }).click()
|
||||
await window.getByText('加载快照…').click()
|
||||
await expect(window.getByText(/已加载快照/)).toBeVisible()
|
||||
await window.getByText('diff.txt').dblclick()
|
||||
await expect(
|
||||
@@ -734,7 +742,8 @@ test.describe('文件夹对比(主进程真实扫描链路)', () => {
|
||||
await stubOpenDialogSeq(app, [[leftDir], [rightDir], [snapPath]])
|
||||
await window.getByRole('button', { name: '对比文件夹' }).click()
|
||||
await expect(window.getByText('相同 1')).toBeVisible()
|
||||
await window.getByRole('button', { name: '加载快照' }).click()
|
||||
await window.getByRole('button', { name: '快照' }).click()
|
||||
await window.getByText('加载快照…').click()
|
||||
// 拦截提示出现,不进入对照模式
|
||||
await expect(window.getByText(/条目不完整无法对照/)).toBeVisible()
|
||||
await expect(window.getByText(/已加载快照/)).toHaveCount(0)
|
||||
@@ -876,7 +885,8 @@ test.describe('大快照加载(0.10.2 专用读取通道)', () => {
|
||||
await stubOpenDialogSeq(app, [[leftDir], [rightDir], [snapPath]])
|
||||
await window.getByRole('button', { name: '对比文件夹' }).click()
|
||||
await expect(window.getByText('相同 1')).toBeVisible()
|
||||
await window.getByRole('button', { name: '加载快照' }).click()
|
||||
await window.getByRole('button', { name: '快照' }).click()
|
||||
await window.getByText('加载快照…').click()
|
||||
// 专用通道(128MB 上限)加载成功:出现对照 toast,而非"文件超过 10MB"拦截
|
||||
await expect(window.getByText(/已加载快照/)).toBeVisible()
|
||||
await expect(window.getByText(/文件超过 10MB/)).toHaveCount(0)
|
||||
|
||||
Reference in New Issue
Block a user