refactor(editor): toc dragging with std.dnd (#9883)

Close [BS-2458](https://linear.app/affine-design/issue/BS-2458/toc-dnd重构)

### What Changes
- Refactor toc note card dnd with `std.dnd`
- Extract note display mode change to command `changeNoteDisplayMode`
  - It will reorder notes when the display mode changed from `EdgelessOnly` to page mode visible (a.k.a `DocOnly` or `Both`)
This commit is contained in:
L-Sun
2025-01-24 13:27:17 +00:00
parent 351816b343
commit 829980bace
17 changed files with 689 additions and 687 deletions

View File

@@ -302,7 +302,7 @@ export async function assertVisibleBlockCount(
// not only count, but also check if all the blocks are visible
const locator = page.locator(`affine-${flavour}`);
let visibleCount = 0;
for (let i = 0; i < count; i++) {
for (let i = 0; i < (await locator.count()); i++) {
if (await locator.nth(i).isVisible()) {
visibleCount++;
}