feat(editor): insert embed doc with quick search by default (#12165)

Close [BS-3404](https://linear.app/affine-design/issue/BS-3404/通过embed-doc时,插入的doc还是card-view,应该要默认embed-view)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added the ability to insert and display embedded synced documents, supporting different link types based on editor mode and user preferences.
  - Introduced new UI interactions and view options for embedded synced documents in edgeless mode.

- **Bug Fixes**
  - Updated UI selectors and preference keys to ensure consistent behavior and correct application of user settings.

- **Tests**
  - Added and updated end-to-end tests for embedding synced documents, including header interactions and viewport fitting.
  - Improved test coverage for quick search insertion and edgeless embed synced doc features.

- **Chores**
  - Renamed settings and updated exports to align with new embedding functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
L-Sun
2025-05-08 10:21:32 +00:00
parent d379143db3
commit 11dfc1d1df
14 changed files with 113 additions and 12 deletions

View File

@@ -484,21 +484,21 @@ test('can use @ to open quick search to search for doc and insert into canvas',
// press enter to insert the page to canvas
await page.keyboard.press('Enter');
await expect(
page.locator('affine-embed-edgeless-linked-doc-block')
page.locator('affine-embed-edgeless-synced-doc-block')
).toBeVisible();
await expect(
page.locator('.affine-embed-linked-doc-content-title')
page.getByTestId('edgeless-embed-synced-doc-title')
).toContainText(docTitle);
// focus on the note block
await page.waitForTimeout(500);
await page
.locator('affine-embed-edgeless-linked-doc-block')
.locator('affine-embed-edgeless-synced-doc-block')
.click({ force: true });
await page.waitForTimeout(500);
// double clock to show peek view
await page
.locator('affine-embed-edgeless-linked-doc-block')
.locator('affine-embed-edgeless-synced-doc-block')
.dblclick({ force: true });
await expect(page.getByTestId('peek-view-modal')).toBeVisible();
});