@widgetic/chat 0.1.19 → 0.1.20

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.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @widgetic/chat
2
2
 
3
+ > **Internal building block.** This package is part of Widgetic's own apps and is not a supported integration surface. Partners: use [`@widgetic/ui-sdk`](https://www.npmjs.com/package/@widgetic/ui-sdk) instead.
4
+
3
5
  A modern, reusable chat module built with Svelte 5, TypeScript, and the Widgetic Design System. Designed for canvas-based platforms with frame content integration and LLM communication.
4
6
 
5
7
  ## Features
@@ -1334,6 +1334,11 @@
1334
1334
  }
1335
1335
  }
1336
1336
  if (!headId) return;
1337
+ // Copying every message forces the open chat to rebuild. Completion marks
1338
+ // the head twice (new bubble, then the status line). The second copy, on a
1339
+ // long thread, ran in the same turn as the version-menu rebuild.
1340
+ const needsWrite = msgs.some((m) => (m.id === headId) !== !!m.isWidgetHead || !!m.rolledBackAt);
1341
+ if (!needsWrite) return;
1337
1342
  const updated = msgs.map((m) => ({
1338
1343
  ...m,
1339
1344
  isWidgetHead: m.id === headId,
@@ -172,6 +172,14 @@ function createChatStore() {
172
172
  */
173
173
  actions: {
174
174
  setActiveContext: (contextId, isExpanded) => {
175
+ const current = get(chatStore);
176
+ const nextExpanded = isExpanded ?? current.activeContext.isExpanded;
177
+ // A new object with the same id still notified every subscriber. The chat
178
+ // effect runs on each parent render (the context object is inline), and
179
+ // that write scheduled another render of every open conversation.
180
+ if (current.activeContext.contextId === contextId && current.activeContext.isExpanded === nextExpanded) {
181
+ return;
182
+ }
175
183
  update(state => ({
176
184
  ...state,
177
185
  activeContext: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/chat",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -71,7 +71,7 @@
71
71
  "@tailwindcss/postcss": "^4.1.4",
72
72
  "@types/node": "^26.4.1",
73
73
  "@widgetic/api-sdk": "^1.0.10",
74
- "@widgetic/design-system": "^0.5.12",
74
+ "@widgetic/design-system": "^0.5.17",
75
75
  "@widgetic/dev-tools": "^0.2.0",
76
76
  "autoprefixer": "^10.4.20",
77
77
  "eslint": "^9.0.0",