chore(editor): improve selection of doc in canvas (#11314)

Close [BS-2705](https://linear.app/affine-design/issue/BS-2705/[improvement]-通过-viability-control-选择-hide-in-edgeless)

This PR disabled selecting operation of notes that are only shown in page mode.
This commit is contained in:
L-Sun
2025-03-31 12:35:02 +00:00
parent 587fea02b8
commit fec698fd8b
4 changed files with 107 additions and 28 deletions

View File

@@ -320,9 +320,10 @@ test.describe('TOC and edgeless selection', () => {
expect(await getEdgelessSelectedIds(page)).toHaveLength(0);
await cards.nth(1).click();
expect(await getEdgelessSelectedIds(page)).toHaveLength(1);
await cards.nth(1).click();
expect(await getEdgelessSelectedIds(page)).toHaveLength(0);
expect(
await getEdgelessSelectedIds(page),
'should not select doc only note'
).toHaveLength(0);
await cards.nth(2).click();
expect(await getEdgelessSelectedIds(page)).toHaveLength(1);
@@ -333,7 +334,7 @@ test.describe('TOC and edgeless selection', () => {
await cards.nth(1).click({ modifiers: ['Shift'] });
await cards.nth(2).click({ modifiers: ['Shift'] });
expect(await getEdgelessSelectedIds(page)).toHaveLength(3);
expect(await getEdgelessSelectedIds(page)).toHaveLength(2);
});
test('should select note cards when select note blocks in canvas', async ({