shadok-ai 0.16.11 → 0.16.12

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 +1 -1
  2. package/public/index.html +15 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.16.11",
3
+ "version": "0.16.12",
4
4
  "main": "dist/session.js",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test --test-timeout=120000 test/*.ts context/*/test/*.test.mjs",
package/public/index.html CHANGED
@@ -5273,6 +5273,20 @@
5273
5273
  // source of truth. A new session (e.g. a Telegram /spawn) shows up as a tab
5274
5274
  // live; a renamed channel renames its tab; a channel that left the registry
5275
5275
  // (ended elsewhere) closes its tab.
5276
+ /** Is a group name being TYPED right now, anywhere? The server→client name
5277
+ * sync must not overwrite the field under the cursor, and there are three
5278
+ * places to rename a group: its head in the agents column, its row in the
5279
+ * rail, and — since the column title became editable — that title. Keying
5280
+ * the guard on the group HEAD alone missed the last two: `inlineRename`
5281
+ * swaps the span it was given for the input, so the input is wherever the
5282
+ * gesture started, not inside `headEl`. One query over all three, and the
5283
+ * name is simply left alone for one poll (4 s), which costs nothing. */
5284
+ function renamingAGroup() {
5285
+ return !!document.querySelector(
5286
+ "#groups input.rename, #railList input.rename, #tabbar .side-label input.rename",
5287
+ );
5288
+ }
5289
+
5276
5290
  let lastChannelIds = new Set();
5277
5291
  async function syncChannels() {
5278
5292
  if (restoring) return;
@@ -5292,7 +5306,7 @@
5292
5306
  if (sg == null || sg.id == null) continue;
5293
5307
  const g = groups.find((x) => x.id === sg.id);
5294
5308
  if (!g) { createGroup(sg); continue; }
5295
- if (sg.name && sg.name !== g.nameEl.textContent && !g.headEl.querySelector("input"))
5309
+ if (sg.name && sg.name !== g.nameEl.textContent && !renamingAGroup())
5296
5310
  g.nameEl.textContent = sg.name;
5297
5311
  if (sg.icon && sg.icon !== g.icon) g.icon = sg.icon;
5298
5312
  }