fix(acceptance): 首轮 Windows 验收 7 项缺陷回修(docs/14)

P0 快捷键让行判定补 recoveryDismissed,点过「稍后再说」不再全失效;
P1 冲突重载加 force 绕过防竞态守卫;路径分隔符 joinPath 原生化 +
samePath 归一化比较;.source-cm 补文档字色;
P2 turndown 启用 GFM 插件(HTML 导入不再丢表格);任务复选框去掉
click preventDefault(浏览器激活撤销覆盖视觉同步);
P3 新增 syncEditorContent:干净标签的挂载/卸载序列化回写同步基线,
切标签不再误标未保存。vitest 74 通过 + 2 跳过。
This commit is contained in:
Muse
2026-11-14 11:08:24 +08:00
parent 947154892c
commit 9bd3f3de97
12 changed files with 179 additions and 36 deletions

View File

@@ -61,3 +61,20 @@ describe('标签页会话模型', () => {
expect(s.tabs[0].id).toBe(t3.id === s.tabs[0].id ? t3.id : s.tabs[0].id)
})
})
describe('syncEditorContent(验收 P3 回归)', () => {
it('干净标签的规范化回写同步基线、不标脏;脏标签只更新正文', () => {
const t = createTab({ content: '| A |\n|---|\n| 1 |' })
let s: TabsState = { tabs: [t], activeId: t.id }
// 挂载序列化把对齐冒号规范化了:干净标签基线跟随,仍不脏
s = tabsReducer(s, { type: 'syncEditorContent', id: t.id, content: '| A |\n|:---|\n| 1 |' })
expect(isDirty(s.tabs[0])).toBe(false)
expect(s.tabs[0].content).toContain(':---')
// 脏标签:只更新正文,基线不动
s = tabsReducer(s, { type: 'updateContent', id: t.id, content: '改过' })
expect(isDirty(s.tabs[0])).toBe(true)
s = tabsReducer(s, { type: 'syncEditorContent', id: t.id, content: '改过又回写' })
expect(s.tabs[0].savedContent).toContain(':---')
expect(isDirty(s.tabs[0])).toBe(true)
})
})