darabos commited on
Commit
4114106
·
1 Parent(s): 3752479

Preserve selection when receiving CRDT updates.

Browse files
lynxkite-app/web/playwright.config.ts CHANGED
@@ -2,7 +2,7 @@ import { defineConfig, devices } from "@playwright/test";
2
 
3
  export default defineConfig({
4
  testDir: "./tests",
5
- timeout: process.env.CI ? 20000 : 10000,
6
  fullyParallel: false,
7
  /* Fail the build on CI if you accidentally left test.only in the source code. */
8
  forbidOnly: !!process.env.CI,
 
2
 
3
  export default defineConfig({
4
  testDir: "./tests",
5
+ timeout: process.env.CI ? 30000 : 10000,
6
  fullyParallel: false,
7
  /* Fail the build on CI if you accidentally left test.only in the source code. */
8
  forbidOnly: !!process.env.CI,
lynxkite-app/web/src/workspace/Workspace.tsx CHANGED
@@ -81,7 +81,11 @@ function LynxKiteFlow() {
81
  n.dragHandle = ".bg-primary";
82
  }
83
  }
84
- setNodes([...state.workspace.nodes] as Node[]);
 
 
 
 
85
  setEdges([...state.workspace.edges] as Edge[]);
86
  for (const node of state.workspace.nodes) {
87
  // Make sure the internal copies are updated.
 
81
  n.dragHandle = ".bg-primary";
82
  }
83
  }
84
+ const selection = state.workspace.nodes.filter((n) => n.selected).map((n) => n.id);
85
+ const nodes = state.workspace.nodes.map((n) =>
86
+ selection.includes(n.id) ? { ...n, selected: true } : n,
87
+ );
88
+ setNodes([...nodes] as Node[]);
89
  setEdges([...state.workspace.edges] as Edge[]);
90
  for (const node of state.workspace.nodes) {
91
  // Make sure the internal copies are updated.