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:
@@ -82,9 +82,9 @@ describe("the editor's shared document", () => {
|
||||
expect(miaReady.you).toEqual({ id: miaId, name: 'Mia', color: '#3366cc' });
|
||||
expect(benReady.you).toMatchObject({ id: benId, name: 'Ben' });
|
||||
// A reader is seen too: the awareness is not the document.
|
||||
benReady.awareness.setLocalState({ v: 1, user: benReady.you, selection: 'router', windows: [] });
|
||||
benReady.awareness.setLocalState({ v: 1, user: benReady.you, selection: 'router', windows: [], moving: null });
|
||||
await until(() => peersOf(miaReady.awareness.getStates(), miaReady.awareness.clientID).length === 1);
|
||||
expect(peersOf(miaReady.awareness.getStates(), miaReady.awareness.clientID)[0]!.state).toEqual({ v: 1, user: benReady.you, selection: 'router', windows: [] });
|
||||
expect(peersOf(miaReady.awareness.getStates(), miaReady.awareness.clientID)[0]!.state).toEqual({ v: 1, user: benReady.you, selection: 'router', windows: [], moving: null });
|
||||
// Gone, he is gone for her too.
|
||||
ben.close();
|
||||
await until(() => peersOf(miaReady.awareness.getStates(), miaReady.awareness.clientID).length === 0);
|
||||
|
||||
Reference in New Issue
Block a user