mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-24 09:52:49 +08:00
fix(editor): toc viewer no update after delete heading in edgeless mode (#12411)
Close [BS-3494](https://linear.app/affine-design/issue/BS-3494/在白板删除note的标题,切回page模式,toc没更新) Other changes: `doc` -> `store` ### Before https://github.com/user-attachments/assets/ddce20b9-eda2-414b-9452-d8d54a811cf1 ### After https://github.com/user-attachments/assets/7124b8a1-9ab4-4e09-b0ff-7ea2cc9613c2 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved synchronization of the outline viewer to ensure updates after editing headings in edgeless mode. - **Tests** - Added an end-to-end test verifying that the outline viewer correctly reflects changes made in edgeless mode. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -179,6 +179,25 @@ test('should hide edgeless-only note headings', async ({ page }) => {
|
||||
await expect(h1InPanel).toContainText(['Heading 1']);
|
||||
});
|
||||
|
||||
test('outline viewer should update after change heading in edgeless mode', async ({
|
||||
page,
|
||||
}) => {
|
||||
await createTitle(page);
|
||||
await pressEnter(page);
|
||||
|
||||
await type(page, '# ');
|
||||
await type(page, 'Heading 1');
|
||||
|
||||
await clickEdgelessModeButton(page);
|
||||
const note = page.locator('affine-edgeless-note');
|
||||
await note.dblclick();
|
||||
await type(page, '# New Heading');
|
||||
await clickPageModeButton(page);
|
||||
|
||||
const indicators = getIndicators(page);
|
||||
await expect(indicators).toHaveCount(3);
|
||||
});
|
||||
|
||||
test('outline viewer should be useable in doc peek preview', async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
Reference in New Issue
Block a user