@codemem/server 0.32.0 → 0.32.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/static/app.js +13 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemem/server",
3
- "version": "0.32.0",
3
+ "version": "0.32.2",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {
@@ -19,7 +19,7 @@
19
19
  "drizzle-orm": "^0.45.2",
20
20
  "hono": "^4.12.21",
21
21
  "limiter": "^3.0.0",
22
- "@codemem/core": "^0.32.0"
22
+ "@codemem/core": "^0.32.2"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/better-sqlite3": "^7.6.13",
package/static/app.js CHANGED
@@ -4118,6 +4118,7 @@
4118
4118
  deviceActionPendingKind: "",
4119
4119
  groupRenameDrafts: /* @__PURE__ */ new Map(),
4120
4120
  deviceRenameDrafts: /* @__PURE__ */ new Map(),
4121
+ deviceRenameServerNames: /* @__PURE__ */ new Map(),
4121
4122
  groupPreferencesOpen: /* @__PURE__ */ new Set(),
4122
4123
  groupPreferencesDrafts: /* @__PURE__ */ new Map(),
4123
4124
  groupScopeManagementOpen: /* @__PURE__ */ new Set(),
@@ -7897,14 +7898,22 @@
7897
7898
  }
7898
7899
  function reconcileDeviceRenameDrafts() {
7899
7900
  const next = /* @__PURE__ */ new Map();
7901
+ const nextServerNames = /* @__PURE__ */ new Map();
7900
7902
  const items = Array.isArray(state.lastCoordinatorAdminDevices) ? state.lastCoordinatorAdminDevices : [];
7901
7903
  for (const item of items) {
7902
7904
  const deviceId = String(item.device_id || "").trim();
7903
7905
  if (!deviceId) continue;
7904
- next.set(deviceId, String(item.display_name || ""));
7906
+ const serverName = String(item.display_name || "");
7907
+ const existingDraft = coordinatorAdminState.deviceRenameDrafts.get(deviceId);
7908
+ const previousServerName = coordinatorAdminState.deviceRenameServerNames.get(deviceId);
7909
+ const hasDirtyDraft = existingDraft !== void 0 && (previousServerName === void 0 || existingDraft !== previousServerName);
7910
+ next.set(deviceId, hasDirtyDraft ? existingDraft : serverName);
7911
+ nextServerNames.set(deviceId, serverName);
7905
7912
  }
7906
7913
  coordinatorAdminState.deviceRenameDrafts.clear();
7907
7914
  for (const [deviceId, name] of next.entries()) coordinatorAdminState.deviceRenameDrafts.set(deviceId, name);
7915
+ coordinatorAdminState.deviceRenameServerNames.clear();
7916
+ for (const [deviceId, name] of nextServerNames.entries()) coordinatorAdminState.deviceRenameServerNames.set(deviceId, name);
7908
7917
  }
7909
7918
  //#endregion
7910
7919
  //#region src/tabs/coordinator-admin/data/team-card.ts
@@ -11138,6 +11147,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
11138
11147
  state.lastCoordinatorAdminJoinRequests = [];
11139
11148
  state.lastCoordinatorAdminDevices = [];
11140
11149
  coordinatorAdminState.deviceRenameDrafts.clear();
11150
+ coordinatorAdminState.deviceRenameServerNames.clear();
11141
11151
  renderShell();
11142
11152
  return;
11143
11153
  }
@@ -11166,7 +11176,6 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
11166
11176
  reconcileDeviceRenameDrafts();
11167
11177
  } catch {
11168
11178
  state.lastCoordinatorAdminDevices = [];
11169
- coordinatorAdminState.deviceRenameDrafts.clear();
11170
11179
  }
11171
11180
  try {
11172
11181
  coordinatorAdminState.availableProjects = await loadProjects$1();
@@ -11179,6 +11188,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
11179
11188
  state.lastCoordinatorAdminJoinRequests = [];
11180
11189
  state.lastCoordinatorAdminDevices = [];
11181
11190
  coordinatorAdminState.deviceRenameDrafts.clear();
11191
+ coordinatorAdminState.deviceRenameServerNames.clear();
11182
11192
  }
11183
11193
  renderShell();
11184
11194
  }
@@ -22203,7 +22213,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${titl
22203
22213
  try {
22204
22214
  const runtime = await loadRuntimeInfo();
22205
22215
  if (!runtime?.version) return;
22206
- setRuntimeLabel(runtime.version, "ddca13f");
22216
+ setRuntimeLabel(runtime.version, "b4af8ab");
22207
22217
  } catch {}
22208
22218
  }
22209
22219
  var lastAnnouncedRefreshState = null;