fix: should bring children to new doc created (#9316)
Closes: [BS-2186](https://linear.app/affine-design/issue/BS-2186/created-linked-doc-%E6%97%B6%EF%BC%8C%E4%BC%9A%E6%B8%85%E9%99%A4list%E7%9A%84-children)
This commit is contained in:
@@ -32,7 +32,7 @@ export const quickActionConfig: QuickActionConfig[] = [
|
|||||||
.chain()
|
.chain()
|
||||||
.getSelectedModels({
|
.getSelectedModels({
|
||||||
types: ['block'],
|
types: ['block'],
|
||||||
mode: 'highest',
|
mode: 'flat',
|
||||||
})
|
})
|
||||||
.draftSelectedModels()
|
.draftSelectedModels()
|
||||||
.run();
|
.run();
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ export function toolbarDefaultConfig(toolbar: AffineFormatBarWidget) {
|
|||||||
const [_, ctx] = chain
|
const [_, ctx] = chain
|
||||||
.getSelectedModels({
|
.getSelectedModels({
|
||||||
types: ['block', 'text'],
|
types: ['block', 'text'],
|
||||||
mode: 'highest',
|
mode: 'flat',
|
||||||
})
|
})
|
||||||
.draftSelectedModels()
|
.draftSelectedModels()
|
||||||
.run();
|
.run();
|
||||||
|
|||||||
@@ -965,6 +965,9 @@ test('create linked doc from block selection with format bar', async ({
|
|||||||
expect(await getPageSnapshot(page, true)).toMatchSnapshot(
|
expect(await getPageSnapshot(page, true)).toMatchSnapshot(
|
||||||
`${testInfo.title}.json`
|
`${testInfo.title}.json`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const paragraph = page.locator('affine-paragraph');
|
||||||
|
await expect(paragraph).toHaveCount(3);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.describe('more menu button', () => {
|
test.describe('more menu button', () => {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"type": "block",
|
"type": "block",
|
||||||
"id": "11",
|
"id": "12",
|
||||||
"flavour": "affine:embed-linked-doc",
|
"flavour": "affine:embed-linked-doc",
|
||||||
"version": 1,
|
"version": 1,
|
||||||
"props": {
|
"props": {
|
||||||
|
|||||||
Reference in New Issue
Block a user