feat: F5.6d a drag is one change of the document; the others see it through the presence
Moving a device, moving or resizing a documentation item went into the shared document at every pointer move: 59 updates a second, each leaving about 18 bytes of history (M4 on test-filius). Now the editor keeps the drag while it lasts, shows it itself and tells the others through the awareness (moving, at most every 50 ms, the end at once), and writes it once when it is let go. A drag the browser cancels or a second finger turns into a pinch is written where it is; WebKit sends a second pointerdown for the first finger when another comes, which had lost the drag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -163,6 +163,32 @@ test('three people in one project of F: moving, reading only, one simulation for
|
||||
await expect(canvas(mia)).toBeVisible();
|
||||
});
|
||||
|
||||
test('shows a drag to the others while it lasts, and stores it in F once, when it is let go', async ({ browser }) => {
|
||||
const project = await f.project('java-examples/internetwork_komplett.fls');
|
||||
const mia = await person(browser, project.id, 'Mia');
|
||||
const ben = await person(browser, project.id, 'Ben');
|
||||
const id = project.node('Rechner 3.10');
|
||||
const before = await box(ben, id);
|
||||
await expect.poll(() => f.updateCount(project.id)).toBe(0);
|
||||
const from = await onDevice(mia, id);
|
||||
await mia.mouse.move(from.x, from.y);
|
||||
await mia.mouse.down();
|
||||
for (let step = 1; step <= 30; step++) {
|
||||
await mia.mouse.move(from.x - 3 * step, from.y + 2 * step);
|
||||
await mia.waitForTimeout(16);
|
||||
}
|
||||
// Still held: Mia and Ben see it on its way, F has stored nothing of it.
|
||||
expect(await box(mia, id)).not.toBe(before);
|
||||
await expect.poll(async () => (await box(ben, id)) !== before).toBe(true);
|
||||
expect(await f.updateCount(project.id)).toBe(0);
|
||||
await mia.mouse.up();
|
||||
await expect.poll(async () => box(ben, id)).toBe(await box(mia, id));
|
||||
await expect.poll(() => f.updateCount(project.id)).toBe(1);
|
||||
await mia.waitForTimeout(500);
|
||||
expect(await f.updateCount(project.id)).toBe(1);
|
||||
expect(await box(ben, id)).toBe(await box(mia, id));
|
||||
});
|
||||
|
||||
test('takes a large picture one person imports to F as a blob, and shows it to another', async ({ browser }) => {
|
||||
test.setTimeout(120_000);
|
||||
const project = await f.project('java-examples/internetwork_komplett.fls');
|
||||
|
||||
Reference in New Issue
Block a user